How to get registry value in Inno Setup when value uses only default name?

I am trying to get the application installation directory from the Windows registry (in this case Google Sketchup) using Inno Setup Pascal scripts, so I can install the plugin there.

The registry key does not have a name, it just has "(default)" in Regedit.

I tried this:

RegQueryStringValue( HKLM, 'SOFTWARE\Google\Google Sketchup 6', '(Default)', pluginLoc ); 

but it does not return a value. Any suggestions?

+7
windows pascal registry inno-setup
source share
1 answer

Just leave SubKeyName empty, for example:

 [Code] function InitializeSetup(): Boolean; var V: string; begin if RegQueryStringValue(HKLM, 'SOFTWARE\Google\Google Sketchup 6', '', V) then MsgBox('Value is "' + V + '"', mbInformation, MB_OK); Result := TRUE; end; 

Relevant documentation for calling the API for RegQueryValueEx () , which states:

The name of the registry value.

If lpValueName is NULL or the empty string, "", the function retrieves the type and data for the value without a name or by default, if any.

+14
source share

All Articles