mmadden
Posts: 22
Joined: Fri Jun 10, 2005 6:21 pm
Location: West Conshohocken, PA

Custom Install-Multiple registry Choices?

Not sure if this is possible:
I have two sets of registry entries-Lets say that I want on set for a development environment and the other for a production environment (or something like that).

I set up all the files and organize the features to properly install depending on Typical/Custom settings so that at install time the user can choose a custom install depending on which environment they are installing to.

I created two new features in the organization section (DevRegistry and ProdRegistry) for the registry entries so that I can have the user choose one of them via the Custom install option at install time (of course only one of them is part of the typical install). I import the first registry entries and make sure they are part of the "DevRegistry" feature. Then make the necessary changes to my Windows registry and I set the Current feature to "ProdRegistry" but I can't import the same reg keys (with different data) again. It just keeps the previously imported keys.

Should I be approaching this task in a different way, or am I missing something with this approach.

Thanks :?
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

This kind of organization of the install package has a problem: what happens if the user decides to install both features?
It would be better if the application would decide at run-time between two sets of registry values that had been installed.

However, if you want to use this approach, you cannot install the same key in two component even with two different values. But you can share the key component between two features and then modify it's value during install.

So in order to do that, you have to use a property as the value for a key, say KEYVALUE1. You create this property in the "Install Parameters" section. Modify the value of the key to this property.

This property has a "default" value, corresponding to the feature included in the "Typical" installation.
Then you use a custom action to change the value of that property for the case the other feature is being installed.

To do this, here is what you should do:
- create a custom action in a section before "WriteRegistryValues" e.g "WriteMIMEInfo".
- create a "Property Set With Formated" custom action with the "KEYVALUE1" as "Property Name", and set the new value, say "Value 2". The condition to see if a feature is being installed is
(&Feature=3) AND (!Feature=2)

Note: The names you give to features are just like labels. The actual names used to designate the features are: "MainFeature", "Feature" - for the first one you create, "Feature_1" for the second, and so on.
Even if you delete one of the feature created, the order of naming
continues in the same manner.
If you are not sure of the name of some feature, open the AIP file with any text editor and search for the name that you gave the feature. On the same row, see the value for "Feature=...".

Hope this helps,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”