mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: COMMANDER_EXE and COMMANDER_INI_PATH environment variables
This commit is contained in:
parent
e350e9b7ff
commit
785ccd8bf2
1 changed files with 8 additions and 1 deletions
|
|
@ -24,6 +24,9 @@ implementation
|
|||
uses
|
||||
SysUtils, LazFileUtils, uDebug, DCOSUtils, DCStrUtils, uSysFolders;
|
||||
|
||||
var
|
||||
gpExeFile: String;
|
||||
|
||||
function GetAppName : String;
|
||||
begin
|
||||
Result := 'doublecmd';
|
||||
|
|
@ -31,6 +34,7 @@ end;
|
|||
|
||||
procedure UpdateEnvironmentVariable;
|
||||
begin
|
||||
mbSetEnvironmentVariable('COMMANDER_INI_PATH', gpCfgDir);
|
||||
mbSetEnvironmentVariable('COMMANDER_INI', gpCfgDir + 'doublecmd.xml');
|
||||
mbSetEnvironmentVariable('DC_CONFIG_PATH', ExcludeTrailingPathDelimiter(gpCfgDir));
|
||||
end;
|
||||
|
|
@ -68,13 +72,16 @@ begin
|
|||
|
||||
// set up environment variables
|
||||
UpdateEnvironmentVariable;
|
||||
mbSetEnvironmentVariable('COMMANDER_EXE', gpExeFile);
|
||||
mbSetEnvironmentVariable('COMMANDER_DRIVE', ExtractRootDir(gpExePath));
|
||||
mbSetEnvironmentVariable('COMMANDER_PATH', ExcludeTrailingBackslash(gpExePath));
|
||||
end;
|
||||
|
||||
procedure Initialize;
|
||||
begin
|
||||
gpExePath := ExtractFilePath(TryReadAllLinks(ParamStr(0)));
|
||||
gpExeFile := ParamStr(0);
|
||||
gpExeFile := TryReadAllLinks(gpExeFile);
|
||||
gpExePath := ExtractFilePath(gpExeFile);
|
||||
gpGlobalCfgDir := gpExePath + 'settings' + DirectorySeparator;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue