Compare commits

..

2 Commits

Author SHA1 Message Date
2dfef751c0 Merge branch 'main' of http://synbox.ruv.wtf:8418/litruv/cinny-desktop
Some checks failed
Build / increment-version (push) Successful in 6s
Build / build-linux (push) Failing after 49s
Build / build-windows (push) Failing after 2m2s
Build / create-release (push) Has been skipped
Build Paarrot Windows / start-vm (push) Failing after 5m34s
Build Paarrot Windows / build (push) Has been skipped
2026-03-25 07:17:30 +11:00
bf786742a5 feat: enhance update installation process for Linux, Windows, and macOS 2026-03-25 07:17:28 +11:00

View File

@@ -257,18 +257,44 @@ async function downloadGiteaUpdate() {
/**
* Launches the downloaded installer (or opens the release page if no file was
* downloaded) and quits the app.
* On Linux/AppImage: overwrites the running AppImage in-place and relaunches.
* On Windows: runs the installer and quits.
* On macOS: opens the DMG for manual installation.
*/
function installGiteaUpdate() {
if (downloadedUpdatePath && fs.existsSync(downloadedUpdatePath)) {
if (process.platform === 'win32') {
exec(`"${downloadedUpdatePath}"`);
} else {
app.quit();
} else if (process.platform === 'linux') {
const currentAppImage = process.env.APPIMAGE;
if (currentAppImage) {
try {
fs.chmodSync(downloadedUpdatePath, 0o755);
fs.copyFileSync(downloadedUpdatePath, currentAppImage);
fs.unlinkSync(downloadedUpdatePath);
console.log('AppImage replaced, relaunching...');
app.relaunch({ execPath: currentAppImage });
app.quit();
} catch (err) {
console.error('Failed to replace AppImage in-place, opening file instead:', err);
shell.openPath(downloadedUpdatePath);
app.quit();
}
} else {
// Not running as AppImage (e.g. dev/unpacked), just open it
shell.openPath(downloadedUpdatePath);
app.quit();
}
} else {
// macOS: open the DMG for manual installation
shell.openPath(downloadedUpdatePath);
app.quit();
}
} else if (pendingUpdateInfo?.htmlUrl) {
shell.openExternal(pendingUpdateInfo.htmlUrl);
}
app.quit();
}
}