6

I am creating a WiX installer, and I want to allow the user to select the path of the installation directory as well as a data directory. I added two InstallDirDlg's to my code and named one Custom_Dir and the other Custom_DirData.

In Custom_DirData, instead of using the WIXUI_INSTALLDIR property, I use a DATALOCATION property, which is set at the beginning of the installation in an appsearch.

When I run the msi, the Custom_Dir works fine. However, when I get to the Custom_DirData dialog, as soon as I press browse or next, a 2343 error message pops up.

This is what it says in the log:

DEBUG: Error 2343:  Specified path is empty.

I can see these properties being set earlier on in the log file:

PROPERTY CHANGE: Adding DATALOCATION property. Its value is 'C:\Remindex Local Data\'.

PROPERTY CHANGE: Adding _BrowseProperty property. Its value is 'C:\Remindex Local Data\'.

So I'm not quite sure what path it's talking about. Just in case you need some extra information, here are three relevant dialogs in the UI code:

<Publish Dialog="Custom_Dir" Control="Back" Event="NewDialog" Value="Custom_Setup">1</Publish>
<Publish Dialog="Custom_Dir" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="Custom_Dir" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="Custom_Dir" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="Custom_Dir" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4"><![CDATA[(WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1") AND WixUI_InstallMode = "InstallRemote"]]></Publish>
<Publish Dialog="Custom_Dir" Control="Next" Event="NewDialog" Value="Custom_DirData" Order="5"><![CDATA[(WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1") AND WixUI_InstallMode = "InstallServer"]]></Publish>
<Publish Dialog="Custom_Dir" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="Custom_Dir" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

<Publish Dialog="Custom_DirData" Control="Back" Event="NewDialog" Value="Custom_Dir">1</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="SetTargetPath" Value="[DATALOCATION]" Order="1">1</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="Custom_DirData" Control="ChangeFolder" Property="_BrowseProperty" Value="[DATALOCATION]" Order="1">1</Publish>
<Publish Dialog="Custom_DirData" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>

Any suggestions would be greatly appreciated.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
user2437443
  • 2,067
  • 4
  • 23
  • 38

1 Answers1

6

My problem was the brackets around my [DATALOCATION] property. This is what it should look like:

<Publish Dialog="Custom_DirData" Control="Back" Event="NewDialog" Value="Custom_Dir">1</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="SetTargetPath" Value="DATALOCATION" Order="1">1</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="Custom_DirData" Control="ChangeFolder" Property="_BrowseProperty" Value="DATALOCATION" Order="1">1</Publish>
<Publish Dialog="Custom_DirData" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
Tomas Kubes
  • 23,880
  • 18
  • 111
  • 148
user2437443
  • 2,067
  • 4
  • 23
  • 38