Registry

If you want certain registry keys to be created by the installation program, add them to the registry page.

In addition to adding literal string, dword and binary values, you can also dynamically store information about the installation. In particular, you can store paths to folders and file names so your application knows where it was installed. To do so, simply create a string value, and make the value start with one of the standard folder names that you can use on the Files page. To store the path to myprog.exe in the installation folder, fro example, create a string value of %APPFOLDER%\myprog.exe

The Registry page supports two additional folders that you cannot use on the Files page. These are %SETUPFOLDER% and %SETUPDRIVE%. You can use these values to store the folder and the drive that the setup.exe was on at the time of installation. You can use these registry values to pass the installation source to your application, such as to access additional files that are not part of the setup.exe, but are put on the same CD.

For every third-level and deeper registry key, you can specify that it must be completely deleted upon uninstallation. When your application is uninstalled, the key and all of its values and subkeys will be deleted, whether they were added by DeployMaster or not. An ever-increasing Windows registry can noticeably slow down the operating system, so your users will appreciate it if your software really cleans up after itself and also removes registry items.

The uninstaller will also remove the individual registry values that you have added on the Registry page, even if you did not activate the option to have the value's parent key deleted upon uninstallation. If you want to have the uninstaller remove specific values, you can add "dummy" values to the Registry page. These values will not be created or modified upon installation, but will be removed upon uninstallation.

You can create registry keys under HKEY_LOCAL_MACHINE if you turned off "install for current user" or if you turned on "require admin rights" on the Project page. HKEY_LOCAL_MACHINE cannot be written to without admin rights. You can create keys under HKEY_CURRENT_USER only if you turned off "install for all users" on the Project page as user-specific registry keys are not appropriate for all user installs.

If you turn on both "install for all users" and "install for current user" and you turn off "require admin rights" then you cannot place any keys under HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER per the above rules. In that case you can use HKEY_AUTO. This is not an actual registry key but a placeholder in DeployMaster. If the user chooses to install for all users, keys you put under HKEY_AUTO will be created under HKEY_LOCAL_MACHINE. If the user chooses a user-specific installation then those keys are created under HKEY_CURRENT_USER. When your application wants to read the value, it should first look under HKEY_CURRENT_USER. If the value doesn't exist there it should look under HKEY_LOCAL_MACHINE. You can use HKEY_AUTO even if you don't allow the user to choose between an all-users and a user-specific installation.

Keys you put under HKEY_CLASSES_ROOT are created under HKEY_CLASSES_ROOT during installations for all users. But those keys are put under HKEY_CURRENT_USER\Software\Classes during user-specific installations.

Keys you put under HKEY_USERS will be created under HKEY_CURRENT_USER during a user-specific installation. During an installation for all users, keys under HKEY_USERS are created for all users so that your application will see them when querying HKEY_CURRENT_USER regardless of the user account it's running under. Normally, it's better if your installer creates keys that all users need to see under HKEY_LOCAL_MACHINE. But if your application creates keys under HKEY_CURRENT_USER to store user-specific settings, then you can add those keys under HKEY_USERS to schedule them to be deleted upon uninstallation. If the application was installed for all users, then the uninstaller deletes keys under HKEY_USERS for all users. If it was installed for the current user only, then the uninstaller only cleans up keys you put under HKEY_USERS for the current user.

When checking whether your installer correctly created your registry values, you need to remember that HKEY_LOCAL_MACHINE\Software is segregated into 32-bit and 64-bit branches. Your installer will use the correct branch as long as you select the correct bitness on the Platform page. This comes into play when installing 32-bit software on 64-bit Windows. DeployMaster will write the values so that 32-bit software will see them under HKEY_LOCAL_MACHINE\Software. It's best to use a 32-bit test program if you need to verify registry values that need to be visible to a 32-bit application. But if you check with regedit.exe, which is a 64-bit application on 64-bit Windows, then it will not show the values under HKEY_LOCAL_MACHINE\Software because it is showing you the 64-bit branch. 64-bit RegEdit shows the 32-bit branch under HKEY_LOCAL_MACHINE\Software\Wow6432Node. Your application should never access that node directly.

DeployMaster will also create several other registry keys and values for its own purposes:

This information is used by DeployMaster to be able to update or uninstall your software. All these keys and values are, of course, automatically removed when your software is uninstalled.