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

Creating registry entries when a new user logs on


6 replies to this topic

thomaz

thomaz
  • Members
  • 15 posts

Posted 12 February 2002 - 18:57

Some of you might have noticed that when a new user logs onto a computer for the first time, it runs couple of things once. As a result it generates couple of user specific registry entries and other settings. I have seen IE, Netscape and Real Networks do this. How do you instruct the computer to run this at the first logon of a user on a computer.

aglenwright

aglenwright
  • Members
  • 53 posts

Posted 13 February 2002 - 00:03

Found this in MSDN:

RunOnce
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\

Description
The RunOnce subkey of HKEY_LOCAL_MACHINE\SOFTWARE stores the names of programs that Windows 2000 runs at startup, for all users of the computer, the next time the system starts. When these programs are run, their names are deleted from the RunOnce subkey so that they are not run again automatically.



thomaz

thomaz
  • Members
  • 15 posts

Posted 13 February 2002 - 00:23

Thanks for the reply. Probably, I didn't make it clear. The requirement is to be able to run a configuration utility for each user who logs onto the computer after an application installation. Also, I want to run it just once per user. That user might or might not have logged onto this computer before the application installation.

If I create it under HKLM...RunOnce, it will run the program only for the first user who logs on.


aglenwright

aglenwright
  • Members
  • 53 posts

Posted 13 February 2002 - 00:27

The reason I posted it, is because it says "for all users of the computer", which indicates to me that the program would run once for each user (what you asked for).  But, based on your results, I guess this is one of those wonderful bits of documentation that means something different depending on how you read it...

I guess whoever wrote the documentation at M$ doesn't speak english very well - probably only understands american :-)


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 13 February 2002 - 11:38

If you create a component with a key in HKCU the installer will be invoked if a feature that includes that component is referenced.  You get a repair of all the components in the Feature including the HKCU one.

In my own products I keep my user specific components in a Feature of their own.  Then my main app  (actually I have an always present systray app) which calls MsiLocateComponent to check the presence of the HKCU component then I call MsiProvideComponent if it is not.  Which will invoke the installer to complete the user installation with the minimum of installer activity.


aglenwright

aglenwright
  • Members
  • 53 posts

Posted 13 February 2002 - 12:13

I expect that would work, but I *do* remember seeing something about a registry setting that would do the same...  unfortuneately I can't remember the path...

thomaz

thomaz
  • Members
  • 15 posts

Posted 19 February 2002 - 23:43

I found sort of a solution. It is based on MS KB articles Q199190 and Q168877. Thank you all for your valuable time