From af81144fede58da3f8251f902517fa9addf04e7c Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 22 Jun 2018 14:45:17 +0200 Subject: [PATCH] streamline win32 user updates --- .../update/electron-main/updateService.win32.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts index 9eea411e1a9..6ac195ed9de 100644 --- a/src/vs/platform/update/electron-main/updateService.win32.ts +++ b/src/vs/platform/update/electron-main/updateService.win32.ts @@ -133,7 +133,11 @@ export class Win32UpdateService extends AbstractUpdateService { this.availableUpdate = { packagePath }; if (fastUpdatesEnabled && update.supportsFastUpdate) { - this.setState(State.Downloaded(update)); + if (product.target === 'user') { + this.doApplyUpdate(); + } else { + this.setState(State.Downloaded(update)); + } } else { this.setState(State.Ready(update)); } @@ -169,7 +173,11 @@ export class Win32UpdateService extends AbstractUpdateService { } protected doApplyUpdate(): TPromise { - if (this.state.type !== StateType.Downloaded || !this.availableUpdate) { + if (this.state.type !== StateType.Downloaded && this.state.type !== StateType.Downloading) { + return TPromise.as(null); + } + + if (!this.availableUpdate) { return TPromise.as(null); } -- GitLab