3

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.

enter image description here enter image description here 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.

Akanksha Gaur
  • 2,636
  • 3
  • 26
  • 50

2 Answers2

4

I fixed error 2727 using APPLICATIONFOLDER.

before:

    <Directory Id="TARGETDIR" Name="SourceDir">
     <Directory Id="ProgramFilesFolder">
      <Directory Id="CompanyFolder" Name="Company">
       <Directory Id="InstallFolder" Name="MyProgram"/>
      </Directory>
     </Directory>
    </Directory>

after:

    <Directory Id="TARGETDIR" Name="SourceDir">
     <Directory Id="ProgramFilesFolder">
      <Directory Id="CompanyFolder" Name="Company">
       <Directory Id="APPLICATIONFOLDER" Name="MyProgram"/>
      </Directory>
     </Directory>
    </Directory>

Addition: it's strange, but probable when using WIXUI:

<UI Id="MyWixUI_Mondo">
  <UIRef Id="WixUI_Advanced" />
</UI>    

is optimal to do so:

<Property Id="ApplicationFolderName" Value="Company\MyProgram" />
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="APPLICATIONFOLDER" Name="Anything"/>
  </Directory>
</Directory>

Actual WIXUI setup folder will be "Program Files\Company\MyProgram", not "Program Files\Anything"

Shique
  • 724
  • 3
  • 18
Bunker
  • 49
  • 5
1

To see the actual error, one must run the installation using msiexec /i SoftwareSetup.msi /L*V C:\logs\<logfilename>.log

In my case when i had 2727 and had no clue , i ran my msi using above command and in the log it clearly said

**Error 2727 is "The directory entry '[XYZ]' does not exist in the Directory table **

So there was a publish event for set target path for directory XYZ but it was not present in the directory structure/entries in product.wxs. So I had to remove the unnecessary set target path publish event and everything fine was.

However to get what is the exact failure run your application using misexec like i mentioned in first statement.

Jeril Kuruvila
  • 17,190
  • 1
  • 20
  • 23