
07-02-2024, 08:43
|
|
Registered User
|
|
Join Date: Mar 2023
Location: Los Angeles Lakers
Posts: 43
Thanks: 91
Thanked 26 Times in 18 Posts
|
|
Maybe it will be useful to someone.
Automatically set the unpacking parameters depending on the amount of RAM:
Quote:
function GetRamMemory: Integer;
var i: Integer;
s: String;
begin
s:=MbOrTb(RamInfo.TotalRam, 0);
for i:=length(s) downto 1 do
if not (s[i] in ['0','1','2','3','4','5','6','7','8','9']) then delete(s,i,1);
Result:=StrToInt(s);
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
XValue, LRamValue, LCpuValue, SValue: String;
begin
case GetRamMemory of
0..2:
begin
XValue:= 't4';
SValue:= '512mb';
LRamValue:= '512mb';
LCpuValue:= '4';
end;
3..4:
begin
XValue:= 't4';
SValue:= '768mb';
LRamValue:= '768mb';
LCpuValue:= '4';
end;
5..6:
begin
XValue:= 't45p';
SValue:= '1024mb';
LRamValue:= '1024mb';
LCpuValue:= '4';
end;
7..8:
begin
XValue:= 't65p';
SValue:= '1536mb';
LRamValue:= '1536mb';
LCpuValue:= '4';
end;
9..12:
begin
XValue:= 't75p';
SValue:= '2064mb';
LRamValue:= '2064mb';
LCpuValue:= '4';
end;
13..16:
begin
XValue:= 't85p';
SValue:= '20%';
LRamValue:= '50%';
LCpuValue:= '6';
end;
17..32:
begin
XValue:= 't85p';
SValue:= '40%';
LRamValue:= '40%';
LCpuValue:= '6';
end;
33..150:
begin
XValue:= 't85p';
SValue:= '40%';
LRamValue:= '40%';
LCpuValue:= '6';
end;
end;
if CurStep = ssInstall then
begin
ISArcExCancel:= 0;
ISArcExDiskCount:= 0;
ISArcDiskAddingSuccess:= False;
ISArcExError:= True;
ExtractTemporaryFile('Russian.ini');
ExtractTemporaryFile('unarc.dll');
ExtractTemporaryFile('arc.ini');
ExtractTemporaryFile('cls.ini');
ExtractTemporaryFile('Facompress.dll');
#ifdef xtool_zlib
ExtractTemporaryFile('zlibwapi.dll');
ExtractTemporaryFile('xtool.exe');
if IsWin64 then
begin
SetIniString('External compressor:xtool', 'unpackcmd', ' "xtool" d recomp:' + XValue + ' - - <stdin> <stdout>', ExpandConstant('{tmp}\arc.ini'));
end else
begin
SetIniString('External compressor:xtool', 'unpackcmd', ' "xtool" d recomp:' + XValue + ' - - <stdin> <stdout>', ExpandConstant('{tmp}\arc.ini'));
end;
#endif
#ifdef srep
ExtractTemporaryFile('cls-srep.dll');
if IsWin64 then
begin
ExtractTemporaryFile('cls-srep_x64.exe');
SetIniString('Srep', 'Memory', SValue, ExpandConstant('{tmp}\cls.ini'));
end else
begin
ExtractTemporaryFile('cls-srep_x86.exe');
SetIniString('Srep', 'Memory', SValue, ExpandConstant('{tmp}\cls.ini'));
end;
#endif
#ifdef lolz
ExtractTemporaryFile('cls-lolz.dll');
if IsWin64 then
begin
ExtractTemporaryFile('cls-lolz_x64.exe');
SetIniString('lolz', 'MaxThreadsUsage', '4', ExpandConstant('{tmp}\cls.ini'));
SetIniString('lolz', 'MaxMemoryUsage', LRamValue, ExpandConstant('{tmp}\cls.ini'));
end else
begin
ExtractTemporaryFile('cls-lolz_x86.exe');
SetIniString('lolz', 'MaxThreadsUsage', '4', ExpandConstant('{tmp}\cls.ini'));
SetIniString('lolz', 'MaxMemoryUsage', LRamValue, ExpandConstant('{tmp}\cls.ini'));
end;
#endif
....
|
|