Category Archives: how to add active setup in msi

What is Active Setup

Active setup is a process that runs automatically when a user logs in.
Registry keys at 
HKLM\Software\Microsoft\Active Setup\Installed Components\%APPNAME% 
HKCU\Software\Microsoft\Active Setup\Installed Components\%APPNAME% 
are compared, and if the HKCU registry entries don't exist, or the version number of HKCU is less than HKLM, then the specified application is executed for the current user. 
If your application requires installation of components such as 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, 
populate the following registry key with two ( REG_SZ ) values: 
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\%APPNAME% - where %APPNAME% is an arbitrary string which can be the application name, or its product code GUID if using an MSI. (As long as it is unique on that workstation!)
VALUE1: StubPath=<full local path>\YourActiveSetup.exe 
VALUE2: Version=1 
When each new user logs on, the operating system compares Active Setup keys between HKLM and HKCU, and runs the nominated executable if the HKCU entry is missing or the version in HKCU is less than HKLM.  So if you ever need to update the ActiveSetup executable, just install
a new version, and increment the Version registry key (VALUE2 above) in HKLM. Next time the user logs on, the active setup will run again for that user. 
To force a repair using the existing MSI where a separate Active Setup EXE is not required, you can do it this way: 
Create the following key structure under HKEY_LOCAL_MACHINE hive:
Under this registry key, create a <new string value> such as:
"StubPath"="msiexec /fous {ProductCode} /qb"