Creating installer with different checkboxes - Advanced Installer Community
Niel_Pieterse
Posts: 3
Joined: Thu May 21, 2020 8:59 am

Creating installer with different checkboxes

Hi There,

I am trying to build a installer that will have 4 checkboxes.

I created the dialogs for the installation in the following order:
PrepareGlg
WelcomeDlg

FolderDlg
SQLConnectionDlg
SetupTypeDlg
VerifyReadyDlg
ProgressDlg
ExitDlg


The checkboxes are added on the SetupTypeDlg. It is a MSI Package and I only need to use the First Time Install dialog.

The first checkbox must deploy a DacPac file which will create a new SQL database. If the first checkbox is selected the second, third and fourth checkboxes should not be able to be selected. I added the PowerShell script to the installer that is used to deploy this DacPac as a Custom Actions "Run PowerShell Inline Script" file.

The second checkbox should be able to deploy a SQL Script (the sql information should be used from the SQLServerConnectionDlg dialog). This checkbox should not be able to be selected if the first checkbox is selected. The third and fourth checkbox must be able to be selected with this checkbox. It does not want to deploy the SQL Script.

The third checkbox needs to deploy a .bat file that will deploy ETL's to the SQL Server. This checkbox should not be able to be selected when the first checkbox is selected, it should be able to be checked by itself or if the second checkbox is selected it should deploy after the second checkbox is completed. I added this .bat file to the Custom Actions as a action and it is called LaunchFile. I can't get this file to be deployed.

The fourth checkbox must deploy a stored procedure on the database using a SQL Script (the sql information should be used from the SQLServerConnectionDlg dialog). This checkbox should not be able to be selected if the first checkbox is selected

I created features for each of these checkboxes, I don't think that the features I created for these checkboxes are correct. I added files to them but when I build the installer they do not deploy and I can't select the first checkbox, I removed all conditions from all four checkboxes to make sure that there is nothing holding it back but still I can't get the checkbox to be selected.. If I remove all the checkboxes except the first one it does not deploy the DacPac and I can't select it. If I remove the first checkbox and try to deploy the second checkbox it does not deploy the SQL Script, the same for the deploy of the .bat file and the last SQL Script. So it seems nothing that I added is actually deploying anything and I can't see any logs for more information to troubleshoot these issues.

Can you please help me to what I am supposed to do to get my installer built in this way?

On the UserExitDlg (under the Special Dialogs) it does not open the error log on the Show Log checkbox, can you please assist me to get the log opened in this checkbox?

Lastly on the FatalErrorDlg (under the Special Dialogs) the show Log checkbox is on the dialog but when the package fail it does not show the screen neither open the log file so troubleshooting is a bit difficult, can you also please assist me to get this checkbox working on the FatalErrorDlg.

Please let me know if you require any other information.

Thank you.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Creating installer with different checkboxes

Hello Niel,

First of all, if you want the "Show Log" checkbox to be displayed, please note that you need to run your setup with the logging option enabled.

That can be achieved, depending of your project output (either MSI or EXE), as it follows:

msiexec /i <path_to_msi> /L*V <path_to_log_file>\log.txt

if the package is an MSI, and:

setup.exe /L*V <path_to_log_file>\log.txt

if the package is an EXE.

Now, regarding your question, I am not quite sure I fully understand what you are trying to achieve.

If I understand correctly, you have 4 checkboxes and want to apply the following logic to them:

- if the first one is selected, you should not be able to select the rest 3.

This can be achieved by adding a "Control Event" that will disable the other checkboxes if the first one is selected. On the same note, you should add a new "Control Event" that will enable the checkboxes if the first one is NOT selected.

Please note, however, that this will disable the button only. That means if the second checkbox, for instance, is already selected and the user selects the first checkbox, it will not be deselected.

If you would like to automatically deselect the second checkbox when the first one is selected, you can proceed as it follows:

- select the first checkbox

- go to "Published Events" tab

- add a new event, as it follows:

Event: Set installer property
Property: [THE_PROPERTY_ASSIGNED_TO_THE_SECOND_CHECKBOX]
Argument: {}
Condition: you can leave this as default


Now, regarding the fact that your files are not installed based on the checkbox selection, this might happen because you are using a "Private Property" to store the value of the checkbox.

Please note that there are two types of properties, as explained in the following article:

Windows Installer Properties

Most likely, when your files are installed, the value of your checkbox property does not exist, therefore the condition is evaluated as false and the files are not installed.

With that being said, please use public properties instead (all upper characters, e.g.: MY_PROPERTY, YOURPROPERTY32, SOME_OTHER_PROPERTY)

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

Return to “Common Problems”