View Single Post
  #7  
Old 17-02-2014, 07:31
altef_4's Avatar
altef_4 altef_4 is offline
Registered User
 
Join Date: Mar 2012
Location: Ukraine
Posts: 361
Thanks: 248
Thanked 1,022 Times in 239 Posts
altef_4 is on a distinguished road
Quote:
Originally Posted by Logrim View Post
Anyone, can tell me how to establish priority in install?
Code:
[Setup]
AppName=MyApp
AppVername=MyApp
DefaultDirName={pf}\MyApp
 
[code]
 
const
  NORMAL_PRIORITY_CLASS           = $00000020;
  IDLE_PRIORITY_CLASS             = $00000040;
  HIGH_PRIORITY_CLASS             = $00000080;
  REALTIME_PRIORITY_CLASS         = $00000100;
  ABOVE_NORMAL_PRIORITY_CLASS     = $00004000;
  BELOW_NORMAL_PRIORITY_CLASS     = $00008000;
 
function SetPriorityClass(hProcess: THandle; dwPriorityClass: DWORD): BOOL;
  external 'SetPriorityClass@kernel32';
 
function GetCurrentProcess: THandle;
  external 'GetCurrentProcess@kernel32';
 
procedure InitializeWizard();
begin
  SetPriorityClass(GetCurrentProcess, IDLE_PRIORITY_CLASS);     //set setup priority
end;
taken from here

Last edited by altef_4; 17-02-2014 at 07:38.
Reply With Quote
The Following 2 Users Say Thank You to altef_4 For This Useful Post:
papas (02-09-2016), y_thelastknight (17-02-2014)