By default WiX installs your application files into a folder under "Program Files". This is because normally you have a few lines of code like below:
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='MyDir' Name='TestProg' LongName='Test Program'>
<Component Id='MyComponent' Guid='12345678-1234-1234-1234-123456789012'>
The above WiX example deploys your files to %SystemDrive%\Program files\Test Program. However, sometimes you don't want this behavior and need to install files to an arbitrary folder. To achieve this, you can try these:
<Property Id="MYAPPPATH"><![CDATA[c:\mydir\]]></Property> <!-- New property -->
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id="MYAPPPATH" Name="."> <!-- Overrides the parent folder -->
<Directory Id='MyDir' Name='TestProg' LongName='Test Program'>
<Component Id='MyComponent' Guid='12345678-1234-1234-1234-123456789012'>
Now you can have what you want, enjoy WiXing!
THIS POST IS PROVIDED "AS-IS" WITH NO WARRANTIES AND CONFERS NO RIGHTS. Build time: Sun 01/27/2008 . ©2007 Dalun Software. All rights reserved. Back to Article List