diff options
| author | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-04-16 16:20:54 +0200 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2025-05-28 13:25:31 +0200 |
| commit | e6f78b295492de2da9218478bbfbbadd400c2c89 (patch) | |
| tree | 74446b628fb0f6f4d63352086ac80e19add0d8a2 | |
| parent | 78afdd42873f97bdf7bb5d3e4b6760415aa98e70 (diff) | |
| download | mullvadvpn-e6f78b295492de2da9218478bbfbbadd400c2c89.tar.xz mullvadvpn-e6f78b295492de2da9218478bbfbbadd400c2c89.zip | |
Update how installer is spawned on windows
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/main/app-upgrade.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/desktop/packages/mullvad-vpn/src/main/app-upgrade.ts b/desktop/packages/mullvad-vpn/src/main/app-upgrade.ts index 9520e51c77..f17495cc6b 100644 --- a/desktop/packages/mullvad-vpn/src/main/app-upgrade.ts +++ b/desktop/packages/mullvad-vpn/src/main/app-upgrade.ts @@ -1,4 +1,5 @@ import { spawn } from 'child_process'; +import { tmpdir } from 'os'; import { DaemonAppUpgradeEvent } from '../shared/daemon-rpc-types'; import log from '../shared/logging'; @@ -66,11 +67,15 @@ export default class AppUpgrade { private spawnChildWindows(verifiedInstallerPath: string) { const SYSTEM_ROOT_PATH = process.env.SYSTEMROOT || process.env.windir || 'C:\\Windows'; - const POWERSHELL_PATH = `${SYSTEM_ROOT_PATH}\\System32\\WindowsPowerShell\\v1.0\\powershell`; - const quotedVerifiedInstallerPath = `'${verifiedInstallerPath}'`; + const CMD_PATH = `${SYSTEM_ROOT_PATH}\\System32\\cmd.exe`; + const quotedVerifiedInstallerPath = `"${verifiedInstallerPath}"`; - const child = spawn(POWERSHELL_PATH, ['Start', '-Wait', quotedVerifiedInstallerPath], { + const cwd = tmpdir(); + const child = spawn(CMD_PATH, ['/C', 'start', '""', quotedVerifiedInstallerPath], { + cwd, detached: true, + stdio: 'ignore', + windowsVerbatimArguments: true, }); return child; |
