Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion assets/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<?define InfoURL="https://github.com/PowerShell/PowerShell" ?>
<?define ProductName = "$(env.ProductName)" ?>
<?define ProductSimpleVersionWithNameAndOptionalArchitecture = "$(var.ProductName) $(env.SimpleProductVersion) ($(sys.BUILDARCH))"?>
<?if $(var.IsPreview)=True?>
<?define PwshPath = "[VersionFolder]preview"?>
<?else?>
<?define PwshPath = "[VersionFolder]"?>
<?endif?>
<!-- UpgradeCode GUID MUST REMAIN SAME THROUGHOUT ALL VERSIONS, otherwise, updates won't occur. -->
<?if $(sys.BUILDARCH)=x64?>
<?define ExplorerContextMenuDialogText = "&$(var.ProductName) $(env.SimpleProductVersion)"?>
Expand Down Expand Up @@ -191,7 +196,7 @@
<!-- add ourselves to %PATH% so pwsh.exe can be started from Windows PowerShell or cmd.exe -->
<Component Id="SetPath">
<Condition>ADD_PATH=1</Condition>
<Environment Id="PATH" Action="set" Name="PATH" Part="last" Permanent="no" System="yes" Value="[VersionFolder]"/>
<Environment Id="PATH" Action="set" Name="PATH" Part="last" Permanent="no" System="yes" Value="$(var.PwshPath)"/>
<!-- Can't use a shared component GUID here either since the path we add to PATH varies on the actual directory path. Use a key that represents this same path. -->
<RegistryKey Root="HKLM" Key="Software\Microsoft\PowerShellCore\InstalledVersions\$(var.UpgradeCode)">
<RegistryValue Type="string" Name="InstallDir" Value="[VersionFolder]" KeyPath="yes"/>
Expand Down
2 changes: 1 addition & 1 deletion test/packaging/windows/msi.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Describe -Name "Windows MSI" -Fixture {

It "MSI should have updated path" -Skip:(!(Test-Elevated)) {
$psPath = ([System.Environment]::GetEnvironmentVariable('PATH', 'MACHINE')) -split ';' |
Where-Object {$_ -like '*files\powershell*' -and $_ -notin $beforePath}
Where-Object {$_ -like '*files\powershell*\preview*' -and $_ -notin $beforePath}

$psPath | Should -Not -BeNullOrEmpty
}
Expand Down