Skip to main content

Problem

How to deploy native applications built with Visual COBOL 2.3 to 6.0 on the network?

Solution

The following instructions are based on aĀ 64-bit Windows environment where:

  • the 32-bit software is installed in C:\\Program Files (x86)
  • Windows keeps the 32-bit system files in C:\\Windows\\SysWOW64
  • Windows keeps the 64-bit system files in C:\\Windows\\System32.

On a 32-bit Windows environment, the software is installed in C:\\Program Files, and Windows keeps the system files in C:\\Windows\\System32.

Development requirements:

  • Compile the native COBOL programs with the dynamic link setting.
  • Click Properties under project
  • Click the Link property
  • Select Dynamic checkbox
  • Rebuild solution

There are two series of preparations to be doneĀ on both server and client sides to allow the COBOL applications to be launched from client machines.

Server setup:

1. Install COBOL Server and its Patch Update (PU) at the same level or higher as the one on Visual COBOL.
2.Ā Go toĀ Start > All Programs > Micro Focus License Manager > License Administration
3.Ā Install the license
4.Ā Click Options > Advanced Configuration
5. Change the value for License Server with the current server's name orĀ IP address
6. Click Save and close License Administration
7. Copy the following files to C:\\Program Files (x86)\\Micro Focus\\COBOL Server\\bin:

  • C:\\Program Files (x86)\\Common Files\\Safenet Sentinel\\Sentinel RMS License Manager\\WinNT\\mfcesd.exe
  • C:\\Program Files (x86)\\Common Files\\Safenet Sentinel\\Sentinel RMS License Manager\\WinNT\\mfcesdchk.exe
  • C:\\ProgramData\\Micro Focus\\ces.ini (note: C:\\ProgramData is hidden by default, so the "Show hidden files, folders, and drives" option under Control Panel > Folder Options has to be enabled to make it visible)

8. CopyĀ C:\\Windows\\SysWOW64\\msvcr110.dll from the developmentĀ machineĀ to C:\\Program Files (x86)\\Micro Focus\\COBOL Server\\bin
9.Ā If the COBOL application is built as 64-bit, copy C:\\Windows\\System32\\msvcr110.dll from the developmentĀ machineĀ toĀ C:\\Program Files (x86)\\Micro Focus\\COBOL Server\\bin64
10. Create a network shareĀ (e.g. COBOLsrv) off C:\\Program Files (x86)\\Micro Focus\\COBOL Server and give read-only access to users
11.Ā Create a run-time launch file with a text editor asĀ progname.exe.mfcfg (where progname is the same name as the .exe) with the following two lines:

SET SERVERPATH=\\\\ServerName\\COBOLsrv
SET CESDYNAMIC=ces.ini
  • whereĀ ServerName should be replaced by the actual server's name or IP address.
  • Add SETENV MFCES_INIT_LOCATION=\\\\ServerName\\COBOLsrv\\Bin\\ces.ini to the above if programs were built with Visual COBOL 4.0 or 5.0 (with PU8 or older) and fail with error code "244 Licensing initialization error"
  • Add SETENV PATH=\\\\ServerName\\COBOLsrv\\DSCHAR\\bin;%PATH% to the above if the application uses Dialog System character (DSchar) screens
  • Place the .exe.mfcfg file in the same folder as the .exe file

12. Modify the script that launches the COBOL application with the following:

REM COBPATH to point to location of INT and GNT files if any
REM SET COBPATH=\\\\ServerName\\INTGNT-location
REM COBDATA to point to location of data, .S, and .GS files if any
REM SET COBDATA=\\\\ServerName\\DATA-location;\\\\ServerName\\GS-location
REM PATH to point to the application folder
SET PATH=\\\\ServerName\\COBOLapp;%PATH%
REM launch the COBOL application
ApplicationName.EXE

If there is no script, then the environment variables must be set on each client machine from the system level, and the Step #12 above and the following steps can be skipped.

Client setup:

1. Create a shortcut pointing to \\\\ServerName\\ScriptLocation\\ScriptName.bat
2. Run shortcut

Additional information

  • The COBDIR environment variable is reserved to point to the COBOL product installation only.
  • A client machine implies that neither of Visual COBOL nor COBOL Server are installed on. If Visual COBOL is installed, the application will fail with licensing error code "245 There are no valid product licenses"