diff --git a/.changes/cli-rs-powerhsell-no-profile.md b/.changes/cli-rs-powerhsell-no-profile.md new file mode 100644 index 000000000..3ea422d8a --- /dev/null +++ b/.changes/cli-rs-powerhsell-no-profile.md @@ -0,0 +1,7 @@ + +--- + "cli.rs": patch + "cli.js": patch + "tauri-bundler": patch +--- +Run powershell commands with `-NoProfile` flag diff --git a/tooling/bundler/src/bundle/windows/templates/main.wxs b/tooling/bundler/src/bundle/windows/templates/main.wxs index c2ce6727a..1687b385e 100644 --- a/tooling/bundler/src/bundle/windows/templates/main.wxs +++ b/tooling/bundler/src/bundle/windows/templates/main.wxs @@ -31,12 +31,12 @@ - + {{#if license}} {{/if}} - + @@ -111,7 +111,7 @@ - - + @@ -201,6 +201,6 @@ {{/if}} - + - \ No newline at end of file + diff --git a/tooling/cli.js/src/api/dependency-manager/rust.ts b/tooling/cli.js/src/api/dependency-manager/rust.ts index b820027b2..b22c29210 100644 --- a/tooling/cli.js/src/api/dependency-manager/rust.ts +++ b/tooling/cli.js/src/api/dependency-manager/rust.ts @@ -41,7 +41,7 @@ async function installRustup(): Promise { await downloadRustup() } if (platform() === 'win32') { - return spawnSync('powershell', [rustupPath], process.cwd()) + return spawnSync('powershell', ['-NoProfile', rustupPath], process.cwd()) } return spawnSync('/bin/sh', [rustupPath], process.cwd()) } diff --git a/tooling/cli.rs/src/dev.rs b/tooling/cli.rs/src/dev.rs index 33c1c6a85..c5564585e 100644 --- a/tooling/cli.rs/src/dev.rs +++ b/tooling/cli.rs/src/dev.rs @@ -32,6 +32,7 @@ fn kill_before_dev_process() { let mut child = child.lock().unwrap(); #[cfg(windows)] let _ = Command::new("powershell") + .arg("-NoProfile") .arg("-Command") .arg(format!("function Kill-Tree {{ Param([int]$ppid); Get-CimInstance Win32_Process | Where-Object {{ $_.ParentProcessId -eq $ppid }} | ForEach-Object {{ Kill-Tree $_.ProcessId }}; Stop-Process -Id $ppid }}; Kill-Tree {}", child.id())) .status();