Posts Tagged ‘logon’

Active Setup is a useful tool to install per-user files and registry settings when you don’t have anything else on the computer to act as an entry point. How it works is fairly simple:

  1. Create a registry key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components – call it MyApp. It will be easier to distinguish if you use a name rather than a GUID.
  2. Create a string value called ComponentID, put in MyApp
  3. Create a string value called StubPath, put in the command you want to run. Some examples could be msiexec…, cscript…, setup.exe, myapp.exe etc.
  4. Create a string value called Version, put in 1

Now, every time a user logs in to that computer, Windows will check if HKEY_CURRENT_USER\SOFTWARE\Microsoft\Active Setup\Installed Components\MyApp exists.

If it doesn’t exist, it will execute the command in StubPath under the user’s context, then create HKEY_CURRENT_USER\SOFTWARE\Microsoft\Active Setup\Installed Components\MyApp. If it does exist, it will check the version and if equal or greater will do nothing.

This doco from Ed Tippelt contains a bit more detail. With any luck, I’ll put together a vbscript to illustrate this further. [EDIT] Here’s the script:

Set objShell = WScript.CreateObject(”WScript.Shell”)
appName = “MyApp”
ActiveSetupSource = “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\” & appName & “\”
objShell.RegWrite  ActiveSetupSource & “(Default)” , appName & ” Install”
objShell.RegWrite  ActiveSetupSource & “ComponentID” , appName
objShell.RegWrite  ActiveSetupSource & “StubPath” , “msiexec c:\Data\myapp.msi”
objShell.RegWrite  ActiveSetupSource & “Version” , “1″


Read Full Post »