mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: MultiArc - FallBackArchivers (#1837)
This commit is contained in:
parent
fa9bf4e35b
commit
1c6a71258c
2 changed files with 24 additions and 4 deletions
|
|
@ -3,7 +3,8 @@ Extension=7z
|
||||||
Description=7-Zip - www.7-zip.org
|
Description=7-Zip - www.7-zip.org
|
||||||
ID=37 7A BC AF 27 1C
|
ID=37 7A BC AF 27 1C
|
||||||
IDPos=0
|
IDPos=0
|
||||||
Archiver=7za
|
Archiver=7zz
|
||||||
|
FallBackArchivers=7zzs,7za,7z
|
||||||
Start=^-------------------
|
Start=^-------------------
|
||||||
End=^-------------------
|
End=^-------------------
|
||||||
Format0=yyyy tt dd hh mm ss aaaaa zzzzzzzzzzzz pppppppppppp n+
|
Format0=yyyy tt dd hh mm ss aaaaa zzzzzzzzzzzz pppppppppppp n+
|
||||||
|
|
@ -21,8 +22,9 @@ Enabled=0
|
||||||
Debug=0
|
Debug=0
|
||||||
|
|
||||||
[7Z (ro)]
|
[7Z (ro)]
|
||||||
Archiver=7z
|
Archiver=7zz
|
||||||
Description=7-Zip - www.7-zip.org
|
FallBackArchivers=7zzs,7z
|
||||||
|
Description=7-Zip - www.7-zip.org (read-only addon)
|
||||||
Extension=cab,z,taz,lzh,lha,iso,wim,swm,dmg,xar,hfs,ntfs,fat,vhd,mbr
|
Extension=cab,z,taz,lzh,lha,iso,wim,swm,dmg,xar,hfs,ntfs,fat,vhd,mbr
|
||||||
Start=^-------------------
|
Start=^-------------------
|
||||||
End=^-------------------
|
End=^-------------------
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@ type
|
||||||
public
|
public
|
||||||
FPacker,
|
FPacker,
|
||||||
FArchiver,
|
FArchiver,
|
||||||
|
FFallBack,
|
||||||
FDescription,
|
FDescription,
|
||||||
FStart,
|
FStart,
|
||||||
FEnd: String;
|
FEnd: String;
|
||||||
|
|
@ -234,14 +235,27 @@ end;
|
||||||
|
|
||||||
procedure TMultiArcList.AutoConfigure;
|
procedure TMultiArcList.AutoConfigure;
|
||||||
var
|
var
|
||||||
I: Integer;
|
I, J: Integer;
|
||||||
ExePath: String;
|
ExePath: String;
|
||||||
|
AExeList: TStringArray;
|
||||||
begin
|
begin
|
||||||
for I:= 0 to Count - 1 do
|
for I:= 0 to Count - 1 do
|
||||||
begin
|
begin
|
||||||
ExePath:= Items[I].FArchiver;
|
ExePath:= Items[I].FArchiver;
|
||||||
if not mbFileExists(ReplaceEnvVars(ExePath)) then
|
if not mbFileExists(ReplaceEnvVars(ExePath)) then
|
||||||
ExePath:= FindDefaultExecutablePath(ExePath);
|
ExePath:= FindDefaultExecutablePath(ExePath);
|
||||||
|
if (ExePath = EmptyStr) and (Items[I].FFallBack <> EmptyStr) then
|
||||||
|
begin
|
||||||
|
AExeList:= SplitString(Items[I].FFallBack, ',');
|
||||||
|
for J:= Low(AExeList) to High(AExeList) do
|
||||||
|
begin
|
||||||
|
if not mbFileExists(FixExeExt(ReplaceEnvVars(AExeList[J]))) then
|
||||||
|
ExePath:= FindDefaultExecutablePath(FixExeExt(AExeList[J]))
|
||||||
|
else
|
||||||
|
ExePath:= AExeList[J];
|
||||||
|
if ExePath <> EmptyStr then break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
if ExePath = EmptyStr then
|
if ExePath = EmptyStr then
|
||||||
Items[I].FEnabled:= False
|
Items[I].FEnabled:= False
|
||||||
else
|
else
|
||||||
|
|
@ -293,6 +307,7 @@ begin
|
||||||
begin
|
begin
|
||||||
FPacker:= Section;
|
FPacker:= Section;
|
||||||
FArchiver:= FixExeExt(TrimQuotes(IniFile.ReadString(Section, 'Archiver', EmptyStr)));
|
FArchiver:= FixExeExt(TrimQuotes(IniFile.ReadString(Section, 'Archiver', EmptyStr)));
|
||||||
|
FFallBack:= IniFile.ReadString(Section, 'FallBackArchivers', EmptyStr);
|
||||||
FDescription:= TrimQuotes(IniFile.ReadString(Section, 'Description', EmptyStr));
|
FDescription:= TrimQuotes(IniFile.ReadString(Section, 'Description', EmptyStr));
|
||||||
FID:= TrimQuotes(IniFile.ReadString(Section, 'ID', EmptyStr));
|
FID:= TrimQuotes(IniFile.ReadString(Section, 'ID', EmptyStr));
|
||||||
FIDPos:= TrimQuotes(IniFile.ReadString(Section, 'IDPos', EmptyStr));
|
FIDPos:= TrimQuotes(IniFile.ReadString(Section, 'IDPos', EmptyStr));
|
||||||
|
|
@ -354,6 +369,7 @@ begin
|
||||||
with MultiArcItem do
|
with MultiArcItem do
|
||||||
begin
|
begin
|
||||||
IniFile.WriteString(Section, 'Archiver', FArchiver);
|
IniFile.WriteString(Section, 'Archiver', FArchiver);
|
||||||
|
IniFile.WriteString(Section, 'FallBackArchivers', FFallBack);
|
||||||
IniFile.WriteString(Section, 'Description', FDescription);
|
IniFile.WriteString(Section, 'Description', FDescription);
|
||||||
IniFile.WriteString(Section, 'ID', FID);
|
IniFile.WriteString(Section, 'ID', FID);
|
||||||
IniFile.WriteString(Section, 'IDPos', FIDPos);
|
IniFile.WriteString(Section, 'IDPos', FIDPos);
|
||||||
|
|
@ -433,6 +449,7 @@ begin
|
||||||
UpdateSignature(Self.FList.Strings[Index]);
|
UpdateSignature(Self.FList.Strings[Index]);
|
||||||
UpdateSignature(Self.Items[Index].FDescription);
|
UpdateSignature(Self.Items[Index].FDescription);
|
||||||
UpdateSignature(Self.Items[Index].FArchiver);
|
UpdateSignature(Self.Items[Index].FArchiver);
|
||||||
|
UpdateSignature(Self.Items[Index].FFallBack);
|
||||||
UpdateSignature(Self.Items[Index].FExtension);
|
UpdateSignature(Self.Items[Index].FExtension);
|
||||||
UpdateSignature(Self.Items[Index].FList);
|
UpdateSignature(Self.Items[Index].FList);
|
||||||
UpdateSignature(Self.Items[Index].FStart);
|
UpdateSignature(Self.Items[Index].FStart);
|
||||||
|
|
@ -651,6 +668,7 @@ begin
|
||||||
//Keep elements in some ordre a when loading them from the .ini, it will be simpler to validate if we are missing one.
|
//Keep elements in some ordre a when loading them from the .ini, it will be simpler to validate if we are missing one.
|
||||||
Result.FPacker := Self.FPacker;
|
Result.FPacker := Self.FPacker;
|
||||||
Result.FArchiver := Self.FArchiver;
|
Result.FArchiver := Self.FArchiver;
|
||||||
|
Result.FFallBack := Self.FFallBack;
|
||||||
Result.FDescription := Self.FDescription;
|
Result.FDescription := Self.FDescription;
|
||||||
Result.FID := Self.FID;
|
Result.FID := Self.FID;
|
||||||
Result.FIDPos := Self.FIDPos;
|
Result.FIDPos := Self.FIDPos;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue