LzmaSpeedTest.iss 1.5 KB

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