mirror of
https://github.com/actions/runner-images.git
synced 2026-01-10 20:52:45 +08:00
[Windows] Add WIX binaries folder to the PATH (#9582)
* [Windows] Add WIX binaries folder to the PATH * Add Update-Environment, small prettifying * Move tests from script to Pester * Fix Wix tests to use Join-Path --------- Co-authored-by: Leon Zandman <lzandman@github.com>
This commit is contained in:
@@ -5,4 +5,10 @@
|
|||||||
|
|
||||||
Install-ChocoPackage wixtoolset -ArgumentList "--force"
|
Install-ChocoPackage wixtoolset -ArgumentList "--force"
|
||||||
|
|
||||||
|
Update-Environment
|
||||||
|
$currentPath = [System.Environment]::GetEnvironmentVariable("PATH", "Machine")
|
||||||
|
$newPath = $currentPath + ";$(Join-Path -Path $env:WIX -ChildPath "bin")"
|
||||||
|
[Environment]::SetEnvironmentVariable("PATH", $newPath, "Machine")
|
||||||
|
Update-Environment
|
||||||
|
|
||||||
Invoke-PesterTests -TestFile "Wix"
|
Invoke-PesterTests -TestFile "Wix"
|
||||||
|
|||||||
@@ -8,4 +8,17 @@ Describe "Wix" {
|
|||||||
It "Wix Toolset version from registry" {
|
It "Wix Toolset version from registry" {
|
||||||
$version | Should -Not -BeNullOrEmpty
|
$version | Should -Not -BeNullOrEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
It "Wix variable exists" {
|
||||||
|
$env:WIX | Should -Not -BeNullOrEmpty
|
||||||
|
}
|
||||||
|
|
||||||
|
It "Wix binaries folder exists" {
|
||||||
|
Test-Path -Path $(Join-Path -Path $env:WIX -ChildPath "bin") | Should -Be $true
|
||||||
|
}
|
||||||
|
|
||||||
|
It "Wix binaries folder is in PATH" {
|
||||||
|
$testPath = Join-Path -Path $env:WIX -ChildPath "bin"
|
||||||
|
$env:PATH -split ";" | Should -Contain "$testPath"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user