Summary
You should declare szKey as a STRING variable and use the concatenate (+) operator and double backslash (\\) to add subkeys, as shown in the example script below.Synopsis
This article discusses the correct format for the szKey value in the InstallShield registry-related functions.
Applicable to Project Types:
Basic MSI
InstallScript
InstallScript MSI
Discussion
You should declare szKey as a STRING variable and use the concatenate (+) operator and double backslash (\\) to add subkeys, as shown in the example script below.
Do not use the append to path (^) operator, as this turns szKey into a valid path with a ".\" in front of it. This format will not create the key on certain operating systems.
Do not use a "\\" at the beginning of szKey. This format will not create the key on certain operating systems.
The following example script places a "Test Value" under the registry key HKEY_CLASSES_ROOT\TestKey\Company.
/////////////// Begin script sample
#define COMPANY_NAME "Company";
function SetRegKey()
STRING szBaseKey, szKey, szValue;
begin
// Set the root key.
RegDBSetDefaultRoot (HKEY_CLASSES_ROOT);
// Set the values for creating the test key.
szBaseKey = "TestKey";
szKey = szBaseKey + "\\" + COMPANY_NAME;
szValue = "TestValue";
// Set the key name and a value associated with it.
if (RegDBSetKeyValueEx (szKey, "", REGDB_STRING, szValue, -1) < 0) then
MessageBox ("Failed to set key and value.",WARNING);
exit;
else
// Check for the existence of the key just created.
if (RegDBKeyExist (szKey) < 0) then
MessageBox ("`TestKey` key does not exist.", WARNING);
exit;
else
SprintfBox (INFORMATION, "Status", "Created key: %s", szKey);
endif;
endif;
end;Related Articles
Manually upgrading a beacon with the full installer UI removes registry keys containing replication configuration settings 4Number of Views Beacon registry keys changing after a self upgrade 6Number of Views NT User Permissions for Installed Directories, Files, and Registry Keys 4Number of Views Custom registry keys for Snow Windows Inventory Agents 144Number of Views ActiveSetup Registry Key 3Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago