WIX optional checkbox on ExitDialog.wxs not working

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

WIX optional checkbox on ExitDialog.wxs not working

This post has NOT been accepted by the mailing list yet.
I'm trying to have a checkbox where I ask the user to create Desktop shortcut but it's not working.

Here is the code

<Product Id="{GUID goes here}" Name="WindowsFormsApp1" Language="1033"
    Version="" Manufacturer="Lorem" UpgradeCode="{GUID goes here}">

    ... other codes

    <Feature Id="ProductFeature" Title="WindowsFormsApp1" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
        <ComponentRef Id="ApplicationShortcutDesktop" />

    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Create desktop shortcut?"/>

    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="WindowsFormsApp1" />
        <Directory Id="DesktopFolder" Name="Desktop">
            <Component Id="ApplicationShortcutDesktop" Guid="{GUID goes here}>
                <Shortcut Id="ApplicationDesktopShortcut" Name="WindowsFormsApp1"
                <RegistryValue Root="HKCU" Key="Software\Microsoft\WindowsFormsApp1"
                    Name="installed" Type="integer" Value="1" KeyPath="yes"/>

When I set the value of property WIXUI_EXITDIALOGOPTIONALCHECKBOX to Value="1" it create the shortcut before I click finish. So I think the value was evaluated when the ExitDialog was loaded. So how can I fix it?

I also tried <Condition>WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1</Condition> but still no luck, I think After I click finish the program doesn't do anything, when I change the location of checkbox to InstallDirDlg, it was working.