问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/28172169/manually-migrate-feature-states-during-upgrade