mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 09:43:57 +08:00
Guard Remove-Item in Create-MSIPackage
This commit is contained in:
parent
691618d335
commit
c5a81c2e6e
@ -1002,14 +1002,14 @@ function Create-MSIPackage
|
||||
$wixObjFragmentPath = (Join-path $env:Temp "Fragment.wixobj")
|
||||
|
||||
$msiLocationPath = Join-Path $pwd "$productVersionWithName.msi"
|
||||
del $msiLocationPath -Force
|
||||
Remove-Item -ErrorAction SilentlyContinue $msiLocationPath -Force
|
||||
|
||||
& $wixHeatExePath dir $ProductSourcePath -dr $productVersionWithName -cg $productVersionWithName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v
|
||||
& $wixCandleExePath "$ProductWxsPath" "$wixFragmentPath" -out (Join-Path "$env:Temp" "\\") -arch x64 -v
|
||||
& $wixLightExePath -out "$productVersionWithName.msi" $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -v
|
||||
|
||||
Remove-Item -ErrorAction SilentlyContinue *.wixpdb -Force
|
||||
|
||||
del *.wixpdb -Force
|
||||
Write-Verbose "You can find the MSI @ $msiLocationPath"
|
||||
return $msiLocationPath
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user