Working with Registry Functions

InstallShield 2019

Project • For InstallScript MSI and Basic MSI projects, it is recommended that you use the Registry view in InstallShield instead of creating registry keys and values through InstallScript code. Handling all of your registry changes in this way allows for a clean uninstallation through the Windows Installer service.

The InstallScript language includes many built-in functions that help you configure an installation so that it accesses the registry; reads, creates, and deletes registry keys; and establishes registry-related parameters for uninstallation.

For example, you can sometimes determine if an application is present on the target system by detecting registry keys used by the application. Many applications store data in the registry key HKLM\SOFTWARE\CompanyName\ProductName\ProductVersion. To detect if a registry key exists, you can call the RegDBKeyExist function in your InstallScript code as follows:

// always set root key before calling other RegDB functions

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

 

if (RegDBKeyExist("Software\\ThisCo\\ThisApp") = 1) then

   MessageBox("ThisApp is on the system.", INFORMATION);

endif;

To learn more about the built-in registry functions available with InstallScript, see the following:

Registry Functions
Special Registry-Related Functions

See Also