Questions on: <ComboBoxIndex> and <CustomCheckBox>

Common questions about using Actual Installer.
Post Reply
rcarballo
Posts: 17
Joined: Tue Feb 25, 2020 10:44 pm

Questions on: <ComboBoxIndex> and <CustomCheckBox>

Post by rcarballo »

My installation has actually three components: Demo Files, Server, and Client

I'm using the Custom dialog. I added a checkbox for the Demo Files and use the ComboBox for Server and Client.
I created a folder for the Demo Files in the Installation and others for the rest of our applications.

Q1: How can I skip the installation of the Demo Files when the checkbox for Demo Files is unchecked (by the user)?
Q2: How can I uncheck the checkbox for the Demo Files if I detect (via an external task) that the Demo is already installed?
Q3: How can skip the installation of certain files if the user selects Server or Client via the ComboBox?
Last edited by rcarballo on Sat Jul 04, 2020 1:21 pm, edited 1 time in total.
Leo
Site Admin
Posts: 455
Joined: Fri Jan 22, 2010 12:40 pm

Re: Questions on: <ComboBoxIndex> and <CustomCheckBox>

Post by Leo »

A1. Solution here is to create an archive (.zip) file for the Demo files, include it into <SetupTempDir>, then check the status of the CheckBox, if it selected then unpack the archive. To make it, follow these steps:
Select menu "Tools / Create Data File", select your Demo folder, enter the name for the archive (data file), e.g Demos.zip.
The archive file will be created in your Project folder. Add this file into <SetupTempDir> (page Files and Folders).
A command to unpack this file will be added automatically (System / Commands), but we need to change it to:

Code: Select all

File: 		<SystemDir>\cmd.exe
Parameters: 	/C IF /I <CustomCheckBox>==1 ("<SetupTempDir>\7za.exe" x "<SetupTempDir>\Data.zip" -o"<InstallDir>" -aoa )
Timing: 	After Installation
Wait: 		Yes
This code will unpack Data.zip into <InstallDir>. You may change it.

To set the status of the CheckBox add a variable <SetCustomCheckBox> on the System / Variables page. It depends of the presence of registry key or value. If the Default Data of this variable is set to YES, the checkbox will be checked, if set to No - not checked.
Leo,
Actual Installer Team
https://www.actualinstaller.com
rcarballo
Posts: 17
Joined: Tue Feb 25, 2020 10:44 pm

Re: Questions on: <ComboBoxIndex> and <CustomCheckBox>

Post by rcarballo »

Will the answer to Q3 be the same as Q1? ==> Create a zip for the "Server" files and use a command like, /C IF /I <CustomCheckBox>==1 ("<SetupTempDir>\7za.exe" x "<SetupTempDir>\serverfiles.zip" -o"<InstallDir>" -aoa )

Thanks for the quick response.
Leo
Site Admin
Posts: 455
Joined: Fri Jan 22, 2010 12:40 pm

Re: Questions on: <ComboBoxIndex> and <CustomCheckBox>

Post by Leo »

Yes. Forgot to mention it :)
Leo,
Actual Installer Team
https://www.actualinstaller.com
rcarballo
Posts: 17
Joined: Tue Feb 25, 2020 10:44 pm

Re: Questions on: <ComboBoxIndex> and <CustomCheckBox>

Post by rcarballo »

Almost there with the installation. The question is now related to shortcuts being created for the files that are installed with the "Server" option.
I currently have all of the shortcuts defined in the "Shortcuts" page but that includes the shortcuts for the "Server" option.

How can I remove those shortcuts at runtime if they choose the "Client" option?

Sincerely,
-AC
Leo
Site Admin
Posts: 455
Joined: Fri Jan 22, 2010 12:40 pm

Re: Questions on: <ComboBoxIndex> and <CustomCheckBox>

Post by Leo »

Add the following on the System / Commands:

Code: Select all

File:       <SystemDir>\cmd.exe
Parameters:    /C IF /I <CustomCheckBox>==1 (del /Q "path to shortcut with .lnk extension")
Timing:    After Installation
Wait:       Yes
Here <CustomCheckBox> = 1, change it to your settings for the Server installation
path to shortcut looks like: <ProgramGroup>\<AppName>.lnk
Leo,
Actual Installer Team
https://www.actualinstaller.com
rcarballo
Posts: 17
Joined: Tue Feb 25, 2020 10:44 pm

Re: Questions on: <ComboBoxIndex> and <CustomCheckBox>

Post by rcarballo »

Very good. Thanks for the help.

QUESTION
You said,
"To set the status of the CheckBox add a variable <SetCustomCheckBox> on the System / Variables page. It depends of the presence of registry key or value. If the Default Data of this variable is set to YES, the checkbox will be checked, if set to No - not checked."

I ran some tests to see if AI was reading the registry in order to set the value to the <SetCustomCheckBox> variable but it checkbox is always checked. I tried using STRING with "YES" or "NO", DWORD with 0 or 1 but none worked. I also tested the Default Data field by setting to "No" or 0 but the checkbox was always checked.

Is this a bug?
Leo
Site Admin
Posts: 455
Joined: Fri Jan 22, 2010 12:40 pm

Re: Questions on: <ComboBoxIndex> and <CustomCheckBox>

Post by Leo »

To set initial status (checked / unchecked) of the CustomCheckBox you need to add a variable <SetCustomCheckBox> on the System / Variables page.
Specify registry key and value. Also in the Default Data type YES.
If the registry key and value exists (and the data is not YES), the check box will NOT be checked.
If the registry key or value DOES NOT exist (in this case the Default Data (YES) will be used), the check box WILL Be checked.

You may change the Default Data to NO, to invert the status.

Code: Select all

Variable: 	<SetCustomCheckBox>
Bitness: 	Default
Registry Key: 	HKEY_CURRENT_USER\Software\My App
Value Name: 	Path
Value Type: 	REG_SZ
Default Data:   YES
Leo,
Actual Installer Team
https://www.actualinstaller.com
rcarballo
Posts: 17
Joined: Tue Feb 25, 2020 10:44 pm

Re: Questions on: <ComboBoxIndex> and <CustomCheckBox>

Post by rcarballo »

Well, I followed your instructions but the checkbox does not behave as you described.
The checkbox is unchecked at the Interface/Custom screen. This means that if the value is missing from the registry or .INI file AND the default value is YES (it is), the checkbox will be checked.

I tested using the registry and .INI file. None worked.
I attached a simple project that you can use to duplicate the problem. Running AI (v7.6) under XP but could run the test on any other OS if you wish me to do so.
Attachments
Test.zip
AI project + test. ini file
(1.75 KiB) Downloaded 723 times
rcarballo
Posts: 17
Joined: Tue Feb 25, 2020 10:44 pm

Re: Questions on: <ComboBoxIndex> and <CustomCheckBox>

Post by rcarballo »

We upgraded to v8.0 and the AI is now setting the <SetCustomCheckbox> from the .INI or Registry location as expected.
Post Reply