The WIX installation directory is not customizable?

advertisements

I'm using WIX 3.5 for my setup project. If I change the installation directory during installation, the installer insists on using the default directory.

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="LocalAppDataFolder" Name="AppData">
    <Directory Id="InstallationDir" Name="MyApp" />
  </Directory>
</Directory>
...
<DirectoryRef Id="InstallationDir">
   ... component + files ...
</DirectoryRef>
...
<UI>
   <Property Id="WIXUI_INSTALLDIR" Value="InstallationDir" />
   <UIRef Id="WixUI_InstallDir" />
   <UIRef Id="WixUI_ErrorProgressText" />
</UI>

<CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="InstallationDir" />
<InstallExecuteSequence>
   <Custom Action="SetARPINSTALLLOCATION" After="InstallValidate" />
</InstallExecuteSequence>

I tried both upgrading (I'm always changing the product code) and uninstall/install. Same problem! If I run msiexec /L*v log.txt /i Setup.msi the log tells me that the InstallationDir property was indeed changed.

Q: How is it possible that my software is installed into the default directory?


You must use an all-uppercase name for a directory to be customizable. Uppercase is how MSI declares a directory (and property) to be PUBLIC and therefore customizable.