Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Registry Question....


1 reply to this topic

posty

posty
  • Members
  • 58 posts

Posted 12 March 2002 - 15:12

I have three installs that will be writing registry information to the same location because there is no particular order that they can be installed...

One install adds...

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Company\Product]
@="Company Product"
"InstallDir"="[PREVINSTALLDIR]\\"
"BinDir"="[PREVINSTALLDIR]\\bin\\"
"IconDir"="[PREVINSTALLDIR]\\icon\\"
"Version"="8.0"
"Product"="Company Product"
"FirstProductVersion" = "8.0"

The second install adds...

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Company\Product]
@="Company Product"
"InstallDir"="[PREVINSTALLDIR]\\"
"BinDir"="[PREVINSTALLDIR]\\bin\\"
"IconDir"="[PREVINSTALLDIR]\\icon\\"
"Version"="8.0"
"Product"="Company Product"
"SecondProductVersion" = "8.0"

Finally, the third install adds...

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Company\Product]
@="Company Product"
"InstallDir"="[PREVINSTALLDIR]\\"
"BinDir"="[PREVINSTALLDIR]\\bin\\"
"IconDir"="[PREVINSTALLDIR]\\icon\\"
"Version"="8.0"
"Product"="Company Product"
"ThirdProductVersion" = "8.0"

--

Now the reason that there is a separate version number for each install is that they maybe be at different version than the main version release of the entire product (Version).

Now, if I install product number 1 and then product number 3 (it really doesn't matter what the order is), number 1 will add everything and number 3 only adds "ThirdProductVersion".  However, if I uninstall number 3, the only thing that remains in the registry is "FirstProductVersion" from the first install.

How can I set this up in the "Configure the Target System >> Registry" section so that this uninstall of registry information will not happen or is the only way that this can be solved is to make separate directories, like...

[HKEY_LOCAL_MACHINE\SOFTWARE\Company\Product\FirstProductVersion]
@="Company Product"

[HKEY_LOCAL_MACHINE\SOFTWARE\Company\Product\SecondProductVersion]
@="Company Product"

[HKEY_LOCAL_MACHINE\SOFTWARE\Company\Product\ThirdProductVersion]
@="Company Product"

Thanks.

KiwiGeek

KiwiGeek
  • Members
  • 19 posts

Posted 12 March 2002 - 23:22

The easiest way to fix this is to use a new component just to add these registry values. Create the component in all 3 installs, making sure that all 3 copies are identical (especially the component code - this is crucial!;).
Using this method, the entries will be installed when the first one of those packages is installed, and removed only when the last is removed.

--------------------------------------------------------------------------

Technical explanation:

Whenever a component is installed, it keeps a reference to which package installed it. If more than one package installs the same component (with the same component code), it will have multiple entries for which package uses it.
When a package is removed, its reference is removed from the components it contains. If the component contains no more references, the component itself is removed.
By creating such a component for the registry entries and sharing the component across your installation packages, you can prevent files and/or registry settings from being removed until the last package is uninstalled.
Jamie
The geek shall inherit the earth