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
2 changes: 1 addition & 1 deletion assets/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
</Component>
<!-- 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">
<Environment Id="PATH" Action="set" Name="PATH" Part="last" Permanent="no" System="yes" Value="[$(var.ProductVersionWithName)]"/>
<Environment Id="PATH" Action="set" Name="PATH" Part="last" Permanent="no" System="yes" Value="[$(var.ProductDirectoryName)]"/>
</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 -->
Expand Down
19 changes: 19 additions & 0 deletions tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,16 @@ function Invoke-AppveyorFinish
$preReleaseVersion = "$previewPrefix-$previewLabel.$env:APPVEYOR_BUILD_NUMBER"
}

# Save any PowerShell paths, so we can exclude them
# When we verify we updated the path
$beforePath = @(([System.Environment]::GetEnvironmentVariable('PATH','MACHINE')) -split ';' |
Where-Object {$_ -like '*files\powershell*'})

foreach($pathPart in $beforePath)
{
Write-Log "Found existing PowerShell path: $pathPart"
}

# Smoke Test MSI installer
Write-Log "Smoke-Testing MSI installer"
$msi = $artifacts | Where-Object { $_.EndsWith(".msi")}
Expand All @@ -499,6 +509,15 @@ function Invoke-AppveyorFinish
}
Write-Log "MSI smoke test was successful"

# Verify path was updated by MSI
$psPath = ([System.Environment]::GetEnvironmentVariable('PATH','MACHINE')) -split ';' |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't the env var only be updated for a new process?

Copy link
Member Author

@TravisEz13 TravisEz13 Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is why I'm reading it from the machine and not the process

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it. thanks

Where-Object {$_ -like '*files\powershell*' -and $_ -notin $beforePath}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we'll always install in the same directory as we discussed in RFC?

Copy link
Member Author

@TravisEz13 TravisEz13 Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this pattern still matches. Only the version part changes, which is not included in the pattern


if(!$psPath)
{
throw "MSI did not add powershell to path"
}

# only publish assembly nuget packages if it is a daily build and tests passed
if((Test-DailyBuild) -and $env:TestPassed -eq 'True')
{
Expand Down