Salesforce

How to read the progress.cfg file in ABL?

« Go Back

Information

 
TitleHow to read the progress.cfg file in ABL?
URL NameP131879
Article Number000160633
EnvironmentProduct: Progress
Version: 9.x
Product: OpenEdge
Version: All Supported Versions
OS: All Supported Platforms
Other: Licensing, showcfg
Question/Problem Description
How to read the progress license configuration file progress.cfg programmatically using ABL?

How to check installed products at runtime?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
OpenEdge doesn't have any ABL functionality to read the progress.cfg file directly.  
Resolution
The progress.cfg file can be read by using the showcfgd executable.  The following ABL code example executes the showcfgd executable to read the progress.cfg file in the installation directory. 

On Windows platforms it may be necessary to start the session with Administrator privileges in order for the 'showcfgd.exe' to run correctly.  
DEFINE VARIABLE cDLC  AS CHARACTER.
DEFINE VARIABLE cExec AS CHARACTER.
DEFINE VARIABLE cTmp  AS CHARACTER.
DEFINE VARIABLE cFile AS CHARACTER NO-UNDO.

IF OPSYS = "UNIX" THEN cDLC = OS-GETENV( "DLC" ).
ELSE
    GET-KEY-VALUE SECTION "STARTUP" KEY "DLC" VALUE cDLC.

FILE-INFO:FILE-NAME = cDLC.

IF FILE-INFO:FULL-PATHNAME = ? THEN
DO:
    MESSAGE "Unable to find DLC" VIEW-AS ALERT-BOX.
END.

/* if the PROCFG Environment Variable is used, add logic here */

IF OPSYS = "UNIX" THEN
    cExec = cDLC + "/bin/showcfg " + cDLC + "/progress.cfg".
ELSE
DO:
    cExec = cDLC + "\bin\showcfgd.exe " + cDLC + "/progress.cfg > out.txt".
END.

INPUT THROUGH VALUE( cExec ).
    
IF OPSYS NE "UNIX" THEN
DO:
    /* A delay may be needed to allow showcfgd.exe to create 'out.txt' before the client tries to read it */
    PAUSE 3 NO-MESSAGE.
    cFile = SEARCH("out.txt").
    INPUT FROM value(cFile).
END.

REPEAT:
    IMPORT UNFORMATTED cFile.
    DISPLAY cFile FORMAT "x(60)".
END.

INPUT CLOSE.

For the extra information described in article How to print more detail on installed OpenEdge license bits add -B after \bin\showcfgd.exe in the above code as follows:
cExec = cDLC + "\bin\showcfgd.exe -B" + cDLC + "/progress.cfg > out.txt".
Workaround
Notes
Keyword Phrase
Last Modified Date3/9/2021 2:09 PM

Powered by