fix: installation with folders which contain spaces (#9275)
This commit is contained in:
parent
913821f675
commit
771dd83c16
|
|
@ -39,7 +39,7 @@ export type DependencyGroup = 'chromium' | 'firefox' | 'webkit' | 'tools';
|
|||
|
||||
export async function installDependenciesWindows(targets: Set<DependencyGroup>) {
|
||||
if (targets.has('chromium')) {
|
||||
const { code } = await utils.spawnAsync('powershell.exe', [path.join(BIN_DIRECTORY, 'install_media_pack.ps1')], { cwd: BIN_DIRECTORY, stdio: 'inherit' });
|
||||
const { code } = await utils.spawnAsync('powershell.exe', ['-File', path.join(BIN_DIRECTORY, 'install_media_pack.ps1')], { cwd: BIN_DIRECTORY, stdio: 'inherit' });
|
||||
if (code !== 0)
|
||||
throw new Error('Failed to install windows dependencies!');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -632,8 +632,14 @@ export class Registry {
|
|||
const scriptName = scripts[process.platform as 'linux' | 'darwin' | 'win32'];
|
||||
if (!scriptName)
|
||||
throw new Error(`Cannot install ${channel} on ${process.platform}`);
|
||||
const shell = scriptName.endsWith('.ps1') ? 'powershell.exe' : 'bash';
|
||||
const { code } = await spawnAsync(shell, [path.join(BIN_PATH, scriptName), ...scriptArgs], { cwd: BIN_PATH, stdio: 'inherit' });
|
||||
const isPowerShell = scriptName.endsWith('.ps1');
|
||||
const shell = isPowerShell ? 'powershell.exe' : 'bash';
|
||||
const args = [
|
||||
...(isPowerShell ? ['-File'] : []),
|
||||
path.join(BIN_PATH, scriptName),
|
||||
...scriptArgs
|
||||
];
|
||||
const { code } = await spawnAsync(shell, args, { cwd: BIN_PATH, stdio: 'inherit' });
|
||||
if (code !== 0)
|
||||
throw new Error(`Failed to install ${channel}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue