Skip to content

Commit 4b993bd

Browse files
committed
Merge commit '806690f3555a5e147fc5c8bee80876bffc8ceda8' into release
2 parents 5f655d9 + 806690f commit 4b993bd

File tree

3 files changed

+655
-351
lines changed

3 files changed

+655
-351
lines changed

electron-builder-win.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
"createDesktopShortcut": false
4646
},
4747
"msi": {
48-
"artifactName": "${productName}-${version}.${ext}"
48+
"artifactName": "${productName}-${version}.${ext}",
49+
"runAfterFinish": false,
50+
"createDesktopShortcut": false
4951
},
5052
"portable": {
5153
"artifactName": "${productName}-${version}-windows-no-installer.${ext}"

src/main/electron.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ import contextMenu from 'electron-context-menu';
1818
import {spawn} from 'child_process';
1919
import {disableUpdate as disUpPkg} from './disableUpdate.js';
2020
const disableUpdate = disUpPkg() ||
21-
process.env.DRAWIO_DISABLE_UPDATE === 'true' ||
21+
process.env.DRAWIO_DISABLE_UPDATE === 'true' ||
22+
process.argv.indexOf('--disable-update') !== -1 ||
2223
fs.existsSync('/.flatpak-info'); //This file indicates running in flatpak sandbox
24+
const silentUpdate = !disableUpdate && (process.env.DRAWIO_SILENT_UPDATE === 'true' ||
25+
process.argv.indexOf('--silent-update') !== -1);
2326
autoUpdater.logger = log
2427
autoUpdater.logger.transports.file.level = 'error'
2528
autoUpdater.logger.transports.console.level = 'error'
26-
autoUpdater.autoDownload = false
29+
autoUpdater.autoDownload = silentUpdate
30+
autoUpdater.autoInstallOnAppQuit = silentUpdate
2731

2832
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
2933

@@ -1157,6 +1161,8 @@ autoUpdater.on('error', e => log.error('@error@\n', e))
11571161

11581162
autoUpdater.on('update-available', (a, b) =>
11591163
{
1164+
if (silentUpdate) return;
1165+
11601166
dialog.showMessageBox(
11611167
{
11621168
type: 'question',

0 commit comments

Comments
 (0)