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

Enable/Disable feature at runtime

Hello,

In one of my application, I have a set of features. All the features are available for installation for "Full" version but only one is available for "Demo" version.
So, to achieve this, before the "ConfigureDlg", I have added one more dialog that asks for the type of installation using a radio group. The property name for this radio group is DEMO_INSTALL and the radio buttons have the following values:
- Full: 0
- Demo: 1
By default the value is set to 1.

In the organisations page, all the features are marked as "Installed" and I have the following condition in "Disabled if"

Code: Select all

DEMO_INSTALL="1"
Now, when the user selects "Demo", the "ConfigureDlg" displays only one feature which is what I want. But if he/she goes back and selects "Full", the "ConfigureDlg" is still not showing the rest of the features.

In one of the other user flows, if the user selects "Full" first, the "ConfigureDlg" shows all the features and upon going back and selecting "Demo", the "ConfigureDlg" now shows onle one feature. This is what I want.

As per my understanding from my previous post, a feature can be disabled in the dialogs but once it is disabled, it can not be enabled again because it can be enabled only before "Paths Resolution" stage.

So, is there a workaround or any other way to achieve what I am trying to do here? Or, I have to tell the user to relaunch the installer in case he selected "Demo" by mistake the first time.

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

Re: Enable/Disable feature at runtime

Hello Prerak,

As my colleague Eusebiu explained, that is the implementation of Windows Installer.
So, is there a workaround or any other way to achieve what I am trying to do here?
Unfortunately, I am not aware of any way in which this can be worked around.
Or, I have to tell the user to relaunch the installer in case he selected "Demo" by mistake the first time.
I am afraid this is not possible either, as we can not condition the custom message spawn. For example, here we would need to spawn the message if user chose "Demo" and then pressed "Next" and then "Back". Such a condition is not achievable, I am afraid.

However, what is possible here is to simply make a double check. For instance, spawn a messagebox which asks the user once again if he wants to go with the chosen option. For instance, we can have two MessageBox custom actions, both spawned based on what the user has chosen.

Hope this helps somehow.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Enable/Disable feature at runtime

Hi Catalin,

Thanks for the information and clarification.

Prerak
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: Enable/Disable feature at runtime

You are always welcome, Prerak!

Please let me know if there is anything else I could help you with and I will gladly assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Enable/Disable feature at runtime

Hi Catalin,

I have one more weird issue concerning APPDIR.
I have created a new topic regarding it over here: viewtopic.php?f=2&t=45050

If you could please have a look at it and assist me.

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

Re: Enable/Disable feature at runtime

Hello Prerak,

I have answered your forum thread here:

viewtopic.php?f=2&t=45050&p=115291#p115291

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

Return to “Common Problems”