fix: chemin stable pour AppImage, desktop entry permanent après install initiale
This commit is contained in:
12
main.js
12
main.js
@@ -153,9 +153,15 @@ async function downloadAndInstall(downloadUrl, version) {
|
||||
sendUpdateProgress(100, 'installing');
|
||||
if (process.platform === 'linux') {
|
||||
fs.chmodSync(tmpPath, 0o755);
|
||||
const current = process.env.APPIMAGE;
|
||||
if (current) { fs.copyFileSync(tmpPath, current); fs.unlinkSync(tmpPath); app.relaunch(); }
|
||||
else app.relaunch({ execPath: tmpPath });
|
||||
const stablePath = path.join(require('os').homedir(), '.local', 'bin', 'farm-tracker.AppImage');
|
||||
const target = fs.existsSync(stablePath) ? stablePath : process.env.APPIMAGE;
|
||||
if (target) {
|
||||
fs.copyFileSync(tmpPath, target);
|
||||
fs.unlinkSync(tmpPath);
|
||||
app.relaunch({ execPath: target });
|
||||
} else {
|
||||
app.relaunch({ execPath: tmpPath });
|
||||
}
|
||||
app.exit(0);
|
||||
} else if (process.platform === 'win32') {
|
||||
const { spawn } = require('child_process');
|
||||
|
||||
Reference in New Issue
Block a user