PDA

View Full Version : Registry always installed regardless of feature selection



cms_noe
09-08-2005, 05:45 AM
I suspect this is a bug in IS. I took me a while to pin point the problem and I'll try to explain it in detail.
I have a Basic MSI project with multiple features and subfeatures. Some of the subfeatures will create registry keys when installed. For example, let's say the design looks like this:
Feature1

SubFeature1
SubFeature2
Feature2

SubFeature1 should create this registry: [HKEY_LOCAL_MACHINE]\SOFTWARE\[Manufacturer]\[ProductName]
"Value"="some text"
SubFeature2 should create this registry:
[HKEY_CURRENT_USER]\SOFTWARE\[Manufacturer]\[ProductName]
"Value"="some value"

The problem is these registry settings are installed event if the corresponding subfeatures are not selected in the Custom install dialog. Other components associated with the subfeatures (files, etc) are not installed if the subfeatures are not selected, but the registry keys are always created.
After having spent quite some time debugging this and recreating the project, I discovered that the problem was a System Search setting in the project. Basically, I need to check is MS SQL Server is installed on the system and thus I have a system search for [HKEY_LOCAL_MACHINE]\Software\Microsoft\Microsoft SQL Server\ InstalledInstances.
For some bizarre reason, If I add this system search, all the registry keys in my project are installed regardless of what features or subfeatures the user selects.
I do have another system search to check if Win OS is server or workstation checking [HKEY_LOCAL_MACHINE]\SYSTEM\CurrentControlSet\Control\ProductOptions ProductType, but this does not seem to create any problems.

I hope I made myself clear.

Has anyone seen anything like this before? Are there any workarounds? Is this a bug in IS?

Any input/help much appreciated.

cms

cms_noe
09-13-2005, 04:34 AM
Anyone any help or comments on this? Is anyone from InstallShield (Macrovision) reading messages on this forum or should I try posting the message somewhere else?

Thanks

SGorman
09-13-2005, 08:32 AM
If you can reproduce this in a 'simple' install that has nothing but the system search and the reg keys/features then that would prove it is a bug and you should report it to Support.

MichaelU
09-13-2005, 11:02 AM
Given that MSI works via Features and Components, and of those only components can install registry information, the specification of the problem is lacking. If I were debugging this I would both look for overloaded properties - perhaps the system search is setting a property that changes the install state of a feature containing the component in question - and use a verbose MSI log to help pinpoint this.

Of course there's also other various mishaps that could impact this, like marking the registry component as permanent, and only testing the case that doesn't install after having tested a case that does.

cms_noe
09-14-2005, 04:52 AM
I can reproduce the problem in a very simple MSI project.
Create new Basic MSI project and follow these steps:
- add two features, say NewFeature1 and NewFeature2
- add a component to NewFeature1 called reg1 and the following registry data
Key: [HKEY_LOCAL_MACHINE]\SOFTWARE\[Manufacturer]\[ProductName]
string value: value1=\\[ComputerName]\Myapp\
- add a component to NewFeature2 called reg2 and the following registry data
Key: [HKEY_CURRENT_USER]\SOFTWARE\[Manufacturer]\[ProductName]
string value: value2=[INSTALLDIR]
- add a system search for a Registry entry to search for InstalledInstances value in the [HKEY_LOCAL_MACHINE]\Software\Microsoft\Microsoft SQL Server key and store the value in a property called SQLINST.

Now build the project and install. Select setup type as custom and in the custom setup dialog unselect both NewFeature1 and NewFeature2 (This feature will not be available), so in effect no features in this project should be installed.
But, to my surprise, both reg1 and reg2 registry data are installed.

The system search just happens to search for a key specific to MS SQL Server, but I think the problem here is searching for a key or value in [HKEY_LOCAL_MACHINE]\Software.
I'm saying this because if I remove the above system search and add a system search for [HKEY_LOCAL_MACHINE]\SYSTEM\CurrentControlSet\Control\ProductOptions value ProductType and again save this in a property called, say, WINSERVER, this does not cause the reg1 and reg2 components to be installed if the features are not selected in the custom setup.

As a note, none of the components in my project are set to permanent. If the [HKEY_LOCAL_MACHINE]\Software system search changes the state of any features of components, that is a problem in my opinion.
Also, the value of the system search is just saved in a property, but I haven't actually used the property in this simple project.

BTW, is it ok to use http://www.installshield.com/feedback/ to report bugs?

Thank you very much for any input.

cms