I need the User to be able to set multiple different target directories for my installation.
I have this directory structure:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="DCOMPANY" Name="MyCompany" >
<Directory Id="DMAIN" Name="MainDir">
<Directory Id="DPART1" Name="Part1"/>
<Directory Id="DPART2" Name="Part2"/>
</Directory>
</Directory>
</Directory>
</Directory>
I also have these Properties here
<Property Id="WIXUI_INSTALLPATH" Hidden="yes" />
<Property Id="VARIABLE_PATH_DPART1" Value="DPART1" />
<Property Id="VARIABLE_PATH_DPART2" Value="DPART2" />
To override the Single InstallDirDialog, I've copied the files WIXUI_InstallDir.wxs and InstallDirDlg.wxs. I duplicated InstallDirDlg.wxs and added the numbers 1 and 2 to the end of the files, prefixed all of the three with custom_ and changed their UI-Tags correspondingly:
Now, in the custom_WIXUI_InstallDir.wxs, theres this block that I changed a little so I would expect MY Properties are being set by the Actions:
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="custom_InstallDirDlg1">LicenseAccepted = "1"</Publish>
<Publish Dialog="custom_InstallDirDlg1" Control="Back" Event="NewDialog"
Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="custom_InstallDirDlg1" Control="Next"
Event="SetTargetPath" Value="[VARIABLE_PATH_DPART1]" Order="1">1</Publish>
<Publish Dialog="custom_InstallDirDlg1" Control="Next" Event="DoAction"
Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="custom_InstallDirDlg1" Control="Next" Event="SpawnDialog"
Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND
WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="custom_InstallDirDlg1" Control="Next" Event="DoAction"
Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND
WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="custom_InstallDirDlg1" Control="Next" Event="NewDialog"
Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR
WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="custom_InstallDirDlg1" Control="ChangeFolder"
Property="_BrowseProperty" Value="[VARIABLE_PATH_DPART1]"
Order="1">1</Publish>
<Publish Dialog="custom_InstallDirDlg1" Control="ChangeFolder"
Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog"
Value="custom_InstallDirDlg1" Order="1">NOT Installed</Publish>
In custom_InstallDirDlg1.wxs I also changed this line to my path variable:
<Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320"
Height="18" Property="VARIABLE_PATH_DPART1" Indirect="yes" />
When I compile now, everything gets created and when I run the Installer, when I click on the "Change..." Button or the "Next..." button the Installer freezes for approximately 30 seconds and then Says "The specified Path DPART1 is unavailable."
When I look at the sources of the custom actions that are being called in all those CDATA blocks I see that those only ever care for the WIXUI_INSTALLPATH and don't accept anything given to them. So it's pretty much using indirection for that.
I've also read somewhere that this dialog can be reused to have the User enter multiple target paths but I can't figure out how.
Please help :)