26

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.

Error

"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

Code

<?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?

Community
  • 1
  • 1
DotNetRussell
  • 9,716
  • 10
  • 56
  • 111
  • possible duplicate of [WiX installer fails with error code 2819](http://stackoverflow.com/questions/7349837/wix-installer-fails-with-error-code-2819) – Peter Duniho Jul 01 '15 at 21:43

2 Answers2

84

You need to set the WIXUI_INSTALLDIR property.

<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />

More info here

Rick Bowerman
  • 1,866
  • 12
  • 12
1

I was receiving the error 2819 having

   <Control Id="SelectWebSiteList" Type="ListBox" X="20" Y="75" Width="200" Height="150" Sorted="yes" Property="WEBSITE" />

without

    Property="WEBSITE"
michalh
  • 2,907
  • 22
  • 29