Search code examples
wix

How to pass a PROPERTY=VALUE from Wix boostraper to setup?


I'm trying to create a WiX boostrapper that includes a WiX setup that accepts a custom property ENABLE_TOGGLE, but when calling the bootstrapper from the command prompt as

boostrapper.exe /q ENABLE_TOGGLE=1

it has no effect, while calling the setup

setup.msi /q ENABLE_TOGGLE=1

works as expected.

If I specifiy <MsiProperty Name="ENABLE_TOGGLE" Value="1" /> inside <MsiPackage >...</MsiPackage> it works, but I would like this value to be specified at install time. I've tried to reference it as [ENABLE_TOGGLE] but that doesn't seem to work.

I'm using WIX 3.11.2


Solution

  • If you're using WixStdBA, you can mark a Variable with Overridable="yes" to let the user set the variable at the command line.

    https://wixtoolset.org/docs/v3/xsd/wix/variable/

    Then MsiProperty will work as you expect with Value=[Variable].