frankmanguiob
Posts: 10
Joined: Fri May 08, 2020 6:46 pm

Image Checkbox State to Property to Registry Value not working

Wed Jan 19, 2022 5:01 am

Hello,

Enterprise user here.

I want to add an image checkbox which ultimately will add and change the value of a registry entry (also deployed via installer). Something like CheckBox is checked -> RegistryKey = 1, CheckBox is not checked -> RegistryKey = 0.

I know there are a lot of posts about this, none of these worked for me. Assuming the registry key RegistryKey is added to HKCU/Software/[Product Name] with an integer value, with an ImageCheckbox added to a dialog with the name ImageCheckBox, property of IMAGECHECKBOX_1_PROP, selected = false, value of ImageCheckBox, and lastly, a property named UserDecision with a default value of 0, things I've tried:= and did not work:
1. Add a published event to the checkbox itself, with event argument as [UserDecision], argument of 1, and condition of IMAGECHECKBOX_1_PROP = "ImageCheckBox" and another event reversed (argument 0, condition IMAGECHECKBOX_1_PROP <> "ImageCheckBox"
2. Using the condition ImageCheckBox and NOT ImageCheckBox.
3. Assigning these events to the install button instead of the checkbox.

My registry entry never changes from default, even if the checkbox is checked.

Thank you!

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Image Checkbox State to Property to Registry Value not working

Fri Jan 21, 2022 1:31 pm

Hi,

That happens because you need to use a public property.

Can you please change the property name from "UserDecision" to "USERDECISION"?

Only a Public Property is passed on from the Wizard Dialogs Stage (in which the dialogs are showed) to the Install Execution Stage (in which the system is modified).

Public properties contain only upper-case letters in their name. The difference between Private and Public Properties consists in the way their values are being passed on.

Please have a look on the Windows Installer Properties article which may be useful to you.

Hope this helps! If you have any other questions, please don’t hesitate to contact us.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

frankmanguiob
Posts: 10
Joined: Fri May 08, 2020 6:46 pm

Re: Image Checkbox State to Property to Registry Value not working

Fri Jan 28, 2022 8:16 am

Hi Liviu,

Thanks for the reply. I have since removed the old property and created a new one in Install Parameters, but the value still doesn't flip.

Is there a way to send you the actual project file so you can take a look?

Thanks!

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Image Checkbox State to Property to Registry Value not working

Fri Jan 28, 2022 8:32 am

Hi,

Yes, you can send us the .AIP (setup project) file by email to support at advancedinstaller dot com

Looking forward to hearing from you.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

frankmanguiob
Posts: 10
Joined: Fri May 08, 2020 6:46 pm

Re: Image Checkbox State to Property to Registry Value not working

Wed Feb 02, 2022 2:14 am

Hi Liviu,

I just moved the events to the checkbox itself and it worked!

So for the benefit of the forum:
1. Make sure the public property (the one you use to assign a value in the registry with) is public, all caps, like Liviu said.
2. Using the install button's subscribed events did not work for my case. It worked when I assigned it to the checkbox itself. The conditions are CHECKBOX_CHECKED and NOT CHECKBOX_CHECKED.

Thanks!
Frank

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Image Checkbox State to Property to Registry Value not working

Wed Feb 02, 2022 12:41 pm

You are always welcome, Frank!

We are glad you got this working.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”