Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX -- Installing files to system drive

Tags:

wix

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?

like image 474
Daniel Harms Avatar asked Aug 08 '11 17:08

Daniel Harms


1 Answers

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>
like image 164
Sunil Agarwal Avatar answered Nov 15 '22 11:11

Sunil Agarwal