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.
Setup tab > Run after execution input: your msi file name. Advanced tab > Mark Request Administrative access option checkbox.
The WiX tools follow the traditional compile and link model used to create executables from source code. At build time, the WiX source files are validated against the core WiX schema, then processed by a preprocessor, compiler, and linker to create the final result.
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.
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
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