Terminology:
Simple Installation:
- homePath: Something like "D:\BlackBox" which contains BlackBox.exe & all the SubSystems.
Typically D is a local drive.
- serverPath: Same as homePath.
Client/Server Installation:
- serverPath: Something like "K:\...\BlackBoxServer" which contains BlackBox.exe, all the Oms SubSystems, library SubSystems, and common project SubSystems.
Typically K is a network drive.
- homePath: Something like "D:\BlackBoxClient" which only contains private variants of common facilities (Menus, etc), and SubSystems specific to a confidential project.
Some of my colleages work with a Simple local BlackBox insttallation, some with a networked Client / Server installation.
Many projects have project specific data in a common format, which is typically kept in a file like: <BlackBoxPath>\ThisProjectSubSystem\DataA.xyz
To access this data we just type "ThisProjectSubSystem\DataA" into a Tool which deals with it accordingly.
The Tool has to be able to add <BlackBoxPath> to find the file.
It first tries "<homePath>\ThisProjectSubSystem\DataA.xyz". If this fails it gets <serverPath>, and if this differs from <homePath> looks there.
My current code for obtaining these two paths is:
homePath:
Code: Select all
home := Files.dir.This ('')(HostFiles.Locator).path$
serverPath:
Code: Select all
PROCEDURE Server* (OUT home : ARRAY OF CHAR);
VAR
res, k : INTEGER;
BEGIN
res := WinApi.GetModuleFileNameW (0, home, LEN (home));
k := LEN (home$);
WHILE (k > 0) & (home [k] # '\')
& (home [k] # '/') & (home [k - 1] # ':') DO DEC (k) END;
home [k] := 0X
END Server