Hello,
By default, this is already implemented. When you install for example, in version 1 only Feature3, then in version 2 that is detected. If you delete the "OptionalFeatsDlg" or "ConfigureDlg" dialog from the second version, the user can not change the features and will be updated only the Feature3 from the first version.
This is happening due to the
"MigrateFeatureState" action, whose purpose is to take the state of the features from the old package and transfer that to the new package.
Attached is a sample project with v1 and v2 projects.
Open the v1 project, go to the "Files and Folders" page and see the 2 .txt files I added:
- FeatureA_1.txt - for FeatureA
- FeatureB_v1.txt - for FeatureB
Now, in the "Dialogs" page, you can see the "ConfigureDlg" dialog added, so the user can choose which Feature to install. You can also use the "OptionalFeatsDlg" dialog for features.
Build and run the package, choose "FeatureB" and finish the installation.
Now, open the v2 project, see that for the FeatureB I added another .txt file named "FeatureB_v2.txt".
I have installed Only a feature one on this machine and then I try to upgrade I don't want other features to be installed I want only existing feature to be upgraded.
Also from the "Dialogs" page I deleted the "ConfigureDlg" dialog and now the user can not change the Features when installing v2.
If you build and run the package you will see that only the files for the FeatureB are installed during upgrade.
Let me know if that helped you!
Best regards,
Liviu