cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kpalmer
Level 3

MigrateFeatureStates doesn't work

Hi...

I'm having a problem with this.

It doesn't seem to remember the features that were selected.

To re-create :-

- create an empty Installscript MSI project.
- create four features, each with a component and 1 file.
- build the install.
- run the install, select 2 of the features and complete the install.
- set a new product code, package code & version no
- create the major upgrade entry to upgrade from the same upgrade code
- check the MigrateFeatureStates feature was enabled for the upgrade
- build a new install
- 'upgrade' my first test install with the new install
- when choosing custom all the features are selected by default

Shouldn't this have remembered the features from the first install?

Regards,

Kevin Palmer
Orbis Software Ltd.
Labels (1)
0 Kudos
(4) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The InstallScript engine controls feature states in InstallScript MSI projects (by design). As such, any MSI feature selection typically will be overridden by what the InstallScript engine thinks should be selected. If MSI style feature selection is required, we would recommend using a Basic MSI project as it provides a simpler solution. If this is not possible, it would be necessary to write script code that determines which features were previously installed and then select or deselect features as needed with the FeatureSelectItem function.
0 Kudos
kpalmer
Level 3

Hi Josh,

Thanks for your reply.

I had a feeling that this was going to be the case. I had check the MSI log output which knew about the states but the UI was ignoring this.

Unfortunately i don't think we'll be able to use a Basic MSI project as we have written InstallScript code to customise the whole left hand splash image on the Welcome and Finish dialogs. Unless you know a way of changing this image at install time on a Basic MSI project?

I'm guessing there must be an MSI call i can make to read which features are installed (or are selected for migration). If you can point me in the right direction then that would help.

Regards,

Kevin Palmer
Orbis Software Ltd
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Changing dialog banners and images at runtime was recently discussed in the IS 2010 community (note this information applies to almost every version of IS that supports MSI):
http://community.acresso.com/showthread.php?t=188923

You can query Windows Installer for feature states if the feature name and product code that installed that feature are available. The MsiQueryFeatureState API will return a feature state given this information.
0 Kudos
kpalmer
Level 3

Thanks!!

That has given me some ideas to work on.

Your help was greatly appreciated.

Regards,
Kevin Palmer
Orbis Software.
0 Kudos