Set path for Wix Toolset in windows runner

I am trying to automate building a Windows MSI Installer for an electron application using Wix.

I can see from looking here that the Wix Toolsets are included in the windows-latest runner.

However, it seems like electron-wix-msi requires having candle.exe and light.exe available in the path. Without the candle.exe and light.exe available in the path, my build step will fail with the following message:

My research also lead to this post, but the answer there uses add-path which has since been deprecated.

I have 2 questions:

  1. What is path to the wix toolset binaries? How can I access this in the run step? ($wix, ${env.wix}?)

  2. How can I add-path to the wix toolset so that it will be available at a later run step?

Appreciate any help I can get!

Hi @hibearpanda, welcome to the GitHub Support Community!

The ::add-path command has been replaced with an environment file, so you’d add something to your path using this syntax: echo "/your/path/here" >> $GITHUB_PATH

That said, I believe the wix toolset should already be installed by default and available in the path at env.wix, so this is rather strange. Would you be able to share a link to your workflow, or copy paste it in a public gist or something so I can take a look at exactly what it does?

Hi @thomasshaped,

Thanks for replying. I was able to figure out how to add path but for some reason could not add the wix binaries to the path without hardcoding the path, instead of using env.wix. I have included a gist of list of my latest workflow here, but in summary:


      - name: Set path for candle and light
        run: echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" >> $GITHUB_PATH
        shell: bash

Did not work:

      - name: Set path for candle and light
          WIX_PATH: ${{ env.wix }}
        run: echo "$env:WIX_PATH" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
      - name: Set path for candle and light
          WIX_PATH: ${{ env.wix }}
        run: echo "$env:WIX_PATH\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

Oh nice, good to see you got it working! I also did some testing yesterday with some of my team members and ended up getting it to work via this method (though I don’t think this is a nice way to do it, it feels rather hacky):

      - run: |
          $env:Path += ";C:\Program Files (x86)\WiX Toolset v3.11\bin"

It’s still very strange that they’re not available by default nor via using the preset env. Perhaps this is something to do with the specific env reference syntax differences between different shells used as I see you’ve managed to get it to work specifically when using bash.

I think I’m going to ask up the chain to see if they have any advice on this, but for now I’m at least glad you’ve managed to find solution!

Yea, it is a bit strange that it was not available in the path. Certainly stranger that it’s not (seemingly) available with env.wix. I would have preferred to construct that path with env.wix so it isn’t hard coded but alas I have to move on.

Appreciate your help and for asking around!