Search code examples
wixwix3.8

view readme on finish button issues


So I have an option on the finish screen where a checkbox appears asking if the user wants to view the readme. If the box is checked and you click finish it correctly brings up the readme in notepad but it does not finish the install. It just sits there. If I uncheck the box and click finish it doesn't do anything either.

I followed the instructions here for the most part but I experience the issues described above. I'd also like this checkbox to be checked by default.

Here are the relevant parts of my wix files that do this:

<UI Id="MainUI">
    <Publish Dialog="ExitDialog"
             Control="Finish"
             Event="DoAction"
             Order="999"
             Value="LaunchReadme">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>

<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="View readme (Recommended)"/>
<Property Id='NOTEPAD'>Notepad.exe</Property>

<CustomAction Id="LaunchReadme" Property="NOTEPAD" ExeCommand='[INSTALLFOLDER]readme.txt' Return='asyncNoWait' Impersonate="yes" />

Solution

  • I actually found the answer here: Installer does not close after running custom action

    The key was adding:

    <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
    

    So the final UI section looks like this:

    <UI Id="MainUI">
        <Publish Dialog="ExitDialog"
                 Control="Finish"
                 Event="DoAction"
                 Order="999"
                 Value="LaunchReadme">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
        <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
    </UI>