I am attempting to build an installer with wix.
It compiles and runs. Unfortunately when I run it, I accept the license agreement and hit next, then it explodes.
"The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2819."
Here is the code I am using
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="rd Installer" Language="1033" Version="1.0.0.0" Manufacturer="hs" UpgradeCode="upgradeCode">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="rd">
<Directory Id="BINFOLDER" Name="Bin"/>
<Directory Id="IMAGEFOLDER" Name="Image"/>
</Directory>
</Directory>
</Directory>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="CMP_rd1" Guid="guid">
<File Id="rd1"
Name="r.d"
Source="D:\dir\file.txt"
KeyPath="yes">
</File>
</Component>
<Component Id="CMP_rd2" Guid="guid">
<File Id="rd2"
Name="r.d"
Source="D:\dir\file.txt"
KeyPath="yes">
</File>
</Component>
</DirectoryRef>
<Feature Id="DefaultFeature" Level="1">
<ComponentRef Id="CMP_rd1"/>
<ComponentRef Id="CMP_rd2"/>
</Feature>
<UI Id="UI_ReportDasboard">
<UIRef Id="WixUI_InstallDir"/>
</UI>
</Product>
</Wix>
I've looked at a number of examples and I cant seem to understand what's wrong. My code looks very close to the examples I've seen. Am I missing something?
You need to set the WIXUI_INSTALLDIR property.
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
More info here