electrobun 0.0.19-beta.73 → 0.0.19-beta.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/bun/core/Updater.ts +19 -14
- package/package.json +1 -1
|
@@ -11,8 +11,8 @@ function getAppDataDir(): string {
|
|
|
11
11
|
case 'macos':
|
|
12
12
|
return join(homedir(), "Library", "Application Support");
|
|
13
13
|
case 'win':
|
|
14
|
-
// Use
|
|
15
|
-
return process.env.
|
|
14
|
+
// Use LOCALAPPDATA to match extractor location
|
|
15
|
+
return process.env.LOCALAPPDATA || join(homedir(), "AppData", "Local");
|
|
16
16
|
case 'linux':
|
|
17
17
|
// Use XDG_CONFIG_HOME or fallback to ~/.config
|
|
18
18
|
return process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
|
|
@@ -374,18 +374,21 @@ const Updater = {
|
|
|
374
374
|
".."
|
|
375
375
|
);
|
|
376
376
|
} else {
|
|
377
|
-
// On Windows,
|
|
378
|
-
runningAppBundlePath =
|
|
377
|
+
// On Windows, executable is at app/bin/launcher.exe (same as Linux)
|
|
378
|
+
runningAppBundlePath = resolve(
|
|
379
|
+
dirname(process.execPath),
|
|
380
|
+
"..",
|
|
381
|
+
".."
|
|
382
|
+
);
|
|
379
383
|
}
|
|
380
384
|
// Platform-specific backup naming and location
|
|
381
385
|
let backupAppBundlePath: string;
|
|
382
|
-
if (currentOS === '
|
|
383
|
-
// On
|
|
384
|
-
backupAppBundlePath = join(extractionFolder, "backup");
|
|
386
|
+
if (currentOS === 'macos') {
|
|
387
|
+
// On macOS, backup in extraction folder with .app extension
|
|
388
|
+
backupAppBundlePath = join(extractionFolder, "backup.app");
|
|
385
389
|
} else {
|
|
386
|
-
// On
|
|
387
|
-
|
|
388
|
-
backupAppBundlePath = join(extractionFolder, backupName);
|
|
390
|
+
// On Linux/Windows, keep backup in self-extraction folder
|
|
391
|
+
backupAppBundlePath = join(extractionFolder, "backup");
|
|
389
392
|
}
|
|
390
393
|
|
|
391
394
|
try {
|
|
@@ -421,12 +424,14 @@ const Updater = {
|
|
|
421
424
|
await Bun.spawn(["open", runningAppBundlePath]);
|
|
422
425
|
break;
|
|
423
426
|
case 'win':
|
|
424
|
-
// On Windows, the
|
|
425
|
-
|
|
427
|
+
// On Windows, launch the launcher.exe inside the app directory
|
|
428
|
+
const windowsLauncher = join(runningAppBundlePath, "bin", "launcher.exe");
|
|
429
|
+
await Bun.spawn([windowsLauncher]);
|
|
426
430
|
break;
|
|
427
431
|
case 'linux':
|
|
428
|
-
// On Linux,
|
|
429
|
-
|
|
432
|
+
// On Linux, launch the launcher inside the app directory
|
|
433
|
+
const linuxLauncher = join(runningAppBundlePath, "bin", "launcher");
|
|
434
|
+
await Bun.spawn([linuxLauncher]);
|
|
430
435
|
break;
|
|
431
436
|
}
|
|
432
437
|
process.exit(0);
|
package/package.json
CHANGED