How To upgrade without losing feature settings - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

deand
Posts: 8
Joined: Wed Nov 29, 2006 6:24 am

How To upgrade without losing feature settings

Could someone point me in the direction of some documentation that explains how to configure Advanced Installer to retain the current feature settings during an upgrade.

This would be a version upgrade from 1.0.1 to 1.0.2.

Thanks.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
Could someone point me in the direction of some documentation that explains how to configure Advanced Installer to retain the current feature settings during an upgrade.
Please see:
http://www.advancedinstaller.com/user-g ... ional.html
http://www.advancedinstaller.com/user-g ... rsion.html

To create an upgrade use "File->Save As" option, make sure you have "Automatically upgrade older versions of the product" option set in the "Installer Parameters" page. After you "Save As" the project increase the "Product Version" and answer yes when AI ask you to generate a new "Product Code".

If you want to create a patch please see (for a patch answer no when AI ask to generate a new "Product Code"):
http://www.advancedinstaller.com/user-g ... patch.html

If you encounter any problems please let me know.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
deand
Posts: 8
Joined: Wed Nov 29, 2006 6:24 am

Thank you for your quick response Gheorghe.

Here's a more detailed explanation of the problem ...

When the customer installs version 1.0.1 they can choose to install feature 1, but not feature 2. On other PC's they may choose to install feature 2 but not feature 1.

At some point in the future I send the customer an upgrade to 1.0.2. When they run the upgrade it loses the feature settings that the customer chose when they originally installed.

This means that the customer must remember exactly which features were required on which machines when they upgrade. As a result, the customer will choose not to upgrade, which is what I want to avoid.

So, back to my original question, How do I ensure that the features chosen during the initial install are automatically selected (or not selected) during an upgrade?

Your assistance is much appreciated.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

By default on upgrade ("Product Code" changed) the old package is uninstalled completely before installing the new one.
So, back to my original question, How do I ensure that the features chosen during the initial install are automatically selected (or not selected) during an upgrade?
This can be done with patches. A patch is the difference between two msi packages and when you apply it the target msi need to be installed.

To read more about patches please see:
http://www.advancedinstaller.com/user-g ... oject.html

Note that you need to respect all the patch creation rules from the following link:
http://www.advancedinstaller.com/user-g ... tches.html

For a tutorial on how to create patches please see:
http://www.advancedinstaller.com/user-g ... patch.html

Please let me know if you encounter any problem.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
deand
Posts: 8
Joined: Wed Nov 29, 2006 6:24 am

The Microsoft MSDN documentation regarding the MSI SDK is very clear when it says ...

"To ensure differentiation of versions of the current product in the future, a minor upgrade should be used instead of a small update."

http://msdn.microsoft.com/library/defau ... grades.asp

A small update is the MSDN term for a patch.
This means that for my purposes, a patch does not perform the required function.

The MSDN documentation provides a Version Upgrade example, in which they begin by importing the Original Installation Database.

http://msdn.microsoft.com/library/defau ... xample.asp

Does Advanced Installer import the original installation database during an upgrade, and if it does, what settings are required to pre-configure the feature selections using the content of the original installation database ?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Patch packages are of three types:

1. Small Update when "ProductCode" and "ProductVersion" are not changed.
2. Minor Upgrade when "ProductCode" is not changed and "ProductVersion" is changed.
3. Major Upgrades when "ProductCode" and "ProductVersion" are both changed (those type of patches are not recommended).

To achieve what you want create a minor upgrade. Open your project and use "File->Save As" option. In the saved project increase the "Product Version" and choose no when AI ask to generate a new "Product Code". Build the project.

With the old and new version of your package create a patch.

Also note that you need to respect all the patch creation rules from the following link:
http://www.advancedinstaller.com/user-g ... tches.html

On how to create a patch please see:
http://www.advancedinstaller.com/user-g ... patch.html

Best Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
deand
Posts: 8
Joined: Wed Nov 29, 2006 6:24 am

Thanks anyway Gheorghe, but the 'patch' interface is not what I want to present to my customer.
I want them to have the complete interface, which allows them to see their current feature configuration, and to alter it if they wish.

What does the MigrateFeatureStates standard action in the Custom Actions page do?

If I were to create a "Property Set with Formatted" custom action, what would I type to read the state of the "Communication" feature into a custom property named MyProperty?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
I want them to have the complete interface, which allows them to see their current feature configuration, and to alter it if they wish.
I'm not sure if this can be done. Maybe with a custom action but this is not a easy task and need to know C++ coding.

Also I don't understand for what you need that because on upgrade ("ProductCode" changed) the old package is uninstalled completely before new one gets installed.
which allows them to see their current feature configuration
This is usually done on maintenances when user click on the modify button.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
deand
Posts: 8
Joined: Wed Nov 29, 2006 6:24 am

Also I don't understand for what you need that because on upgrade ("ProductCode" changed) the old package is uninstalled completely before new one gets installed.
It's a fair comment Gigi. The problem I have is that my customers are very stupid. They can't remember what the features were when the upgrade started.

I'm under a lot of pressure to streamline this process and ensure that feature settings are maintained across the upgrade cycle. :(

I have developed a solution however. What I'm doing is creating a registry value for each feature setting. I then use the search registry function to set a cutom property with the value of the registry entry. I then use a condition to lower the Install Level of the feature if the custom property has the required value.

This is working fine. I'm now stuck trying to create/edit the registry values during the Commit phase. (for testing I simply created the registry entries with regedit).

What I'm trying to do is use a Custom Action to generate the registry entries based on the feature selections. I'm using a VBScript Custom Action, but I can't figure out how to read the feature states from the database using VBScript.

Any help you could offer would be appreciated.

Dean.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Dean,
What I'm trying to do is use a Custom Action to generate the registry entries based on the feature selections. I'm using a VBScript Custom Action, but I can't figure out how to read the feature states from the database using VBScript.
To read a feature state in a VBS custom action you can use this code:

Code: Select all

Session.Property("MY_PROP") = cstr(Session.FeatureRequestState("MainFeature"))
The feature state will stored in the MY_PROP property. Schedule the custom action that reads the features states under "InstallExecuteSequence->CostFinalize", this is executed before registry gets written. Now in the "Registry" view create a registry value with [MY_PROP] as its data.

Hope this helps.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
deand
Posts: 8
Joined: Wed Nov 29, 2006 6:24 am

Thanks Gigi, works a treat.

Dean.

Return to “Common Problems”