Dynamically set install dir in WiX V4 from environment variable #7278
-
Hi, <Directory Id="FolderFromEnvVar">
<Directory Id="InstallMeHere" Name="Subfolder" />
</Directory>
<SetDirectory Id="FolderFromEnvVar" Value="[%SOME_ENV_VAR]" Sequence="first" /> I consume this in my XXXComponents.wxs like so <Wix>
<Fragment>
<Component Id="XXXComponents" Guid="someGUID" Directory="InstallMeHere">
<File Source=... I open an elevated command shell, set the enviroment variable and run msiexec with my installer set SOME_ENV_VAR="C:\Program Files\Here\Please"
msiexec /i Setup\bin\x64\Debug\Setup.msi /lv %temp%\Installer.txt /quiet And for some reason the files are installed to F:
Why is it set to F:\ instead of the value in SOME_ENV_VAR? Any help would be highly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
My first guess would be that your If not, dig through the log file a bit more to see what the Windows Installer thinks that variable is. If the env var doesn't show up in the log, try using a |
Beta Was this translation helpful? Give feedback.
My first guess would be that your
set
command is only affecting the local command-prompt and not getting to the server side of the Windows Installer. Try setting the variable in the System on Windows and see if that makes a difference.If not, dig through the log file a bit more to see what the Windows Installer thinks that variable is. If the env var doesn't show up in the log, try using a
SetProperty
to get a property change log message with the value.