mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Capability to use configuration from plugin path
This commit is contained in:
parent
bcf2c55648
commit
2ecf5b4d15
2 changed files with 12 additions and 2 deletions
|
|
@ -409,13 +409,20 @@ var
|
|||
ModulePath: AnsiString;
|
||||
begin
|
||||
// Save configuration file name
|
||||
ConfigFile:= ExtractFilePath(dps^.DefaultIniName) + 'sevenzip.ini';
|
||||
ConfigFile:= ExtractFilePath(dps^.DefaultIniName) + DefaultIniName;
|
||||
// Get plugin path
|
||||
if GetModulePath(ModulePath) then
|
||||
begin
|
||||
// Use configuration from plugin path
|
||||
if FileExistsUTF8(ModulePath + DefaultIniName) then
|
||||
ConfigFile:= ModulePath + DefaultIniName;
|
||||
end;
|
||||
// Load plugin configuration
|
||||
LoadConfiguration;
|
||||
// Try to find library path
|
||||
if FileExistsUTF8(LibraryPath) then
|
||||
SevenzipLibraryName:= LibraryPath
|
||||
else if GetModulePath(ModulePath) then
|
||||
else if Length(ModulePath) > 0 then
|
||||
begin
|
||||
if FileExistsUTF8(ModulePath + TargetCPU + PathDelim + SevenzipDefaultLibraryName) then
|
||||
SevenzipLibraryName:= ModulePath + TargetCPU + PathDelim + SevenzipDefaultLibraryName
|
||||
|
|
|
|||
|
|
@ -168,6 +168,9 @@ procedure SetArchiveOptions(AJclArchive: IInterface);
|
|||
procedure LoadConfiguration;
|
||||
procedure SaveConfiguration;
|
||||
|
||||
const
|
||||
DefaultIniName = 'sevenzip.ini';
|
||||
|
||||
var
|
||||
ConfigFile: AnsiString;
|
||||
LibraryPath: AnsiString;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue