mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix(cli.rs): run powershell kill command without profile (#2130)
This commit is contained in:
7
.changes/cli-rs-powerhsell-no-profile.md
Normal file
7
.changes/cli-rs-powerhsell-no-profile.md
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
---
|
||||
"cli.rs": patch
|
||||
"cli.js": patch
|
||||
"tauri-bundler": patch
|
||||
---
|
||||
Run powershell commands with `-NoProfile` flag
|
||||
@@ -31,12 +31,12 @@
|
||||
|
||||
|
||||
<Media Id="1" Cabinet="app.cab" EmbedCab="yes" />
|
||||
|
||||
|
||||
<WixVariable Id="WixUIBannerBmp" Value="{{{icon_path}}}" />
|
||||
{{#if license}}
|
||||
<WixVariable Id="WixUILicenseRtf" Value="{{{license}}}" />
|
||||
{{/if}}
|
||||
|
||||
|
||||
<Icon Id="ProductIcon" SourceFile="{{{icon_path}}}"/>
|
||||
<Property Id="ARPPRODUCTICON" Value="ProductIcon" />
|
||||
<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> <!-- Remove repair -->
|
||||
@@ -111,7 +111,7 @@
|
||||
|
||||
<DirectoryRef Id="ApplicationProgramsFolder">
|
||||
<Component Id="ApplicationShortcut" Guid="81ccebd8-b769-4bed-bdbd-0340f9f7cad1">
|
||||
<Shortcut Id="ApplicationStartMenuShortcut"
|
||||
<Shortcut Id="ApplicationStartMenuShortcut"
|
||||
Name="{{{product_name}}}"
|
||||
Description="Runs {{{product_name}}}"
|
||||
Target="[!Path]"
|
||||
@@ -193,7 +193,7 @@
|
||||
<Property Id="WVRTINSTALLED">
|
||||
<RegistrySearch Id="WVRTInstalled" Root="HKLM" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw" Win64="no"/>
|
||||
</Property>
|
||||
<CustomAction Id='DownloadAndInvokeBootstrapper' Directory="INSTALLDIR" Execute="deferred" ExeCommand='powershell.exe -windowstyle hidden Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" ; & $env:TEMP\MicrosoftEdgeWebview2Setup.exe /install' Return='check'/>
|
||||
<CustomAction Id='DownloadAndInvokeBootstrapper' Directory="INSTALLDIR" Execute="deferred" ExeCommand='powershell.exe -NoProfile -windowstyle hidden Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" ; & $env:TEMP\MicrosoftEdgeWebview2Setup.exe /install' Return='check'/>
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action='DownloadAndInvokeBootstrapper' Before='InstallFinalize'>
|
||||
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
||||
@@ -201,6 +201,6 @@
|
||||
</InstallExecuteSequence>
|
||||
{{/if}}
|
||||
|
||||
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
|
||||
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
|
||||
</Product>
|
||||
</Wix>
|
||||
</Wix>
|
||||
|
||||
@@ -41,7 +41,7 @@ async function installRustup(): Promise<void> {
|
||||
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())
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user