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

Prevent a removal of a reg key


8 replies to this topic

TAL

TAL
  • Members
  • 77 posts

Posted 06 January 2002 - 18:25

Hi, if anyone can help, I'll be thankful!!!
we have 2 different products, they both creates in the registry key under HKLM\SOFTWARE\XXX
one product creates a key under XXX, and sub keys under XXX, and the other one does that as well, only with different sub keys.
so it looks like that -
HKLM\SOFTWARE\XXX
HKLM\SOFTWARE\XXX\SUB_KEY OF PRODUCT A
HKLM\SOFTWARE\XXX\BUB_KEY OF PRODUCT B

problem is that when I remove one product it removes all reg entries of the other product as well!!!.
i do not have any shared components. i use different GUID for each component, and different package code, etc. the 2 products share nothing except for the reg key.
why is it removing the reg keys?, how can the product remove sub keys that was not created by it?, how can I prevent this from happening, please help me, I need to solve this ASAP, and suggestion???????


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 06 January 2002 - 23:52

Create a new component.  This component will contain the registry key
HKLM\SOFTWARE\XXX
Ceate a value and set this as the key 'file' for the component.
add this component with the same guid to both products.

(Edited by Ian Blake at 10:55 pm on Jan. 6, 2002)


TAL

TAL
  • Members
  • 77 posts

Posted 07 January 2002 - 12:36

Thanks.
i tried that, but still, the reg key is being removed even when i uninstall just one product out of 2.
why?

Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 07 January 2002 - 14:54

Take a look at the registry table with ORCA and logfiles to see what is happening.  This is not normal behaviour.

How are you creating your registry keys?


TAL

TAL
  • Members
  • 77 posts

Posted 07 January 2002 - 15:18

I am creating the reg key using ORCA, I am using the Registry table.
all the keys are located under HKLM\SOFTWARE\XXX
I added a component,with the same GUID for both products. and gave the attributes value of "4". let's say, for example the component name is "test". so as a keypath (in the component table) I wrote a value "dummy", in the reg table i entered the following:
reg - dummy
root-2
key- SOFTWARE\XXX
name- +
value - (i left it blank)
component - dummy

now, I have a question, since both products are completely different, I can not use the same Directory_ entry in the component table, will that make a difference?.
I used the log file to trace the installation. I saw that when installing it adds the dummy value, with the RegAddValue action. in the log of the uninstall it does not show the dummy value's removal.
???



TAL

TAL
  • Members
  • 77 posts

Posted 07 January 2002 - 15:44

Sorry, one more question - how can the component "know" that it's being used by another product?.
how does it work?.

Thanks for your help.


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 07 January 2002 - 17:19

When a component is installed a key is created in the registry (a rearranged version of the component guid) under the components key. The precise location of this varies from OS to OS. On all systems they are recorded under HKLM\Software\Microsoft\Windows\CurrentVersion\Installer.  The most complex location is ...\UserData\<Sid>\Components.
Under the entry for each component is one or more keys with names that correspond to products under the products key.  An entry is created under a particular component key for each.product installed using that component

When there are multiple products no files or registry entries are removed when a product is uninstalled.  The entry corresponding to the product is removed from the components entry of the component.

I will try to reply to your main question later.


TAL

TAL
  • Members
  • 77 posts

Posted 07 January 2002 - 17:48

Thank you for your time, it is really helping me.

i took a look at the registry, and like you said, the two proucts were listed inder same component GUID, but after i removed one product, it removed the product from the component GUID, AND FROM THE HKLM\SOFTWARE\XXX

i am probably doing something worng, i don't know what.


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 08 January 2002 - 00:04

On reflection my comment about using a component is most useful for removal of the registry tree when all your products are removed.

I noticed that you use '+' name.  I think '*' would be more useful.  Also I am sure you know that -+* names can not be used as key values for a component.

I think your basic problem is the creation of the values directly under HKLM\SOFTWARE\XXX.   Make sure you use '+' here.  In theory msi should not remove a key while there are subkeys or other values, ecept when * or - are specified.  If component A and component B both create a key under XXX if either have a * or - entry then they would cause the removal of XXX.

I admit I am a little puzzled to why you are having this problem.