Manually migrate feature states during upgrade
Asked Answered
C

1

2

We have a product for which the feature tree has changed considerably between versions, so the MigrateFeatures="yes" option on the UpgradeVersion element does not seem to work.

How would I go about manually converting the old features to the new ones? Do I need a custom action, and if so, how can I do this from there?

Consumedly answered 27/1, 2015 at 13:53 Comment(1)
I know this is long ago, but I think another viable option for cases such as this might be to set MigrateFeatures="No" - just to avoid trying to match feature states at all.Breastbone
P
3

As far as I know, the feature tree structure isn't relevant - it matches the Name in the Feature table, so if they all match you'd still get some migration. Note that it is the Name, not the Title so it's ok if the Name is the same but the Title in the UI is different. So it depends on exactly what has changed, if it's just the layout or many of the Name values too.

Otherwise you'd need custom actions to set ADDLOCAL to set the list of features from the installed list, which you'd need to query with MsiEnumFeatures and then MsiQueryFeatureState. Or the code could be in an external launcher which finds installed features and then launches the MSI with an ADDLOCAL command line of the features, presumably not offering the feature dialog. I think that's the only way.

Pleuro answered 27/1, 2015 at 18:16 Comment(1)
It's not just the structure of the feature tree that was modified, but features have been split into several etc, so I definitely need some manual labour to migrate the state. But your suggestion seems to point me in the right direction, so I'll try that. Thanks.Consumedly

© 2022 - 2024 — McMap. All rights reserved.