cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Repair User-Specific Data for Applications without Shortcuts or Executables

How to Repair User-Specific Data for Applications without Shortcuts or Executables

Summary

This article will cover how to use Windows Active Setup feature to repair user settings

Synopsis

This article will cover how to use Windows Active Setup feature to repair user settings

Discussion

The Windows Installer service will install the user-specific data only for the profile of the account under which the application is being installed. So, if another user logs into the machine, that user data is unavailable to the new user.

It is typically recommended to use advertised shortcuts as an entry point to trigger the repair. A Windows Installer advertised shortcut causes Windows to verify that all of the application's component key paths are in place before launching the application. If a key path is missing, Windows Installer will try to repair the application before launching the program. This method works well for repairing user-specific data if the application has shortcuts, but this will not always be the case. For these cases, Windows offers the Active Setup feature through some registry keys. There are two registry keys that Windows uses to decide whether an application is installed for a user as they are logging into Windows. The concept here is that you will create a per-machine registry key in HKEY_LOCAL_MACHINE and then compare that key with a similar key in HKEY_CURRENT_USER. If the version information in the keys is different, then Windows runs a command specified in the HKEY_LOCAL_MACHINE key and updates the version data so that the command does not run again.


To set this up with your install you will need to add some registry data into your InstallShield project. The installer will need to write to the following registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\[ProductCode]


With the following value:

"@"=[ProductName]
"StubPath"="msiexec.exe /fou [ProductCode] /qb"
"Version"="1,0,0"

Once these are added in InstallShield it should look something like:
User-added image

Once this is setup when the end user logs into the computer Active Setup will compare the registry data in HKLM with the corresponding key in HKCU, and if he version in HKCU is less than the one in HKLM or the HKCU key does not exist, Windows will copy some of the values from the HKLM key to the HKCU key and then execute the command in the "StubPath" value.

At some point the original user that did the initial install will need to log off and log back onto the computer. In this case the Active Setup may run a repair under this user even though it is not necessary. To get around this you will want to also add a registry key and value under the HKCU hive. This would be in the following key:

HKEY_CURRENT_USER\Software\Microsoft\Active Setup\Installed Components\[ProductCode]


With the following value:

"Version"="1,0,0"



Once this is added in InstallShield it should look something like:
User-added image
Once this is done the user that did the first time install should be able to log off and back on without triggering the repair. Any other user should see the Windows Installer repair dialog once they login, and Windows has determined that the Active Setup should be run.

The last thing to note will be to ensure that the Windows Installer will be able to locate the source media to complete the repair. If Windows Installer needs the source media, but cannot find it, the end user will be prompted to browse to the source media. To get around this you can place the source media where you would like, for example on a network share, and then specify this location in the SOURCELIST property in your installer. If you do not have network access in your environment you can copy the source to a common accessible location on the machine, for example a location like:

[CommonAppDataFolder]\[Manufacturer]\[ProductName]


Which should resolve to something like:

C:\ProgramData\MyCompany\Active Setup Sample

Related Documents

SOURCELIST property

Registry View

Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jul 19, 2018 04:39 PM
Updated by: