Hello Raghu,
The behavior of your project is normal. If the default setting for the checkbox is
"Selected : True", the property attached to your checkbox is initialized with the value from
"Value" field. Adding the registry keys and values is part of
"Add Resources" action group, so before the
"ExitDialog" appears, that means any change is made to this property on "ExitDialog" will not be in the Windows Registry.
To store the value of the checkbox that appears on
"ExitDialog" in the registry you can use a
custom action that writes the value in the registry. The custom action can be called on {Finish] button from "ExitDialog".
To achieve this you must set the following configuration :
1. In order to add to registry a value, you can create a batch file and include it in the project, with the following content :
The arguments are :
- Path of the key
Name for the value
Type of the value
Data
The
"/f" switch is for overwriting the data if the value exists.
2. In the Advanced Installer project you can create in
"Install Parameters" page four properties, corresponding to the four arguments –
"REG_PATH", "REG_VALUE", "REG_VALUE_TYPE", "REG_DATA".
3. In
"Custom Actions" page we add a
"Launch file" custom action, without sequence like this :
- File to launch : [#reg.bat]
Command line : [REG_PATH] [REG_VALUE] [REG_VALUE_TYPE] [REG_DATA]
Run as Administrator - checked
4. In
"Dialogs" page, on
"Finish" button from
"ExitDialog" we add two
published events :
- Set installer property value
Property : REG_DATA
Argument : [CHECKBOX_1_PROP]
Condition : CHECKBOX_1_PROP
- Execute custom action
Argument : Launch file
The first one set the value of the
REG_DATA property with the value of
CHECKBOX_1_PROP if this is checked, that's because the batch file will give an error if it doesn't have as argument a value for Data. If the checkbox is unchecked, the registry will store the default value of
REG_DATA, the one that you declared above in
"Install Parameters" page. The second one launches the file and saves the value to the registry.
You can find attached a sample project which implements these settings.
Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.
All the best,
Daniel