Mike@Nestor
Posts: 7
Joined: Fri Mar 22, 2024 2:45 pm

Modify feature at runtime

Hello !
Sorry if my question has already been asked but I don't succeed in what I want, and after many searches over the forum I did not find any answer.

The problem that I'm facing to is simple :
For my install the customer has to use a dongle from which I can know which features he can access to. So then I have to disable the features he can't access to in the customize dialog.
For this need I created a project that use a custom action written in C#.

What I understand from all what I read is : please correct me if I'm wrong
- I can't enable a feature after "Path Resolution" stage for a custom action with sequence.
- I can disable a feature from a custom action without sequence
- I cannot enable a feature that was previously disabled

So I create a project with 2 features (Feature1 & Feature2) and a custom action that display a message box which ask the user to update or not the features. If the user answer Yes, Feature1 is set to 1, Feature2 is set to 0. If he answer No, features do not change.
The custom action with sequence is first called before "search" stage then the same custom action without sequence is called before the customize dialog.

I tried all possible scenarios with features initially set to 0 or to 1 and I never obtained what I want. Sometimes both features are completely disabled, sometimes completely enabled.

If you can help me on this issue it would be great. I let the AI project with the custom action source code. I am working with AI 21.5.1 (enterprise licence).

regards,
Michael
AI_test_features_runtime.zip
(5.71 KiB) Downloaded 17 times
Mike@Nestor
Posts: 7
Joined: Fri Mar 22, 2024 2:45 pm

Re: Modify feature at runtime

Hello,
I found the solution as described as this post viewtopic.php?p=3848#3848
Thanks,
Mike
Liviu
Posts: 1048
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Modify feature at runtime

Hello Mike and welcome to our forums,

Thank you for your followup on this.

If you have any other questions, please let us know.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mike@Nestor
Posts: 7
Joined: Fri Mar 22, 2024 2:45 pm

Re: Modify feature at runtime

Hello,

yes I have other questions.

In a standard installation project I use the SetupTypeDlg dialog with Typical, Custom and Complete installation types.
From my custom action, after reading my dongle, for each feature that user cannot access, I request a new state as Absent (WixToolset.Dtf.WindowsInstaller.InstallState.Absent) and I update the Feature table fields Display and Level respectively with values 0 and 1001, which means to not display these disabled features and prevent their installation from Typical and Complete installations.
So from the Custom installation dialog I don't have access to these disabled features, perfect.

The problem is that the disabled feature are still installed if I choose Typical or Complete installation.
What am I missing ?

regards,
Mike
Liviu
Posts: 1048
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Modify feature at runtime

Hello Mike,

I'm not sure why this happens.

To facilitate a more in-depth investigation of this issue, could you kindly email the following resources to support at advancedinstaller dot com?

1. the .AIP (setup project) file.
2. a download link for your setup package.
3. a test-case that we can follow.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mike@Nestor
Posts: 7
Joined: Fri Mar 22, 2024 2:45 pm

Re: Modify feature at runtime

Hello Liviu,

I changed my project, I remove the SetupTypeDlg dialog, so I use only the CustomizeDlg dialog and all work fine, as I want :)

Thanks,
regards
Liviu
Posts: 1048
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Modify feature at runtime

Hello Mike,

Thank you for your followup on this. I'm glad you found a solution.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”