Compare commits
1 Commits
v1.0.6
...
35481fe7d7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35481fe7d7 |
22
main.js
22
main.js
@@ -153,25 +153,9 @@ async function downloadAndInstall(downloadUrl, version) {
|
|||||||
sendUpdateProgress(100, 'installing');
|
sendUpdateProgress(100, 'installing');
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
fs.chmodSync(tmpPath, 0o755);
|
fs.chmodSync(tmpPath, 0o755);
|
||||||
const stablePath = path.join(require('os').homedir(), '.local', 'bin', 'farm-tracker.AppImage');
|
const { spawn } = require('child_process');
|
||||||
try {
|
spawn(tmpPath, [], { detached: true, stdio: 'ignore' }).unref();
|
||||||
fs.mkdirSync(path.dirname(stablePath), { recursive: true });
|
app.quit();
|
||||||
fs.copyFileSync(tmpPath, stablePath);
|
|
||||||
fs.chmodSync(stablePath, 0o755);
|
|
||||||
fs.unlinkSync(tmpPath);
|
|
||||||
app.relaunch({ execPath: stablePath });
|
|
||||||
} catch (_) {
|
|
||||||
// fallback: remplace l'AppImage courant si la copie vers bin/ échoue
|
|
||||||
const fallback = process.env.APPIMAGE;
|
|
||||||
if (fallback) {
|
|
||||||
fs.copyFileSync(tmpPath, fallback);
|
|
||||||
fs.unlinkSync(tmpPath);
|
|
||||||
app.relaunch({ execPath: fallback });
|
|
||||||
} else {
|
|
||||||
app.relaunch({ execPath: tmpPath });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
app.exit(0);
|
|
||||||
} else if (process.platform === 'win32') {
|
} else if (process.platform === 'win32') {
|
||||||
const { spawn } = require('child_process');
|
const { spawn } = require('child_process');
|
||||||
spawn(tmpPath, ['/S'], { detached: true, stdio: 'ignore' }).unref();
|
spawn(tmpPath, ['/S'], { detached: true, stdio: 'ignore' }).unref();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "farm-tracker",
|
"name": "farm-tracker",
|
||||||
"version": "1.0.5",
|
"version": "1.0.7",
|
||||||
"description": "Suivi de loot Minecraft en direct, avec sauvegarde automatique des stats et des chances de drop.",
|
"description": "Suivi de loot Minecraft en direct, avec sauvegarde automatique des stats et des chances de drop.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user