Make sure MSI build works when not preview (#7752)
The variable was set to empty (meaning to delete the variable) in the non-preview case and the build fails. The fix avoids setting the variable to empty
This commit is contained in:
parent
5a587b551e
commit
15a3beb12d
@ -165,7 +165,7 @@
|
||||
<!-- add ourselves to %PATH% so pwsh.exe can be started from Windows PowerShell or cmd.exe -->
|
||||
<Component Id="SetPath" Guid="{9dbb7763-7baf-48e7-b025-3bdedcb0632f}" KeyPath="yes">
|
||||
<Condition>ADD_PATH=1</Condition>
|
||||
<Environment Id="PATH" Action="set" Name="PATH" Part="last" Permanent="no" System="yes" Value="[$(var.ProductDirectoryName)]$(var.PwshPath)"/>
|
||||
<Environment Id="PATH" Action="set" Name="PATH" Part="last" Permanent="no" System="yes" Value="$(var.PwshPath)"/>
|
||||
</Component>
|
||||
<!-- Explorer context menu with 2 submenus to open PowerShell normally or as an Administator.
|
||||
See https://blogs.msdn.microsoft.com/andrew_richards/2017/03/01/enhancing-the-open-command-prompt-here-shift-right-click-context-menu-experience/ for details -->
|
||||
|
@ -2521,14 +2521,14 @@ function New-MSIPackage
|
||||
[Environment]::SetEnvironmentVariable("ProductVersionWithName", $productVersionWithName, "Process")
|
||||
if (!$isPreview)
|
||||
{
|
||||
[Environment]::SetEnvironmentVariable("PwshPath", '', "Process")
|
||||
[Environment]::SetEnvironmentVariable("PwshPath", "[$productDirectoryName]", "Process")
|
||||
[Environment]::SetEnvironmentVariable("UpgradeCodeX64", '31ab5147-9a97-4452-8443-d9709f0516e1', "Process")
|
||||
[Environment]::SetEnvironmentVariable("UpgradeCodeX86", '1d00683b-0f84-4db8-a64f-2f98ad42fe06', "Process")
|
||||
[Environment]::SetEnvironmentVariable("IconPath", 'assets\Powershell_black.ico', "Process")
|
||||
}
|
||||
else
|
||||
{
|
||||
[Environment]::SetEnvironmentVariable("PwshPath", 'preview', "Process")
|
||||
[Environment]::SetEnvironmentVariable("PwshPath", "[$productDirectoryName]preview", "Process")
|
||||
[Environment]::SetEnvironmentVariable("UpgradeCodeX64", '39243d76-adaf-42b1-94fb-16ecf83237c8', "Process")
|
||||
[Environment]::SetEnvironmentVariable("UpgradeCodeX86", '86abcfbd-1ccc-4a88-b8b2-0facfde29094', "Process")
|
||||
[Environment]::SetEnvironmentVariable("IconPath", 'assets\Powershell_av_colors.ico', "Process")
|
||||
|
Loading…
Reference in New Issue
Block a user