Disable UI control when feature already installed - Advanced Installer Community
Mike.Bryant
Posts: 8
Joined: Fri Apr 17, 2020 7:05 pm

Disable UI control when feature already installed

I have a project with an optional feature which is selected using a checkbox. When the installer is run again in maintenance mode, I want to show the feature checkbox as checked but disable it so it cannot be turned off.

My feature is named "Feature_EnhancedSecurity" and I added a control condition to the dialog:
!Feature_EnhancedSecurity = 3 Disable

I also want to check the box if the feature is already installed so I added a custom action in the Init Events of the dialog
[CHECKBOX_ENHANCED_SECURITY_2] TRUE AI_MAINT AND (!FeatureEnhancedSecurity = 3)

Unfortunately after I install without EnhancedSecurity, I still see the box checked and disabled when I do maintenance mode.
What am I doing wrong?
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Disable UI control when feature already installed

Hello Mike,

To be fully honest with you, I can not say for sure what you are doing wrong.

I have followed this scenario and everything worked as expected on my end.

Please have a look over the following sample project which I've created for you:

Mike Sample Project.zip
(3.62 KiB) Downloaded 428 times

The scenario is as it follows:

- install the setup without the checkbox control being checked

- re-run the setup

- it will start in Maintenance mode --> "Modify" --> the dialog is spawned and the checkbox is neither checked nor disabled

If the sample project does not help, please forward me a copy of your .AIP file so I can further investigate it, as the old .AIP file from the other thread does not seem to contain all the modifications you have mentioned.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mike.Bryant
Posts: 8
Joined: Fri Apr 17, 2020 7:05 pm

Re: Disable UI control when feature already installed

My version of Advanced Installer is 13.1 which cannot open your example file. I'll send you an email with my updated project.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Disable UI control when feature already installed

Hello Mike,

Thank you for the provided .AIP file.

I have further investigated it and it looks like your issue comes from the fact that your control (checkbox) has both the "Selected = True" and the "Enabled = False" attributes set. This is the reason why your checkbox is always disabled and checked.

Please go to "Dialogs" page --> "Maintenance" --> your dialog and change the above attributes as it follows:

Code: Select all

Selected = False

Code: Select all

Enabled = True
Basically, you were trying to enable a checkbox that was already enabled by default and disable a checkbox that was disabled by default.

Additionally, please keep in mind that in some cases (not sure if this is one of them), you might need to also have a complementary control condition.

Hope this helps.

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

Return to “Common Problems”