fix(msi): launch installer [skip ci]
This commit is contained in:
parent
0b4c409685
commit
97eb57c196
2 changed files with 22 additions and 3 deletions
2
patch.sh
2
patch.sh
|
@ -7,7 +7,7 @@ cd vscode || { echo "'vscode' dir not found"; exit 1; }
|
||||||
git add .
|
git add .
|
||||||
git reset -q --hard HEAD
|
git reset -q --hard HEAD
|
||||||
|
|
||||||
if [[ -f "${file}" ]]; then
|
if [[ -f "${FILE}" ]]; then
|
||||||
git apply --reject "${FILE}"
|
git apply --reject "${FILE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ index 7cd4a84..7cbdf21 100644
|
||||||
+ WindowsInstaller,
|
+ WindowsInstaller,
|
||||||
}
|
}
|
||||||
diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts
|
diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts
|
||||||
index caecd71..eb85ed0 100644
|
index caecd71..4c02afa 100644
|
||||||
--- a/src/vs/platform/update/electron-main/updateService.win32.ts
|
--- a/src/vs/platform/update/electron-main/updateService.win32.ts
|
||||||
+++ b/src/vs/platform/update/electron-main/updateService.win32.ts
|
+++ b/src/vs/platform/update/electron-main/updateService.win32.ts
|
||||||
@@ -41,5 +41,9 @@ function getUpdateType(): UpdateType {
|
@@ -41,5 +41,9 @@ function getUpdateType(): UpdateType {
|
||||||
|
@ -19,7 +19,7 @@ index caecd71..eb85ed0 100644
|
||||||
- : UpdateType.Archive;
|
- : UpdateType.Archive;
|
||||||
+ if (fs.existsSync(path.join(path.dirname(process.execPath), 'unins000.exe'))) {
|
+ if (fs.existsSync(path.join(path.dirname(process.execPath), 'unins000.exe'))) {
|
||||||
+ _updateType = UpdateType.Setup;
|
+ _updateType = UpdateType.Setup;
|
||||||
+ } else if (path.basename(path.normalize(path.join(process.execPath, '..', ''))) === 'Program Files') {
|
+ } else if (path.basename(path.normalize(path.join(process.execPath, '..', '..'))) === 'Program Files') {
|
||||||
+ _updateType = UpdateType.WindowsInstaller;
|
+ _updateType = UpdateType.WindowsInstaller;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ _updateType = UpdateType.Archive;
|
+ _updateType = UpdateType.Archive;
|
||||||
|
@ -43,3 +43,22 @@ index caecd71..eb85ed0 100644
|
||||||
+ platform += '-user';
|
+ platform += '-user';
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
@@ -243,6 +254,14 @@ export class Win32UpdateService extends AbstractUpdateService {
|
||||||
|
} else {
|
||||||
|
- spawn(this.availableUpdate.packagePath, ['/silent', '/mergetasks=runcode,!desktopicon,!quicklaunchicon'], {
|
||||||
|
- detached: true,
|
||||||
|
- stdio: ['ignore', 'ignore', 'ignore']
|
||||||
|
- });
|
||||||
|
+ const type = getUpdateType();
|
||||||
|
+ if (type == UpdateType.WindowsInstaller) {
|
||||||
|
+ spawn('msiexec.exe', ['/i', this.availableUpdate.packagePath], {
|
||||||
|
+ detached: true,
|
||||||
|
+ stdio: ['ignore', 'ignore', 'ignore']
|
||||||
|
+ });
|
||||||
|
+ } else {
|
||||||
|
+ spawn(this.availableUpdate.packagePath, ['/silent', '/mergetasks=runcode,!desktopicon,!quicklaunchicon'], {
|
||||||
|
+ detached: true,
|
||||||
|
+ stdio: ['ignore', 'ignore', 'ignore']
|
||||||
|
+ });
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue