-
Notifications
You must be signed in to change notification settings - Fork 8.1k
MSI: update path with proper value #6441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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")} | ||
|
|
@@ -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 ';' | | ||
| Where-Object {$_ -like '*files\powershell*' -and $_ -notin $beforePath} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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') | ||
| { | ||
|
|
||
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. thanks