One option: After the dialog, schedule a SetProperty custom action that sets
NEED_CONFIGURE_FIREWALL to 2 (or 0, if you prefer) if it is missing or
blank. Before showing the dialog (but after AppSearch) schedule a
SetProperty custom action that clears the value if it is set to your
sentinel value. To test it (to control your firewall configuration changes)
compare it to 1 instead of simply testing presence.

That way, your property will either be the default of 1 or the value from
the registry and the checkbox will be unchecked if the value in the registry
wasn't 1.

-----Original Message-----
From: Igor Lemsky [mailto:igor.lem...@gmail.com] 
Sent: Sunday, August 15, 2010 8:17 PM
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] Storing checkbox status in registry

I have one checkbox in my installer. for example
<Control Id="checkBox13541" Type="CheckBox" Height="18" Width="345" X="15"
Y="140" Text="Windows Firewall must be configured"
Property="NEED_CONFIGURE_FIREWALL" CheckBoxValue="1" />
If it checked, I make some configuration actions during install.
Some users doesn't use firewall, so they uncheck this checkbox. During
upgrade, reinstall or so on actions they want to store unchecked status of
this checkbox.
So I made two things:

Store it in one component: <RegistryValue Id="registr5464234" Root="HKLM"
Key="Software\Signatec\Installation" Name="NEED_CONFIGURE_FIREWALL"
Type="string" Value="[NEED_CONFIGURE_FIREWALL]" />

And load value in AppSearch action:
    <Property Id="NEED_CONFIGURE_FIREWALL" Secure="yes" Value="1">
      <RegistrySearch Id="NEED_CONFIGURE_FIREWALL_RS" Type="raw" Root="HKLM"
Key="Software\Signatec\Installation" Name="NEED_CONFIGURE_FIREWALL" />
    </Property>

Problem: if checkbox is unchecked, installer store empty string in registry.
During next installer start it doesn't see empty string in registry and use
default value "1". So unchecked status doesn't load. Checkbox is checked
during GUI of installer.
Of course I can set default value to empty string, but I need checked status
to be default.
What can I do?
----------------------------------------------------------------------------
--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to