Académique Documents
Professionnel Documents
Culture Documents
Active Setup
Active setup is a process that runs automatically when a user logs in. Active Setup runs for
every user belong to that domain\server\machine.
If your application requires installation of files or registry keys on a per-user basis, but your
application has no advertised entry points or other triggers to initiate the installation
process, then Active Setup is the solution.
To implement Active Setup, you need to package all your user installation requirements into
an single installation or executable and point active setup to that executable and point this
executable to StubPath entry in active path registry location.
If the HKCU Active Setup registry entry exist or the version number of HKCU is equal to
HKLM, then the specified application is executed for the current user.
Ex
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed
Components\[ProductCode]]
"StubPath"="%Programdata%\Test\SelfExecute.exe"
"Version"="1,0"
Option Explicit
On Error Resume Next
Dim objShell,intVersion,strStubPath
Set objShell = CreateObject("WScript.Shell")
strStubPath = "msiexec /fou {Package-code} /qn"
objShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed
Components\{Package-code}_Install\StubPath", strStubPath , "REG_SZ"
intVersion = objShell.RegRead("HKLM\SOFTWARE\Microsoft\Active Setup\Installed
Components\{Package-code}_Install\Version")
intVersion = intVersion + 1
objShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed
Components\{Package-code}_Install\Version", intVersion , "REG_SZ"
Set objShell = Nothing
This will increment the HKLM active Setup version by one and when user logsin next time
Active setup will run again as HKCU Active Setup entry will have lesser version than HKLM.