Search code examples
c#upgradeadvanced-installerorcamissing-features

Upgrade and add new features with MST transform


I am trying to update my application and while doing so also enabling some new features. The features existed in the previous version as well, they were just turned off.

I create an MST file using Orca where I have set INSTALLEVEL to 4 and all the features that I want to install to 1, the ones I don't want to install I set to 5 or above. Everything works as it should.

After this I would like to do an upgrade of the application the same way as I did the install with the difference that I would like to turn on additional features using INSTALLEVEL. After the installation is finished my application is in fact the new version but the newly added features are missing.

What I can do to resolve this issue is using ADDLOCAL=feature1,feature2 in command line, but I would avoid doing so because on large scale this solution won't work.

I've tried adding ADDLOCAL in the property table of the msi and generated a mst file from it using Orca. Doing so will install the features,but the problem with this solution is that:

a) MSDN doesn't recommend it

b) After install if I go to Add/Remove programs and try and change the application, I can't any more, because it is in some sort of repair mode...

SO my question is, how do I update a product enabling new features in it using mst file?

EDIT

It is worth noting that if a feature was installed previously after the upgrade it will be there, this only fails if it wasn't installed previously.


Solution

  • You could try to set a false condition on the standard action MigrateFeatureStates, to never execute. I suspect this is the one that overwrites the install levels of your features. (You can check this by creating a verbose log and searching for the action name in it)