Skip to content
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

[Windows] Add WIX binaries folder to the PATH #9582

Merged
merged 4 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions images/windows/scripts/build/Install-Wix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,16 @@

Install-ChocoPackage wixtoolset -ArgumentList "--force"

# Add WIX binaries to PATH
mikhailkoliada marked this conversation as resolved.
Show resolved Hide resolved
$wixBinPath = Join-Path -Path $env:WIX -ChildPath 'bin'
mikhailkoliada marked this conversation as resolved.
Show resolved Hide resolved
mikhailkoliada marked this conversation as resolved.
Show resolved Hide resolved
mikhailkoliada marked this conversation as resolved.
Show resolved Hide resolved
if (Test-Path $wixBinPath) {
$currentPath = [System.Environment]::GetEnvironmentVariable("PATH", "Machine")
$newPath = $currentPath + ";$wixBinPath"
Write-Host "Add $wixBinPath to PATH"
mikhailkoliada marked this conversation as resolved.
Show resolved Hide resolved
[Environment]::SetEnvironmentVariable("PATH", $newPath, "Machine")
$env:Path += ";$wixBinPath"
}else{
mikhailkoliada marked this conversation as resolved.
Show resolved Hide resolved
Write-Error "WIX binaries folder ($wixBinPath) not found."
}

Invoke-PesterTests -TestFile "Wix"
4 changes: 4 additions & 0 deletions images/windows/scripts/tests/Wix.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ Describe "Wix" {
It "Wix Toolset version from registry" {
$version | Should -Not -BeNullOrEmpty
}

It "Wix binaries are available via env:Path" {
mikhailkoliada marked this conversation as resolved.
Show resolved Hide resolved
candle.exe -? | Should -Not -BeNullOrEmpty
}
}
Loading