I need to deploy files in both C and D drives. For example File A goes to drive C and File B goes to drive D. I know that Wix allows you to have only one root directory. Is there any way I can accomplish this?
I know that one solution is to set C as the root directory in the Wix Xml and deploy files that go to C directory through the Wix Xml. The files that have to deployed to D directory then have to be deployed through a custom action.
However I want to avoid using Custom Actions and want to deploy files to both (C and D drives) using the same Wix Xml.
The entire directory structure should always be wrapped into "TARGETDIR" root. But nobody limits you to define the rest of the structure under it the way you need. See the sample below:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLLOCATION" Name="My location">
...
</Directory>
<Directory Id="DATA_FOLDER" Name="Data">
...
</Directory>
<Directory Id="DATABASES_FOLDER">
...
<Directory>
</Directory>
Now you can set DATA_FOLDER or DATABASES_FOLDER to be on a different drive than INSTALLLOCATION. It works fine for me.
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