Reputation: 752
I have created an installer using wix. By default the application gets installed under Program Files folder.I need to create a folder for my application under c:
directory and install my application inside there.
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WINDOWSVOLUME" >
<Directory Id="INSTALLLOCATION" Name="WIXDemoApp">
</Directory>
</Directory>
</Directory>
<SetDirectory Id="WINDOWSVOLUME" Value="c"/>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="MyApplication.exe">
<File Source="$(var.MyApplication.TargetPath)" Name="MyApp.exe" Id="MYAPPEXE" KeyPath="yes" />
<!-- TODO: Insert files, registry keys, and other resources here. -->
</Component>
</ComponentGroup>
</Fragment>
I am getting the following error "error LGHT0094: Unresolved reference to symbol 'Directory:INSTALLFOLDER' in section 'Fragment:'
".
Update:
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WindowsVolume" >
<Directory Id="INSTALLLOCATION" Name="WIXDemoApp">
</Directory>
</Directory>
</Directory>
<SetDirectory Id="WindowsVolume" Value="c"/>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLLOCATION">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="MyApplication.exe">
<File Source="$(var.MyApplication.TargetPath)" Name="MyApp.exe" Id="MYAPPEXE" KeyPath="yes" />
<!-- TODO: Insert files, registry keys, and other resources here. -->
</Component>
</ComponentGroup>
</Fragment>
This is giving me another error "error LGHT0204: ICE99: The directory name: WindowsVolume is the same as one of the MSI Public Properties and can cause unforeseen side effects.
".Googled and refereed this and this to fix this.But not working for me,still i am getting the same error as "error LGHT0204: ICE99: The directory name: WindowsVolume is the same as one of the MSI Public Properties and can cause unforeseen side effects.".Any idea what would be the problem.
Upvotes: 5
Views: 4878
Reputation: 21896
Windows Installer is case-sensitive so WINDOWSVOLUME
won't work. You can do something like this:
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="SetupProject1" />
</Directory>
</Directory>
<SetDirectory Id="INSTALLLOCATION" Value="[WindowsVolume]SetupProject1" />
</Fragment>
For your second error, you're mixing two different ids: INSTALLFOLDER
and INSTALLLOCATION
. Pick one and use it in both places.
Upvotes: 5
Reputation: 11725
I found this tip on kentie.net - Wix Tips & Tricks. Tips said to use the WINDOWSVOLUME id.
TARGETDIR and the system partition
When trying to install to a subdirectory of the system drive root (e.g. 'C:\application'), it might sense to assume that in something like
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLLOCATION" Name="SetupProject1">
</Directory>
</Directory>
TARGETDIR refers to the system partition, as ProgramFilesFolder is always given as a child of TARGETDIR. This is not the case; TARGETDIR is the partition with the most free disk space. It can even be a partition on an external hard drive. To set it to the true system partition, use the below approach:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WINDOWSVOLUME" >
<Directory Id="INSTALLLOCATION" Name="SetupProject1">
</Directory>
</Directory>
</Directory>
<SetDirectory Id="WINDOWSVOLUME" Value="[WindowsVolume]"/>
The SetDirectory element is required as trying to use WindowsVolume directly results in
error LGHT0204: ICE99: The directory name: WindowsVolume is the same as one of the MSI Public Properties and can cause unforeseen side effects. Signing MSIs
Upvotes: 5