Search code examples
xmlwixappdata

WiX and InstallCommand


I'm using WIX Link, and I'm instaling *exe file, lets say program.exe by:

      <ExePackage Id="Dependency1" Name="Program" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes"
              InstallCommand="/S CONF_FILE=&quot;%appdata%/program/programConfig.xml&quot;; ..."
              SourceFile="program.exe"/>

And it's dont load that files, the path is ok, and when I'm starting program.exe by cmd:

program.exe  CONF_FILE="%appdata%/program/programConfig.xml"

it works fine, is there any problem refering to appdata in WIX?


Solution

  • Burn doesn't expand environment variables. You need to use the built-in Burn variable AppDataFolder

    InstallCommand='/S CONF_FILE="[AppDataFolder]program\programConfig.xml" ...'