UPD: Use -sfx switch for rar (#1996)

(cherry picked from commit 5b04565930)
This commit is contained in:
j2969719 2024-12-08 19:55:11 +03:00 committed by Alexander Koblov
commit 7ea476cace
2 changed files with 10 additions and 0 deletions

View file

@ -200,6 +200,12 @@ begin
end;
function PackFilesW(PackedFile: PWideChar; SubPath: PWideChar; SrcPath: PWideChar; AddList: PWideChar; Flags: Integer): Integer;dcpcall; export;
const
{$IF DEFINED(MSWINDOWS)}
SFXExt = '.exe';
{$ELSE}
SFXExt = '.run';
{$ENDIF}
var
Rar: String;
Process : TProcessUtf8;
@ -230,6 +236,10 @@ begin
if Solid then Process.Parameters.Add('-s');
// Compression method
Process.Parameters.Add('-m' + IntToStr(Method));
if SameStr(ExtractFileExt(CeUtf16ToUtf8(UnicodeString(PackedFile))), SFXExt) then
Process.Parameters.Add('-sfx');
// Add user command line parameters
if Length(Args) > 0 then CommandToList(Args, Process.Parameters);

0
plugins/wcx/unrar/src/unrarfunc.pas Executable file → Normal file
View file