Lient1951
Posts: 1
Joined: Tue Apr 08, 2025 4:29 am
Contact: Website

How to set registry values ​​based on selected feature in MSI project?

In an MSI project using Advanced Installer, I have multiple optional features (FeatureA, FeatureB…), and I want to set a registry key (e.g. HKLM\Software\MyApp\SelectedFeature) with a value corresponding to the feature the user selects at install time. So what is the simplest and correct way to determine which feature is selected at install time (Install Execution Stage), and use it to set the registry value?
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: How to set registry values ​​based on selected feature in MSI project?

Hello and welcome to our forums,

The easiest way to achieve this would be to:

1. create your own custom dialog that displays a checkbox for each feature

2. tie these checkboxes to the features in the Organization page.

Note: by "tie", I mean condition each feature to install based on its own checkbox

How to show a custom feature selection dialog

3. in "Registry" page, create a registry entry for each feature. Right click on the registry entry and click "Go to component".

4. condition the installation of the component (registry entry) based on the checkbox state.

And of course, make sure that the registry entry's component is not under any of the features. For instance, you can create a new feature and place all the registry components there.

Hope this helps!

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

Return to “Common Problems”