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

Adding Information to the Registry??


4 replies to this topic

Superfreak3

Superfreak3
  • Full Members
  • 437 posts

Posted 21 April 2005 - 15:28

unsure.gif unsure.gif unsure.gif

I have a quick question regarding writing collected information (stored in public properties) to the registry. I'm just wondering which is the best place to put this information, HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, or doesn't it really matter? I really just want to know the optimum location for this information so that I can access it without trouble down the road like user rights getting in the way, etc..

Any info is GREATLY appreciated, as always!

Thanks!

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 21 April 2005 - 21:08

If the information applies to all users (and the user running the install has access permissions): HKEY_LOCAL_MACHINE
If the information is per-user: HKEY_CURRENT_USER

Superfreak3

Superfreak3
  • Full Members
  • 437 posts

Posted 22 April 2005 - 20:36

I know you can add registry keys easy enough through the IDE, but is there a way to also do it via VBScript? I've searched the net and tried RegWrite, but that method is not supported (at least that's what the system's application event viewer indicates following script error)?



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 25 April 2005 - 07:31

I bet there is a way in VBScript, but I'm not a VB(Script) expert, sorry.
I wonder why you want to do it in script?

Superfreak3

Superfreak3
  • Full Members
  • 437 posts

Posted 25 April 2005 - 13:55

Here's the reason I want to do this in script. We have a script that accepts a registration code. From that code we parse certain information, set public properties based on that information, and condition installation of some features based on those properties.

Let's say I wanted to write a Registry value of 1 if a Feature is installed. If the registration code warrants, the Feature and contained components are placed and the Registry entry is written as desired (the registry is tied to one of the contained components). Now if the feature is not placed, the Registry entry is not written, which is OK too.

If I need to, in the future, I can check for the existence of the above discussed Registry entry.

My problem comes in when the user may no longer pay for that feature/component, we don't remove if from the system. The condition for installation is placed on the Feature and not the component so I don't know how to re-evaluate the condition on the component so it would be removed along with its previously written Registry entry.

We did it this way because in the past, there was a problem with component conditions in the Win 9X world, so we just stuck to that method.

So if the user no longer uses the above described feature, the registry entry will still remain so I can't accurately determine if the user is still using it or not based on the existence of this Registry entry.

I was thinking I could just change the values of the Registry key via script based on our registration code values.

In a round-about way, that is why I was wondering about scripting the changes.