-
-
Notifications
You must be signed in to change notification settings - Fork 938
/
LzmaSpeedTest.iss
54 lines (48 loc) · 1.54 KB
/
LzmaSpeedTest.iss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
;Set Compil32 to high prio as well before doing compilation speed test (done automatically for installation speed test)
[Setup]
AppName=My Program
AppVerName=My Program version 1.5
#define DefaultDirName "{autopf}\My Program"
DefaultDirName={#DefaultDirName}
UseSetupLdr=0
OutputDir=.
AppVersion=1.2.3
OutputBaseFilename=Setup
PrivilegesRequired=lowest
MergeDuplicateFiles=no
DisableDirPage=yes
[Files]
#define i
#sub AddFiles
Source: c:\Program Files\Git\usr\bin\*; Flags: ignoreversion; DestDir: "{app}\{#i}"
#endsub
#for {i = 0; i < 10; i++} AddFiles
[Code]
function SetPriorityClass(hProcess: THandle; dwPriorityClass: DWORD): BOOL; external '[email protected] stdcall';
function GetCurrentProcess: THandle; external '[email protected] stdcall';
function GetTickCount: DWORD; external '[email protected] stdcall';
function InitializeSetup: Boolean;
var
S: String;
ResultCode: Integer;
begin
Result := not Debugging;
if Result then
Result := SetPriorityClass(GetCurrentProcess, $00000080);
if Result then begin
S := ExpandConstant('{#DefaultDirName}\unins000.exe');
if FileExists(S) then
Exec(S, '/silent', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
end;
end;
var
Time: Integer;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
Time := GetTickCount
else if CurStep = ssPostInstall then begin
Time := GetTickCount - Time;
MsgBox(FloatToStr(Time / 1000.0), mbInformation, MB_OK);
end;
end;