[wix-users] How to specify the custom installation directory for a bundle?
Roy Zhang
Roy.Zhang at improving.com
Wed Mar 29 13:56:36 PDT 2023
Hi,
I am working on an installer which has 2 packages to install. My product and the dependency VC_redist.x64.exe. So I have two Wix files, myproduct.wxs.in and myproduct-bundle.wxs.in.x64. In myproduct.wxs.in the installation directory has been specified as below. In the bundle file I have specified a variable InstallFolder. But I found when I tested the installer, I could specify a custom directory. But the custom directory could not be created or used. The Directory in myproduct.wxs.in seems could not be used to custom a installation directory. Searched Wix document and did not find any helpful info. Is there a good way to do this? I am using Wix3. Thanks in advance!
--myproduct.wxs.in
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFiles' Name='@WIX_PROGRAM_FILES_FOLDER_ID@'>
<Directory Id='Product' Name='MyProduct'>
<Directory Id='INSTALLDIR' Name='MyApp'>
......
</Directory>
</Directory>
</Directory>
</Directory>
--myproduct-bundle.wxs.in.x64
<Bundle Name='@WIX_PRODUCT_NAME@' Version='@CMAKE_PROJECT_VERSION@'
Manufacturer='@WIX_MANUFACTURER@' UpgradeCode='@WIX_BUNDLE_UPGRADE_CODE@'>
......
<Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]MyProduct\MyApp" />
......
</Bundle>
Best,
Roy
More information about the wix-users
mailing list