mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-02-23 16:31:20 +08:00
Do not run update script in dev environment
This commit is contained in:
parent
095233590f
commit
abae9219b4
49
main.js
49
main.js
@ -137,29 +137,36 @@ app.on('ready', () => {
|
||||
|
||||
createWindow()
|
||||
|
||||
autoUpdater.autoInstallOnAppQuit = true;
|
||||
autoUpdater.autoDownload = false;
|
||||
if (process.execPath && process.execPath.match(/electron\.\w+$/)) {
|
||||
|
||||
autoUpdater.on('update-available', (a) => {
|
||||
console.log('update-available', a)
|
||||
ipcMain.on('allow-auto-update', () => {
|
||||
autoUpdater.downloadUpdate()
|
||||
console.log('[Blockbench] Launching in development mode')
|
||||
|
||||
} else {
|
||||
|
||||
autoUpdater.autoInstallOnAppQuit = true;
|
||||
autoUpdater.autoDownload = false;
|
||||
|
||||
autoUpdater.on('update-available', (a) => {
|
||||
console.log('update-available', a)
|
||||
ipcMain.on('allow-auto-update', () => {
|
||||
autoUpdater.downloadUpdate()
|
||||
})
|
||||
orig_win.webContents.send('update-available');
|
||||
})
|
||||
orig_win.webContents.send('update-available');
|
||||
})
|
||||
autoUpdater.on('update-downloaded', (a) => {
|
||||
console.log('update-downloaded', a)
|
||||
orig_win.webContents.send('update-downloaded', a)
|
||||
})
|
||||
autoUpdater.on('error', (a) => {
|
||||
console.log('update-error', a)
|
||||
orig_win.webContents.send('update-error', a)
|
||||
})
|
||||
autoUpdater.on('download-progress', (a) => {
|
||||
console.log('update-progress', a)
|
||||
orig_win.webContents.send('update-progress', a)
|
||||
})
|
||||
autoUpdater.checkForUpdates().catch(err => {})
|
||||
autoUpdater.on('update-downloaded', (a) => {
|
||||
console.log('update-downloaded', a)
|
||||
orig_win.webContents.send('update-downloaded', a)
|
||||
})
|
||||
autoUpdater.on('error', (a) => {
|
||||
console.log('update-error', a)
|
||||
orig_win.webContents.send('update-error', a)
|
||||
})
|
||||
autoUpdater.on('download-progress', (a) => {
|
||||
console.log('update-progress', a)
|
||||
orig_win.webContents.send('update-progress', a)
|
||||
})
|
||||
autoUpdater.checkForUpdates().catch(err => {})
|
||||
}
|
||||
})
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user