I have a created a wix installer for my application. Everything is working correctly except when I choose Install for all users on the machine on the next dialog i choose the installation directory and i Get error.
Click Next shows the error above
Windows installer gives the following details 2727 The directory entry '2' does not exist in the Directory table.
Product.wxs contains
<UI>
<UIRef Id="WixUI_ErrorProgressText" />
<UIRef Id="UISequence" />
</UI>
Wix file
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<!--Adding dialogs-->
<UI Id="UISequence">
<Property Id="ApplicationFolderName" Value="AppName" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<UIRef Id="WixUI_Advanced"/>
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<!--Including License agreement-->
<WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
<!--<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />-->
<!--Exit Dialog-->
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Thank you for installing this product." />
<!--Provide Launch Application Option-->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch AppName" />
<Property Id="WixShellExecTarget" Value="[#AppExeName.exe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
</Fragment>
</Wix>
If I do not go to advanced, everything works fine. Application is installed for all users.
I looked up everywhere, haven't found y this is happening.
Please help, what have I missed here.