Salesforce

How to identify which HKCU key is used by current session?

« Go Back

Information

 
TitleHow to identify which HKCU key is used by current session?
URL Namehow-to-identify-which-hkcu-key-is-used-by-current-session
Article Number000181004
EnvironmentProduct: OpenEdge
Version: 11.3, 11.4, 11.5, 11.6, 11.7
OS: Windows
Question/Problem Description
How to identify which HKCU key is used by current session?
How to programmatically determine which section of HKEY_CURRENT_USER applies to the current executing process?

Each user has their own Windows Profile allowing them to have customizable HKEY_CURRENT_USER Registry settings, without disturbing the normal working of Progress for other users

In OpenEdge Release 11.3 Progress released the first 64 Bit GUI ABL client for Windows.  At that time only one Progress OpenEdge installation per Version could be installed on the same machine.  

In other words you could install 11.3 32 Bit OR 64 Bit on the machine, but not both.  This was primarily because two different installations could not inhabit the same Registry base.

In OpenEdge Release 11.5, Progress released functionality that allows 32 and 64 Bit clients to be installed on the same Windows machine.  This was accomplished by using different Registry keys to store information about each OpenEdge installation respectively.

For 32 Bit installations, the Progress installation is in the same structure it always inhabited.  

For example:
[HKEY_CURRENT_USER\Software\PSC\PROGRESS\<version-number>]

For 64 Bit installations, the Progress installation is located under an x64 node as follows:
[HKEY_CURRENT_USER\Software\PSC\PROGRESS\x64\<version-number>]

This Article provides sample code to automatically navigate to the appropriate basekey for the installation that the client is running from.
 
Steps to Reproduce
Clarifying Information
Error MessageThe LOAD of <key-value file> failed. (4450)
Defect Number
Enhancement Number
Cause
Resolution

The below code can be used to set the current registry key to get the installation directory.

DEFINE VARIABLE cBitness          AS CHARACTER NO-UNDO.
DEFINE VARIABLE cRegistryPath AS CHARACTER NO-UNDO.
DEFINE VARIABLE cVersion           AS CHARACTER NO-UNDO.
DEFINE VARIABLE cInstallDir        AS CHARACTER NO-UNDO.

ASSIGN cBitness = STRING(PROCESS-ARCHITECTURE)
                cVersion = STRING(PROVERSION)
                cRegistryPath = "SOFTWARE\PSC\PROGRESS\" + 
                                              (IF cBitness EQ "64" THEN "x64\" ELSE "") + 
                                              cVersion + "\".

LOAD cRegistryPath BASE-KEY "HKEY_CURRENT_USER".
USE cRegistryPath. 

RUN getInstallDir.p ( OUTPUT cInstallDir ).

MESSAGE cInstallDir VIEW-AS ALERT-BOX.
 
/* getInstallDir.p */

DEFINE OUTPUT PARAMETER pcInstallDir AS CHARACTER NO-UNDO.

GET-KEY-VALUE SECTION "Startup" KEY "DLC" VALUE pcInstallDir.

 
Workaround
Notes
Keyword Phrase
Last Modified Date11/20/2020 7:06 AM

Powered by