fix: JRE retry button

This commit is contained in:
Fazri Gading
2026-01-25 05:18:22 +08:00
parent 9f43a32779
commit ea21fb15d6
7 changed files with 386 additions and 104 deletions

View File

@@ -520,9 +520,17 @@ async function installGame(playerName = 'Player', progressCallback, javaPathOver
try {
await downloadJRE(progressCallback, customCacheDir, customJreDir);
} catch (error) {
// Don't immediately fall back to system Java for JRE download errors - let user retry
if (error.isJREError) {
console.error('[Install] JRE download failed, allowing user retry:', error.message);
throw error; // Re-throw JRE errors to trigger retry UI
}
// For non-download JRE errors, fall back to system Java
const fallback = await detectSystemJava();
if (fallback) {
javaBin = fallback;
console.log('[Install] Using system Java as fallback');
} else {
throw error;
}