Install prerequisites based on checkbox value - Advanced Installer Community
VAlch
Posts: 18
Joined: Fri Oct 04, 2013 3:03 pm

Install prerequisites based on checkbox value

Hello, I want to create an installer that will have prerequisite inside. The prerequisite will be installed from URL and based on checkbox condition.
So I add prerequisite in the Future-based section, add condition to install using “Registry value with specified content” I’ll use HKCU\Software\_GInstaller\Flag key. The “Exact match” for this key is 0.
I have three custom action scripts:
Script_1 (at the beginning of Wizard Dialog Stage). This script create key in registry and set value to 0.
Script_2 (at the beginning of Install Execution Stage). This script set 0 value to the key that created in Script_1.
Script_3 (at the end of the Installation). Script for clear registry key that used during installation.
If Script_1 set 0 and Script_2 set 0 – prerequisite installation will be passed.
If Script_1 set 1 and Script_2 set 0 – prerequisite installation will be successful.
Now I want to control the prerequisite installation using checkbox on the Welcome dialog. If check box checked – the prerequisite must be installed. Otherwise – passed.
So I use Script_Control, that change the registry key HKCU\Software\_GInstaller\Flag to 1 if checkbox is checked, and 0 – otherwise when Next button will be pushed on the Welcome dialog.
But this not works for me.

The algorithm is:
Scrip_1 – Set 0 to registry flag;
User check the checkbox (the prerequisite should be installed)
Script_Control – Set 1 to registry flag;
Installation passed.

Another way:
Scrip_1 – Set 1 to registry flag;
User uncheck the checkbox (the prerequisite should not be installed)
Script_Control – Set 0 to registry flag;
Installation success.

What is the right way to control prerequisite installation?
I moved the prerequisite to the Post-install sections, but this not helped.
Thanks

P.S. The demo project attached
Attachments
Your Application.aip
Demo project
(26.17 KiB) Downloaded 334 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install prerequisites based on checkbox value

Hi,

The right way to control the prerequisites installation is to go in the "Install Conditions" tab of the prerequisites and set there the appropriate searches for them.

In case you want to use a property as a condition for a prerequisite, you can add it as a "feature-based" or "post-install" prerequisite, then go in the "Organization" page, select its related feature, click on the "Add Install-time conditions" link, select the "Not installed" option and in the "Installed if" field write the appropriate condition based on your properties.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
VAlch
Posts: 18
Joined: Fri Oct 04, 2013 3:03 pm

Re: Install prerequisites based on checkbox value

Thank you for your answer, but I still can't to do what I want.
The problem is in condition again. Seems like the condition calculated before installer starts. Example if I use 1 = 1 as a condition - an additional application will be installed. If 1 = 0 - not installed, so it's all right.
But if I try to use CHECKBOX_1_PROP = "CheckBox" (if I put default checkbox on the Welcome page) in any case (checkbox checked or not) the installation of the additional application will be passed. Can you please review my test project, and point me to my fault?

Thanks in advance!
Attachments
TestApp.aip
(15.98 KiB) Downloaded 276 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install prerequisites based on checkbox value

Hi,

There was a problem in Advanced Installer, as discussed in the Feature "install based on condition" broken with AI 10.5 thread and that seems to be the reason why your prerequisite is not installed based on the checkbox selection.

The problem was fixed in Advanced Installer 11.5, so you can either upgrade to a newer version of Advanced Installer or implement the workaround described in the above thread.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
VAlch
Posts: 18
Joined: Fri Oct 04, 2013 3:03 pm

Re: Install prerequisites based on checkbox value

Ok, thank you for your reply! I'll try.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install prerequisites based on checkbox value

You're welcome.

Just let me know if any other problem appear.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”