diff --git a/src/vs/platform/update/electron-main/auto-updater.win32.ts b/src/vs/platform/update/electron-main/auto-updater.win32.ts index 55da62dda4e..3100d0941d2 100644 --- a/src/vs/platform/update/electron-main/auto-updater.win32.ts +++ b/src/vs/platform/update/electron-main/auto-updater.win32.ts @@ -164,12 +164,18 @@ export class Win32AutoUpdaterImpl extends EventEmitter implements IAutoUpdater { return this.cachePath.then(cachePath => { this.currentUpdate.updateFilePath = path.join(cachePath, `CodeSetup-${product.quality}-${this.currentUpdate.version}.flag`); - return pfs.touch(this.currentUpdate.updateFilePath).then(() => { - spawn(this.currentUpdate.packagePath, ['/verysilent', '/update=FILENAME', '/nocloseapplications', '/mergetasks=runcode,!desktopicon,!quicklaunchicon'], { + return pfs.writeFile(this.currentUpdate.updateFilePath, 'flag').then(() => { + const child = spawn(this.currentUpdate.packagePath, ['/verysilent', `/update="${this.currentUpdate.updateFilePath}"`, '/nocloseapplications', '/mergetasks=runcode,!desktopicon,!quicklaunchicon'], { detached: true, stdio: ['ignore', 'ignore', 'ignore'] }); + child.once('exit', () => { + this.emit('update-not-available'); + this.currentRequest = null; + this.currentUpdate = null; + }); + const readyMutexName = `${product.win32MutexName}-ready`; const isActive = (require.__$__nodeRequire('windows-mutex') as any).isActive; diff --git a/src/vs/workbench/parts/update/electron-browser/update.ts b/src/vs/workbench/parts/update/electron-browser/update.ts index 08349ed005d..34e36f495bb 100644 --- a/src/vs/workbench/parts/update/electron-browser/update.ts +++ b/src/vs/workbench/parts/update/electron-browser/update.ts @@ -355,7 +355,7 @@ export class UpdateContribution implements IGlobalActivity { const isUpdateAvailable = isLinux ? state === UpdateState.UpdateAvailable - : state === UpdateState.UpdateDownloaded; + : state === UpdateState.UpdateDownloaded || state === UpdateState.UpdateReady; if (isUpdateAvailable) { const badge = new NumberBadge(1, () => nls.localize('updateIsReady', "New {0} update available.", product.nameShort));