prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Disable Feature at Runtime

Wed Jun 20, 2018 4:52 pm

Hi,

I am trying to disable a Feature in my installer based upon the value of a public property which changes based on user selection.
For marking the feature as Installed, it is okay as it is the default behaviour but I have an issue for marking it as Disabled.

In the "CustomizeDlg", instead of "Disable" the feature's state is "Not installed", which allows the user to change it. But I don't want to show it to the user so that he can change it. I have set the condition in "Disabled" field of "Installation behaviour" of that feature, but still it's not working.

I have attached the .aip file which reproduces this issue.
I change the public property based on the selection of type of installation in "InstallTypeDlg" and "Feature2" should be disabled for "Everyone".

Is there anything that I am missing to achieve the desired behaviour?

Thank you.
Prerak
Attachments
AdminTest.aip
(18.97KiB)Downloaded 267 times

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Disable Feature at Runtime

Tue Jun 26, 2018 1:26 pm

Hi Prerak,

Sorry for the delayed reply.

Your problem appears because of an old Advanced Installer issue that was fixed in version 14.4 of our software. Can you build your project with a newer version and see if it works correctly?

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

prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Disable Feature at Runtime

Wed Jun 27, 2018 9:21 am

Hi Eusebiu,

Unfortunately my maintenance plan has expired, so I cannot update the application at the moment. I have version 13.5 installed.
Is there an alternative for this?

Also, when I tried do disable a feature, based on a result returned from "Search in registry" operation, it was working fine.
So, is that normal?

Prerak

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Disable Feature at Runtime

Thu Jun 28, 2018 2:00 pm

Hi Prerak,

Please keep in mind that Windows Installer does not support switching between "Disabled" and "Installed" states for a feature on the dialogs. Once a feature was disabled, it cannot be enabled again. So, it can be hidden from the "CustomizeDlg" based on a condition, but it cannot be displayed again. Please send me an email with your license key to support at advancedinstaller dot com, so I can extend it for you to be able to build your project with version 14.4.

Disabling or enabling a feature based on a search result is, indeed, possible because the searches are performed before the validation of the features' states.

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

prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Disable Feature at Runtime

Thu Jun 28, 2018 2:49 pm

Hi Eusebiu,

I have sent the email with my license key.

Also, for disabling/enabling a feature, if I execute a custom action that will set a property, after "Searches" stage in "Wizard Dialog Stage" would it work?
Currently i check the "AI_InstallPerUser" to see if user is Admin or Non-admin but I'll switch to "AdminUser" or "Privileged" property if needed.

Prerak

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Disable Feature at Runtime

Thu Jun 28, 2018 2:51 pm

Hi Prerak,

A feature that is disabled by default can only be enabled based on a condition before the "Paths Resolution" action group, but it cannot be enabled later. However, if it is enabled by default, it can be disabled on the dialogs, too.

If the feature is disabled based on a condition, it cannot be enabled again neither before the "Paths Resolution" action group, nor later.

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

prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Disable Feature at Runtime

Thu Jun 28, 2018 3:07 pm

Hi Eusibiu,
if it is enabled by default, it can be disabled on the dialogs, too.
Just to confirm, this is not working in 13.5, because of the bug that you mentioned before. Correct?

Prerak

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Disable Feature at Runtime

Thu Jun 28, 2018 3:28 pm

Yes, disabling a feature should work starting with 14.4.

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

Return to “Common Problems”