fix badge, win32 flag file

This commit is contained in:
Joao Moreno
2018-01-19 12:32:24 +01:00
parent 079899193e
commit 7bf655d11a
2 changed files with 9 additions and 3 deletions
@@ -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;
@@ -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));