MSI Factory 2.3

Registry.SetValue

Registry.SetValue

This is the first topic This is the last topic  

Registry.SetValue

This is the first topic This is the last topic  

OverviewExamples

Registry.SetValue (

number MainKey,

string SubKey,

string Value,

string Data,

number Type = REG_SZ )

Example 1

Registry.SetValue (HKEY_LOCAL_MACHINE, "Software\\My Application", "InstallPath", Shell.GetFolder(SHF_PROGRAMFILES) .. "\\My Application", 1);

Sets the "InstallPath" value's data to the "My Application" folder's path located in the user's Program Files directory (normally C:\ProgramFiles\My Application). The value is located in "HKEY_LOCAL_MACHINE\Software\My Application" and will have a value of REG_SZ.

Example 2

-- Set the data "Saved Value" in the user's Registry.

Registry.SetValue(HKEY_CURRENT_USER, "Software\\My Application", "MyValue", "Saved Value", REG_SZ);

 

-- Read the previously written value.

registry_value = Registry.GetValue(HKEY_CURRENT_USER, "Software\\My Application", "MyValue", true);

 

-- Display the value read from the Registry in a dialog.

Dialog.Message("Registry Data", "The value read from the Registry is "..registry_value..".");

Sets the "MyValue" value's data to the string "Saved Value". The value is located in "HKEY_CURRENT_USER\Software\My Application" and will have a value of REG_SZ. That value is then read back and displayed in a dialog.

See also: Related Actions


Learn More: Indigo Rose Software - MSI Factory - Buy Now - Contact Us