Closed kevgo closed 6 months ago
Hello @kevgo . Thanks for your report. We will take a look.
The WiX Toolset installer adds a WIX
environment variable that points to the WiX install directory. On my current test runner it contains this value:
WIX=C:\Program Files (x86)\WiX Toolset v3.14\
So you can run WiX commands from a Command Prompt by prefixing it:
"%WIX%"\bin\candle.exe
Of course the Install-Wix.ps1
script could also be augmented. Maybe like this:
################################################################################
## File: Install-Wix.ps1
## Desc: Install WIX.
################################################################################
Install-ChocoPackage wixtoolset -ArgumentList "--force"
# Add WiX to the PATH
$currentPath = [Environment]::GetEnvironmentVariable("PATH", "Machine")
# Choose one of these next two lines, depending on the WiX priority
$NewPath = "$($Env:WIX)\bin;$currentPath"
#$NewPath = "$currentPath;$($Env:WIX)\bin"
[Environment]::SetEnvironmentVariable("PATH", $NewPath, "Machine")
Invoke-PesterTests -TestFile "Wix"
Thanks for looking into this! 🙏 I do not call the WiX binaries directly, but am using a third-party application to generate the Windows installer for my app. This third-party app calls the various WiX binaries for me. It is not aware of the WIX
env variable and requires (rightfully imo) that I add the wix bin directory to the PATH.
In addition to the WIX
env variable, I suggest adding the WiX binaries to the PATH so that they can be called idiomatically.
Btw please don't forget that the binaries are in the bin
subfolder:
$NewPath = "$($Env:WIX + "\bin");$currentPath"
Btw please don't forget that the binaries are in the bin subfolder:
Oops, I indeed forgot to add the bin
folder to my Powershell code. I updated my post.
Deployed.
Description
WiX provides several binaries in
C:\Program Files (x86)\WiX Toolset v3.14\bin
. This directory is not in the PATH environment variable.Platforms affected
Runner images affected
Image version and build link
Is it regression?
no, it was always broken afaik
Expected behavior
C:\Program Files (x86)\WiX Toolset v3.14\bin
is in the PATH. I can call executables from the WiX toolkit, likeC:\Program Files (x86)\WiX Toolset v3.14\bin\candle.exe
from any directory.Actual behavior
C:\Program Files (x86)\WiX Toolset v3.14\bin
is not in the PATH. I can not call executables from the WiX toolkit, likeC:\Program Files (x86)\WiX Toolset v3.14\bin\candle.exe
from any directory.Repro steps
To reproduce, I try to call the
candle.exe
executable provided by WiX:Checking the PATH environment variable reveals that WiX is indeed not in it:
Running
$env:PATH = "$env:PATH;C:\Program Files (x86)\WiX Toolset v3.14\bin"
fixes the issue: