Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MigrateFeatures not behaving as expected #750

Closed
cocowalla opened this issue Oct 23, 2019 · 2 comments
Closed

MigrateFeatures not behaving as expected #750

cocowalla opened this issue Oct 23, 2019 · 2 comments

Comments

@cocowalla
Copy link

I'm configuring upgrades like this:

project.MajorUpgradeStrategy = MajorUpgradeStrategy.Default;
project.MajorUpgradeStrategy.UpgradeVersions.MigrateFeatures = true;

When an upgrade is done, Windows Installer appears to behave as expected, as far as I can tell from the logs.

However, in custom actions I'm unable to determine which features are selected - session["ADDLOCAL"] is always empty, and as a result of course Session.IsFeatureEnabled(FEATURE_ID) is always false.

Is there any way to determine what features are installed in a custom action during an upgrade?

@oleg-shilo
Copy link
Owner

It is an interesting problem. Remember, we have found that ADDLOCAL is used to pass the user input (ticks in checkboxes) to control which features are installed. But in case of no user input the property is empty.

I am not sure where and how WiX/MSI keeps the installed features information but something tells me it does.

If you are not in deferred (elevated) CA you can always try and see if e.Session.Features has it.

And if it does then I will speedup delivery of #737 which then can be used in a new extension method session.IsFeatureInstalled(id).

Finding right semantics of the method names can be a challenge:

  • session.IsFeatureInstalled(id) - product is installed (or being upgraded) and the feature is too
  • session.IsFeatureEnabled(id) - product is being installed and the feature is selected by the user for the installation. Based on ADDLOCAL but falls back to WixSharp ADDFEATURES in deferred actions.

But let's see if my guess about session.Features during upgrade is right.

@cocowalla
Copy link
Author

Hah, totally forgot that I'd previous opened the related #737!

You are correct, e.Session.Features does have feature states, and with managed UI they are available in the BeforeInstall action.

oleg-shilo pushed a commit that referenced this issue Nov 1, 2019
- Issue #750: MigrateFeatures not behaving as expected
- Issue #756: Fix Extensions.SaveBinary
- Issue #748: error for FirewallException
- Issue #758: PVS-Studio report
- Issue #756: Fix Extensions.Combine(this List<>, List<>)
- Added fallback language setting to demonstrate safe localization technique in the 'Firewall Exception' sample.
- Add Interface element for COM registration
- Added extra content to the `SetupArgs.Data` documentation.
oleg-shilo pushed a commit that referenced this issue Nov 1, 2019
- Issue #750: MigrateFeatures not behaving as expected
- Issue #756: Fix Extensions.SaveBinary
- Issue #748: error for FirewallException
- Issue #758: PVS-Studio report
- Issue #756: Fix Extensions.Combine(this List<>, List<>)
- Added fallback language setting to demonstrate safe localization technique in the 'Firewall Exception' sample.
- Add Interface element for COM registration
- Added extra content to the `SetupArgs.Data` documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants