-
Apr 9th, 2024, 10:32 PM
#1
Thread Starter
New Member
Customizing the Behavior of BrowseDlg in WiX to Use a Custom Dialog for Invalid Path
I'm working on a Windows Installer project using the WiX Toolset version 4.I'm utilizing the BrowseDlg dialog to enable users to select the installation directory. My setup is defined with a custom UI sequence: <ui:WixUI Id="InstallDir_SpecialDlg" InstallDirectory="INSTALLFOLDER" />
When a user selects an invalid directory (one that doesn't exist or meets certain criteria), I want to replace the default invalid directory warning dialog (InvalidDirDlg) that BrowseDlg triggers with my own custom dialog.
Below is the relevant part of my WiX XML configuration where InvalidDirDlg is triggered upon an invalid directory selection:
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"" />
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" />
<Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"" />
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4" Condition="WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"" />
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1" />
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2" />.
I want to replace InvalidDirDlg with this custom dialog instead
<Dialog Id="ErrorDlg" Width="300" Height="110" Title="Warning">
<Control Id="Section1" Type="Text" X="15" Y="20" Width="270" Height="40" Text="! (loc.ErrorDlg_Section1)"></Control>
<Control Id="YesButton" Type="PushButton" X="120" Y="70" Width="60" Height="18" Text="OK">
<Publish Event="EndDialog" Value="Return" Condition="1"></Publish>
</Control>
</Dialog>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|