I'm working on an installer that drops some files into another application that keeps its files at [SystemDrive]\appName. The installer is only used in internal automation, so it's fine if it doesn't consider other install locations.
I've found that by default WiX sets the target directory to the drive with the most free space. What's the best way to specify a certain directory in the system drive instead?
Set the value of rootdrive to the drive you want
<CustomAction Id='SetRootDrive' Property='ROOTDRIVE' Value='[%SystemDrive]\'/>
System drive will be by default the default drive used by OS
Added code to call 'SetRootDrive' action: You need to call it from InstallUISequence
<InstallUISequence>
<Show Dialog="MyWelcomeDlg" Before="CostFinalize">NOT Installed</Show>
<!-- App search is what does FindInstallLocation, and it is dependent on FindRelatedProducts -->
<AppSearch After="FindRelatedProducts"/>
<Custom Action="SetRootDrive" Before="CostInitialize"></Custom>
</InstallUISequence>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With