How to add HKCU registry entries or per-user files for all users?

ImportantThe following article uses options that are available starting with the Professional edition and project type.

This functionality can be achieved with advertised shortcuts. Here are the steps:

1. Add the files in the Files and Folders Page - Installer Project and the registry entries in the Registry Page - Installer Project

2. Go to Install Parameters and make sure that the "Installation Type" combo is set to "Per-machine if user is administrator, per-user otherwise"

3. In the Files and Folders Page create a shortcut to the main EXE of your application in the "Application Shortcut Folder" directory

4. In the Shortcut Properties View check the "Advertised shortcut" option

5. In the Organization Page make sure that all the components are under the same feature

Now, when a user (other than the one who installed the application) uses the shortcut, the feature which contains it will be installed for him (the registry entries will be created under HKEY_CURRENT_USER).