Advertisement
Guest User

Installer

a guest
Dec 18th, 2017
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;* Process Hacker 2 - Installer script
  2. ;*
  3. ;* Copyright (C) 2011 wj32
  4. ;* Copyright (C) 2010-2016 XhmikosR
  5. ;* Updated   (C) 2017, VictorVG @ VikSoft.Ru
  6. ;*
  7. ;* This file is part of Process Hacker.
  8. ;*
  9. ;* Process Hacker is free software; you can redistribute it and/or modify
  10. ;* it under the terms of the GNU General Public License as published by
  11. ;* the Free Software Foundation, either version 3 of the License, or
  12. ;* (at your option) any later version.
  13. ;*
  14. ;* Process Hacker is distributed in the hope that it will be useful,
  15. ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ;* GNU General Public License for more details.
  18. ;*
  19. ;* You should have received a copy of the GNU General Public License
  20. ;* along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
  21. ;
  22. ; Last updated 17.12.2017 23:20:48 +0300 VictorVG @ VikSoft.Ru
  23. ; update script version up to v14.0.57 (non oficial).
  24. ;
  25. ; Requirements:
  26. ; *Inno Setup: http://www.jrsoftware.org/isdl.php
  27. ;
  28. ; WARNING:
  29. ;
  30. ; Driver name KProcessHacker2 in to [Code] section does not change or the program
  31. ; will fail!
  32. ;
  33. #if VER < EncodeVer(5,5,9)
  34.   #error Update your Inno Setup version (5.5.9 or newer)
  35. #endif
  36.  
  37. #include "..\..\ProcessHacker\include\phres.h"
  38.  
  39. ; Include the custom messages and services
  40. #include "Custom_Messages_Full.iss"
  41. #include "Services_Full.iss"
  42.  
  43. #define installer_build_number "14.0.57"
  44. #define copyright              "Copyright © 2010-2017, Process Hacker Team. Licensed under the GNU GPL, v3.0"
  45. #define website_url            "http://processhacker.sourceforge.net/"
  46. #if defined(TWO_DIGIT_VER)
  47. #define app_version            str(PHAPP_VERSION_MAJOR) + "." + str(PHAPP_VERSION_MINOR)
  48. #define app_version_long       str(PHAPP_VERSION_MAJOR) + "." + str(PHAPP_VERSION_MINOR) + ".0" + "." + str(PHAPP_VERSION_REVISION)
  49. #define app_version_full       str(PHAPP_VERSION_MAJOR) + "." + str(PHAPP_VERSION_MINOR) + " (r" + str(PHAPP_VERSION_REVISION) + ")"
  50. #elif defined(THREE_DIGIT_VER)
  51. #define app_version            str(PHAPP_VERSION_MAJOR) + "." + str(PHAPP_VERSION_MINOR)
  52. #define app_version_long       str(PHAPP_VERSION_MAJOR) + "." + str(PHAPP_VERSION_MINOR) + "." + str(PHAPP_VERSION_BUILD) + "." + str(PHAPP_VERSION_REVISION)
  53. #define app_version_full       str(PHAPP_VERSION_MAJOR) + "." + str(PHAPP_VERSION_MINOR) +  " (r" + str(PHAPP_VERSION_REVISION) + ")"
  54. #endif
  55.  
  56. #define installer_build_date   GetDateTimeString('mmm, d yyyy', '', '')
  57. #define quick_launch           "{userappdata}\Microsoft\Internet Explorer\Quick Launch"
  58.  
  59.  
  60. [Setup]
  61. AppID=Process_Hacker
  62. AppCopyright={#copyright}
  63. AppContact=http://wj32.org/processhacker/forums/
  64. AppName=Process Hacker
  65. AppVerName=Process Hacker {#app_version_full}
  66. AppVersion={#app_version_long}
  67. AppPublisher=Process Hacker
  68. AppPublisherURL={#website_url}
  69. AppSupportURL=http://wj32.org/processhacker/forums/
  70. AppUpdatesURL={#website_url}
  71. UninstallDisplayName=Process Hacker {#app_version_full}
  72. DefaultDirName={pf}\Process Hacker
  73. DefaultGroupName=Process Hacker
  74. VersionInfoCompany=Process Hacker
  75. VersionInfoCopyright={#copyright}
  76. VersionInfoDescription=Process Hacker Setup
  77. VersionInfoProductName=Process Hacker
  78. VersionInfoProductTextVersion={#app_version_full}
  79. VersionInfoProductVersion={#app_version_long}
  80. VersionInfoTextVersion={#app_version_full}
  81. VersionInfoVersion={#app_version_long}
  82. MinVersion=0,6.1
  83. LicenseFile=..\..\LICENSE.txt
  84. SetupIconFile=..\..\ProcessHacker\ProcessHacker.ico
  85. UninstallDisplayIcon={app}\ProcessHacker.exe
  86. WizardImageFile=Icons_Full\ProcessHackerLarge.bmp
  87. WizardSmallImageFile=Icons_Full\ProcessHackerSmall.bmp
  88. OutputDir=.
  89. OutputBaseFilename=processhacker-{#app_version}-setup
  90. AllowNoIcons=yes
  91. Compression=lzma2/max
  92. InternalCompressLevel=max
  93. SolidCompression=yes
  94. EnableDirDoesntExistWarning=no
  95. ShowTasksTreeLines=yes
  96. PrivilegesRequired=admin
  97. CloseApplications=yes
  98. DisableDirPage=auto
  99. DisableProgramGroupPage=auto
  100. AppMutex=Global\ProcessHackerMutant
  101. ArchitecturesInstallIn64BitMode=x64
  102. AppComments=Extended build by VictorVG @ VikSoft.Ru
  103.  
  104. [Languages]
  105. Name: en; MessagesFile: compiler:Default.isl
  106.  
  107. [Messages]
  108. WelcomeLabel1=[name/ver]
  109. WelcomeLabel2=This will install [name] on your computer.%n%nIt is recommended that you close all other applications before continuing.
  110. BeveledLabel=Process Hacker v{#app_version_full}, Setup v{#installer_build_number} built on {#installer_build_date}
  111. SetupAppTitle=Setup - Process Hacker
  112. SetupWindowTitle=Setup - Process Hacker
  113.  
  114.  
  115. [Types]
  116. Name: full;                            Description: {cm:tsk_full}
  117. Name: minimal;                         Description: {cm:tsk_minimal}
  118. Name: custom;                          Description: {cm:tsk_custom};                  Flags: iscustom
  119.  
  120. [Components]
  121. Name: "main";                          Description: "{cm:comp_Main_App}";              Types: full minimal custom; Flags: fixed
  122. Name: "peview";                        Description: "{cm:comp_PE_Viewer}";             Types: full minimal custom; Flags: disablenouninstallwarning
  123.  
  124. Name: "plugins";                       Description: "{cm:comp_Plugins}";               Types: full custom; Flags: disablenouninstallwarning
  125. Name: "plugins\atomtable";             Description: "{cm:comp_AtomTable}";             Types: full custom; Flags: disablenouninstallwarning
  126. Name: "plugins\avgcpu";                Description: "{cm:comp_AvgCPU}";                Types: full custom; Flags: disablenouninstallwarning
  127. Name: "plugins\dbgview";               Description: "{cm:comp_DbgView}";               Types: full custom; Flags: disablenouninstallwarning
  128. Name: "plugins\dnscache";              Description: "{cm:comp_DnsResolver}";           Types: full custom; Flags: disablenouninstallwarning
  129. Name: "plugins\dotnettools";           Description: "{cm:comp_DotNetTools}";           Types: full custom; Flags: disablenouninstallwarning
  130. Name: "plugins\extendednotifications"; Description: "{cm:comp_ExtendedNotifications}"; Types: full custom; Flags: disablenouninstallwarning
  131. Name: "plugins\extendedservices";      Description: "{cm:comp_ExtendedServices}";      Types: full custom; Flags: disablenouninstallwarning
  132. Name: "plugins\extendedtools";         Description: "{cm:comp_ExtendedTools}";         Types: full custom; Flags: disablenouninstallwarning
  133. Name: "plugins\forceshutdown";         Description: "{cm:comp_ForceShutdown}";         Types: full custom; Flags: disablenouninstallwarning
  134. Name: "plugins\fwmon";                 Description: "{cm:comp_FwMon}";                 Types: full custom; Flags: disablenouninstallwarning
  135. Name: "plugins\hardwaredevices";       Description: "{cm:comp_HardwareDevices}";       Types: full custom; Flags: disablenouninstallwarning
  136. Name: "plugins\hexpid";                Description: "{cm:comp_HexPID}";                Types: full custom; Flags: disablenouninstallwarning
  137. Name: "plugins\livedump";              Description: "{cm:comp_LKD}";                   Types: full custom; Flags: disablenouninstallwarning; MinVersion: 0,6.3
  138. Name: "plugins\memext";                Description: "{cm:comp_MemEx}";                 Types: full custom; Flags: disablenouninstallwarning; MinVersion: 0,6.3
  139. Name: "plugins\networktools";          Description: "{cm:comp_NetworkTools}";          Types: full custom; Flags: disablenouninstallwarning
  140. Name: "plugins\nvgpu";                 Description: "{cm:comp_NvGPU}";                 Types: full custom; Flags: disablenouninstallwarning
  141. Name: "plugins\objectmanager";         Description: "{cm:comp_ObjectManager}";         Types: full custom; Flags: disablenouninstallwarning
  142. Name: "plugins\onlinechecks";          Description: "{cm:comp_OnlineChecks}";          Types: full custom; Flags: disablenouninstallwarning
  143. Name: "plugins\perfmon";               Description: "{cm:comp_PerfMon}";               Types: full custom; Flags: disablenouninstallwarning
  144. Name: "plugins\poolmon";               Description: "{cm:comp_PoolMon}";               Types: full custom; Flags: disablenouninstallwarning
  145. Name: "plugins\productpolicy";         Description: "{cm:comp_ProductPolicy}";         Types: full custom; Flags: disablenouninstallwarning
  146. Name: "plugins\rotviewer";             Description: "{cm:comp_ROTViewerPlugin}";       Types: full custom; Flags: disablenouninstallwarning
  147. Name: "plugins\sbiesupport";           Description: "{cm:comp_SbieSupport}";           Types: full custom; Flags: disablenouninstallwarning
  148. Name: "plugins\secexp";                Description: "{cm:comp_SecurityExplorer}";      Types: full custom; Flags: disablenouninstallwarning; OnlyBelowVersion: 0,6.3
  149. Name: "plugins\setcrtical";            Description: "{cm:comp_SetCritical}";           Types: full custom; Flags: disablenouninstallwarning
  150. Name: "plugins\srvbakrst";             Description: "{cm:comp_ServiceBackupRestore}";  Types: full custom; Flags: disablenouninstallwarning
  151. Name: "plugins\taskbarext";            Description: "{cm:comp_TaskbarExt}";            Types: full custom; Flags: disablenouninstallwarning
  152. Name: "plugins\terminator";            Description: "{cm:comp_Terminator}";            Types: full custom; Flags: disablenouninstallwarning
  153. Name: "plugins\toolstatus";            Description: "{cm:comp_ToolStatus}";            Types: full custom; Flags: disablenouninstallwarning
  154. Name: "plugins\trustinst";             Description: "{cm:comp_TrustInst}";             Types: full custom; Flags: disablenouninstallwarning
  155. Name: "plugins\uefi";                  Description: "{cm:comp_UEFI}";                  Types: full custom; Flags: disablenouninstallwarning
  156. Name: "plugins\updater";               Description: "{cm:comp_Updater}";               Types: full custom; Flags: disablenouninstallwarning
  157. Name: "plugins\usernotes";             Description: "{cm:comp_UserNotes}";             Types: full custom; Flags: disablenouninstallwarning
  158. Name: "plugins\waitchain";             Description: "{cm:comp_waitchain}";             Types: full custom; Flags: disablenouninstallwarning
  159. Name: "plugins\windowexplorer";        Description: "{cm:comp_WindowExplorer}";        Types: full custom; Flags: disablenouninstallwarning
  160.  
  161.  
  162. [Tasks]
  163. Name: desktopicon;         Description: {cm:CreateDesktopIcon};     GroupDescription: {cm:AdditionalIcons}
  164. Name: desktopicon\user;    Description: {cm:tsk_CurrentUser};       GroupDescription: {cm:AdditionalIcons};                                    Flags: exclusive
  165. Name: desktopicon\common;  Description: {cm:tsk_AllUsers};          GroupDescription: {cm:AdditionalIcons};                                    Flags: unchecked exclusive
  166. Name: quicklaunchicon;     Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons};                                    Flags: unchecked
  167.  
  168. Name: startup;             Description: {cm:tsk_StartupDescr};      GroupDescription: {cm:tsk_Startup};     Check: not StartupCheck();         Flags: unchecked checkablealone
  169. Name: startup\minimized;   Description: {cm:tsk_StartupDescrMin};   GroupDescription: {cm:tsk_Startup};     Check: not StartupCheck();         Flags: unchecked
  170. Name: remove_startup;      Description: {cm:tsk_RemoveStartup};     GroupDescription: {cm:tsk_Startup};     Check: StartupCheck();             Flags: unchecked
  171.  
  172. Name: set_default_taskmgr; Description: {cm:tsk_SetDefaultTaskmgr}; GroupDescription: {cm:tsk_Other};       Check: not PHDefaulTaskmgrCheck(); Flags: checkedonce unchecked
  173. Name: restore_taskmgr;     Description: {cm:tsk_RestoreTaskmgr};    GroupDescription: {cm:tsk_Other};       Check: PHDefaulTaskmgrCheck();     Flags: checkedonce unchecked
  174.  
  175. Name: reset_settings;      Description: {cm:tsk_ResetSettings};     GroupDescription: {cm:tsk_Other};       Check: SettingsExistCheck();       Flags: checkedonce unchecked
  176.  
  177. Name: create_KPH_service;  Description: {cm:tsk_CreateKPHService};  GroupDescription: {cm:tsk_Other};       Check: not KPHServiceCheck();      Flags: unchecked
  178. Name: delete_KPH_service;  Description: {cm:tsk_DeleteKPHService};  GroupDescription: {cm:tsk_Other};       Check: KPHServiceCheck();          Flags: unchecked
  179.  
  180. Name: deldesktop_user;     Description: {cm:tsk_DelCurUsrDesk};     GroupDescription: {cm:tsk_Other};                                          Flags: unchecked
  181. Name: deldesktop_common;   Description: {cm:tsk_DelAllUsrDesk};     GroupDescription: {cm:tsk_Other};                                          Flags: unchecked
  182. Name: delquicklaunch;      Description: {cm:tsk_DelQuickLaunch};    GroupDescription: {cm:tsk_Other};                                          Flags: unchecked
  183.  
  184. [Files]
  185. Source: "..\..\CHANGELOG.txt"; DestDir: "{app}"; Flags: ignoreversion
  186. Source: "..\..\COPYRIGHT.txt"; DestDir: "{app}"; Flags: ignoreversion
  187. Source: "..\..\LICENSE.txt";   DestDir: "{app}"; Flags: ignoreversion
  188. Source: "..\..\README.md";     DestDir: "{app}"; Flags: ignoreversion
  189.  
  190. Source: "..\..\bin\Release32\ProcessHacker.exe"; DestDir: "{app}";     Flags: ignoreversion;                   Check: not Is64BitInstallMode()
  191. Source: "..\..\bin\Release64\ProcessHacker.exe"; DestDir: "{app}";     Flags: ignoreversion;                   Check: Is64BitInstallMode()
  192. Source: "..\..\bin\Release32\ProcessHacker.exe"; DestDir: "{app}\x86"; Flags: ignoreversion;                   Check: Is64BitInstallMode()
  193. Source: "..\..\bin\Release64\ProcessHacker.sig"; DestDir: "{app}";     Flags: ignoreversion onlyifdoesntexist; Check: Is64BitInstallMode()
  194. Source: "..\..\bin\Release32\ProcessHacker.sig"; DestDir: "{app}";     Flags: ignoreversion onlyifdoesntexist; Check: not Is64BitInstallMode()
  195. Source: "..\..\bin\Release32\ProcessHacker.sig"; DestDir: "{app}\x86"; Flags: ignoreversion onlyifdoesntexist; Check: Is64BitInstallMode()
  196.  
  197. Source: "..\..\KProcessHacker\bin-signed\i386\kprocesshacker.sys" ; DestDir: "{app}"; Flags: ignoreversion replacesameversion overwritereadonly restartreplace; Check: not Is64BitInstallMode()
  198. Source: "..\..\KProcessHacker\bin-signed\amd64\kprocesshacker.sys"; DestDir: "{app}"; Flags: ignoreversion replacesameversion overwritereadonly restartreplace; Check: Is64BitInstallMode()
  199.  
  200. Source: "..\..\plugins-extra\TerminatorPlugin\resources\kprocesshacker2_x32.sys"; DestDir: "{app}\plugins\plugindata"; Flags: ignoreversion; Check: not Is64BitInstallMode()
  201. Source: "..\..\plugins-extra\TerminatorPlugin\resources\kprocesshacker2_x64.sys"; DestDir: "{app}\plugins\plugindata"; Flags: ignoreversion; Check: Is64BitInstallMode()
  202.  
  203. Source: "..\..\bin\Release32\peview.exe";                             DestDir: "{app}";                    Flags: ignoreversion; Components: peview; Check: not Is64BitInstallMode()
  204. Source: "..\..\bin\Release64\peview.exe";                             DestDir: "{app}";                    Flags: ignoreversion; Components: peview; Check: Is64BitInstallMode()
  205.  
  206. Source: "..\..\bin\Release32\plugins\AtomTablePlugin.dll";            DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\atomtable;             Check: not Is64BitInstallMode()
  207. Source: "..\..\bin\Release64\plugins\AtomTablePlugin.dll";            DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\atomtable;             Check: Is64BitInstallMode()
  208. Source: "..\..\bin\Release32\plugins\AvgCpuPlugin.dll";               DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\avgcpu;                Check: not Is64BitInstallMode()
  209. Source: "..\..\bin\Release64\plugins\AvgCpuPlugin.dll";               DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\avgcpu;                Check: Is64BitInstallMode()
  210. Source: "..\..\bin\Release32\plugins\DbgViewPlugin.dll";              DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\dbgview;               Check: not Is64BitInstallMode()
  211. Source: "..\..\bin\Release64\plugins\DbgViewPlugin.dll";              DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\dbgview;               Check: Is64BitInstallMode()
  212. Source: "..\..\bin\Release32\plugins\DnsCachePlugin.dll";             DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\dnscache;              Check: not Is64BitInstallMode()
  213. Source: "..\..\bin\Release64\plugins\DnsCachePlugin.dll";             DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\dnscache;              Check: Is64BitInstallMode()
  214. Source: "..\..\bin\Release32\plugins\DotNetTools.dll";                DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\dotnettools;           Check: not Is64BitInstallMode()
  215. Source: "..\..\bin\Release64\plugins\DotNetTools.dll";                DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\dotnettools;           Check: Is64BitInstallMode()
  216. Source: "..\..\bin\Release32\plugins\DotNetTools.dll";                DestDir: "{app}\x86\plugins";        Flags: ignoreversion;                                                    Components: plugins\dotnettools;           Check: Is64BitInstallMode()
  217. Source: "..\..\bin\Release32\plugins\ExtendedNotifications.dll";      DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\extendednotifications; Check: not Is64BitInstallMode()
  218. Source: "..\..\bin\Release64\plugins\ExtendedNotifications.dll";      DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\extendednotifications; Check: Is64BitInstallMode()
  219. Source: "..\..\bin\Release32\plugins\ExtendedServices.dll";           DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\extendedservices;      Check: not Is64BitInstallMode()
  220. Source: "..\..\bin\Release64\plugins\ExtendedServices.dll";           DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\extendedservices;      Check: Is64BitInstallMode()
  221. Source: "..\..\bin\Release32\plugins\ExtendedTools.dll";              DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\extendedtools;         Check: not Is64BitInstallMode()
  222. Source: "..\..\bin\Release64\plugins\ExtendedTools.dll";              DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\extendedtools;         Check: Is64BitInstallMode()
  223. Source: "..\..\bin\Release32\plugins\FirewallMonitorPlugin.dll";      DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\fwmon;                 Check: not Is64BitInstallMode()
  224. Source: "..\..\bin\Release64\plugins\FirewallMonitorPlugin.dll";      DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\fwmon;                 Check: Is64BitInstallMode()
  225. Source: "..\..\bin\Release32\plugins\ForceShutdownPlugin.dll";        DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\forceshutdown;         Check: not Is64BitInstallMode()
  226. Source: "..\..\bin\Release64\plugins\ForceShutdownPlugin.dll";        DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\forceshutdown;         Check: Is64BitInstallMode()
  227. Source: "..\..\bin\Release32\plugins\HardwareDevices.dll";            DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\hardwaredevices;       Check: not Is64BitInstallMode()
  228. Source: "..\..\bin\Release64\plugins\HardwareDevices.dll";            DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\hardwaredevices;       Check: Is64BitInstallMode()
  229. Source: "..\..\bin\Release32\plugins\HexPidPlugin.dll";               DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\hexpid;                Check: not Is64BitInstallMode()
  230. Source: "..\..\bin\Release64\plugins\HexPidPlugin.dll";               DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\hexpid;                Check: Is64BitInstallMode()
  231. Source: "..\..\bin\Release32\plugins\LiveDumpPlugin.dll";             DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\livedump;                Check: not Is64BitInstallMode()
  232. Source: "..\..\bin\Release64\plugins\LiveDumpPlugin.dll";             DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\livedump;                Check: Is64BitInstallMode()
  233. Source: "..\..\bin\Release32\plugins\MemoryExtPlugin.dll";            DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\memext;                Check: not Is64BitInstallMode()
  234. Source: "..\..\bin\Release64\plugins\MemoryExtPlugin.dll";            DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\memext;                Check: Is64BitInstallMode()
  235. Source: "{src}\GeoLite2-Country.mmdb";                                DestDir: "{userappdata}";            Flags: ignoreversion external skipifsourcedoesntexist overwritereadonly; Components: plugins\networktools
  236. Source: "..\..\bin\Release32\plugins\NetworkTools.dll";               DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\networktools;          Check: not Is64BitInstallMode()
  237. Source: "..\..\bin\Release64\plugins\NetworkTools.dll";               DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\networktools;          Check: Is64BitInstallMode()
  238. Source: "..\..\bin\Release32\plugins\NvGpuPlugin.dll";                DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\nvgpu;                 Check: not Is64BitInstallMode()
  239. Source: "..\..\bin\Release64\plugins\NvGpuPlugin.dll";                DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\nvgpu;                 Check: Is64BitInstallMode()
  240. Source: "..\..\bin\Release32\plugins\ObjectManagerPlugin.dll";        DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\objectmanager;         Check: not Is64BitInstallMode()
  241. Source: "..\..\bin\Release64\plugins\ObjectManagerPlugin.dll";        DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\objectmanager;         Check: Is64BitInstallMode()
  242. Source: "..\..\bin\Release32\plugins\OnlineChecks.dll";               DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\onlinechecks;          Check: not Is64BitInstallMode()
  243. Source: "..\..\bin\Release64\plugins\OnlineChecks.dll";               DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\onlinechecks;          Check: Is64BitInstallMode()
  244. Source: "..\..\bin\Release32\plugins\PerfMonPlugin.dll";              DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\perfmon;               Check: not Is64BitInstallMode()
  245. Source: "..\..\bin\Release64\plugins\PerfMonPlugin.dll";              DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\perfmon;               Check: Is64BitInstallMode()
  246. Source: "..\..\bin\Release32\plugins\PoolMonPlugin.dll";              DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\poolmon;               Check: not Is64BitInstallMode()
  247. Source: "..\..\bin\Release64\plugins\PoolMonPlugin.dll";              DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\poolmon;               Check: Is64BitInstallMode()
  248. Source: "..\..\bin\Release32\plugins\ProductPolicyPlugin.dll";        DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\productpolicy;         Check: not Is64BitInstallMode()
  249. Source: "..\..\bin\Release64\plugins\ProductPolicyPlugin.dll";        DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\productpolicy;         Check: Is64BitInstallMode()
  250. Source: "..\..\bin\Release32\plugins\ROTViewerPlugin.dll";            DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\rotviewer;             Check: not Is64BitInstallMode()
  251. Source: "..\..\bin\Release64\plugins\ROTViewerPlugin.dll";            DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\rotviewer;             Check: Is64BitInstallMode()
  252. Source: "..\..\bin\Release32\plugins\SbieSupport.dll";                DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\sbiesupport;           Check: not Is64BitInstallMode()
  253. Source: "..\..\bin\Release64\plugins\SbieSupport.dll";                DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\sbiesupport;           Check: Is64BitInstallMode()
  254. Source: "..\..\bin\Release32\plugins\SecurityExplorer.dll";           DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\secexp;                Check: not Is64BitInstallMode()
  255. Source: "..\..\bin\Release64\plugins\SecurityExplorer.dll";           DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\secexp;                Check: Is64BitInstallMode()
  256. Source: "..\..\bin\Release32\plugins\ServiceBackupRestorePlugin.dll"; DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\srvbakrst;             Check: not Is64BitInstallMode()
  257. Source: "..\..\bin\Release64\plugins\ServiceBackupRestorePlugin.dll"; DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\srvbakrst;             Check: Is64BitInstallMode()
  258. Source: "..\..\bin\Release32\plugins\SetCriticalPlugin.dll";          DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\setcrtical;            Check: not Is64BitInstallMode()
  259. Source: "..\..\bin\Release64\plugins\SetCriticalPlugin.dll";          DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\setcrtical;            Check: Is64BitInstallMode()
  260. Source: "..\..\bin\Release32\plugins\TaskbarExtPlugin.dll";           DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\taskbarext;            Check: not Is64BitInstallMode()
  261. Source: "..\..\bin\Release64\plugins\TaskbarExtPlugin.dll";           DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\taskbarext;            Check: Is64BitInstallMode()
  262. Source: "..\..\bin\Release32\plugins\TerminatorPlugin.dll";           DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\taskbarext;            Check: not Is64BitInstallMode()
  263. Source: "..\..\bin\Release64\plugins\TerminatorPlugin.dll";           DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\taskbarext;            Check: Is64BitInstallMode()
  264. Source: "..\..\bin\Release32\plugins\ToolStatus.dll";                 DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\toolstatus;            Check: not Is64BitInstallMode()
  265. Source: "..\..\bin\Release64\plugins\ToolStatus.dll";                 DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\toolstatus;            Check: Is64BitInstallMode()
  266. Source: "..\..\bin\Release32\plugins\TrustedInstallerPlugin.dll";     DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\trustinst;             Check: not Is64BitInstallMode()
  267. Source: "..\..\bin\Release64\plugins\TrustedInstallerPlugin.dll";     DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\trustinst;             Check: Is64BitInstallMode()
  268. Source: "..\..\bin\Release64\plugins\FirmwarePlugin.dll";             DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\uefi;                  Check: Is64BitInstallMode()
  269. Source: "..\..\bin\Release32\plugins\FirmwarePlugin.dll";             DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\uefi;                  Check: not Is64BitInstallMode()
  270. Source: "..\..\bin\Release32\plugins\Updater.dll";                    DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\updater;               Check: not Is64BitInstallMode()
  271. Source: "..\..\bin\Release64\plugins\Updater.dll";                    DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\updater;               Check: Is64BitInstallMode()
  272. Source: "..\..\bin\Release32\plugins\UserNotes.dll";                  DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\usernotes;             Check: not Is64BitInstallMode()
  273. Source: "..\..\bin\Release64\plugins\UserNotes.dll";                  DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\usernotes;             Check: Is64BitInstallMode()
  274. Source: "..\..\bin\Release32\plugins\WaitChainPlugin.dll";            DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\waitchain;             Check: not Is64BitInstallMode()
  275. Source: "..\..\bin\Release64\plugins\WaitChainPlugin.dll";            DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\waitchain;             Check: Is64BitInstallMode()
  276. Source: "..\..\bin\Release32\plugins\WindowExplorer.dll";             DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\windowexplorer;        Check: not Is64BitInstallMode()
  277. Source: "..\..\bin\Release64\plugins\WindowExplorer.dll";             DestDir: "{app}\plugins";            Flags: ignoreversion;                                                    Components: plugins\windowexplorer;        Check: Is64BitInstallMode()
  278.  
  279. Source: "{userappdata}\Process Hacker 2\settings.xml";                DestDir: "{userappdata}\Process Hacker"; Flags: external ignoreversion overwritereadonly uninsremovereadonly skipifsourcedoesntexist;                    Check: IsUpgrade;                  AfterInstall: CorrectSetting
  280. Source: "{userappdata}\Process Hacker 2\usernotesdb.xml";             DestDir: "{userappdata}\Process Hacker"; Flags: external ignoreversion overwritereadonly uninsremovereadonly skipifsourcedoesntexist
  281.  
  282. Source: "Icons_Full\uninstall.ico";                                   DestDir: "{app}";                     Flags: ignoreversion
  283.  
  284. [Icons]
  285. Name: {group}\PE Viewer;                                          Filename: {app}\peview.exe;        WorkingDir: {app}; Comment: PE Viewer; IconFilename: {app}\peview.exe; IconIndex: 0; Components: peview; Flags: excludefromshowinnewinstall
  286. Name: {group}\Process Hacker;                                     Filename: {app}\ProcessHacker.exe; WorkingDir: {app}; Comment: Process Hacker {#app_version}; IconFilename: {app}\ProcessHacker.exe; IconIndex: 0
  287. Name: {group}\{cm:sm_Help}\{cm:sm_Changelog};                     Filename: {app}\CHANGELOG.txt;     WorkingDir: {app}; Comment: {cm:sm_com_Changelog}
  288. Name: {group}\{cm:sm_Help}\{cm:ProgramOnTheWeb,Process Hacker};   Filename: http://processhacker.sourceforge.net/;      Comment: {cm:ProgramOnTheWeb,Process Hacker}
  289. Name: {group}\{cm:UninstallProgram,Process Hacker};               Filename: {uninstallexe};          WorkingDir: {app}; Comment: {cm:UninstallProgram,Process Hacker}; IconFilename: {app}\uninstall.ico
  290.  
  291. Name: {commondesktop}\Process Hacker;                             Filename: {app}\ProcessHacker.exe; WorkingDir: {app}; Comment: Process Hacker {#app_version}; IconFilename: {app}\ProcessHacker.exe; IconIndex: 0; Tasks: desktopicon\common
  292. Name: {userdesktop}\Process Hacker;                               Filename: {app}\ProcessHacker.exe; WorkingDir: {app}; Comment: Process Hacker {#app_version}; IconFilename: {app}\ProcessHacker.exe; IconIndex: 0; Tasks: desktopicon\user
  293. Name: {#quick_launch}\Process Hacker;                             Filename: {app}\ProcessHacker.exe; WorkingDir: {app}; Comment: Process Hacker {#app_version}; IconFilename: {app}\ProcessHacker.exe; IconIndex: 0; Tasks: quicklaunchicon
  294.  
  295. [InstallDelete]
  296. Type: files; Name: "{userdesktop}\Process Hacker.lnk";                 Check: IsTaskSelected('desktopicon\user')   and IsUpgrade()
  297. Type: files; Name: "{commondesktop}\Process Hacker.lnk";               Check: IsTaskSelected('desktopicon\common') and IsUpgrade()
  298. Type: files; Name: "{#quick_launch}\Process Hacker.lnk";               Check: IsTaskSelected('quicklaunchicon')    and IsUpgrade(); OnlyBelowVersion: 6.02
  299.  
  300. Type: files; Name: "{userdesktop}\Process Hacker.lnk";                 Check: IsTaskSelected('deldesktop_user')    and IsUpgrade()
  301. Type: files; Name: "{commondesktop}\Process Hacker.lnk";               Check: IsTaskSelected('deldesktop_common')  and IsUpgrade()
  302. Type: files; Name: "{#quick_launch}\Process Hacker.lnk";               Check: IsTaskSelected('delquicklaunch')     and IsUpgrade(); OnlyBelowVersion: 6.02
  303.  
  304. Type: files; Name: "{group}\Help and Support\Process Hacker Help.lnk"; Check: IsUpgrade()
  305.  
  306. Type: files;      Name: "{userappdata}\Process Hacker\settings.xml";   Tasks: reset_settings
  307. Type: dirifempty; Name: "{userappdata}\Process Hacker";                Tasks: reset_settings
  308.  
  309. Type: files; Name: "{app}\Help.htm";                               Check: IsUpgrade()
  310. Type: files; Name: "{app}\peview.exe";                             Check: not IsComponentSelected('peview')                        and IsUpgrade()
  311. Type: files; Name: "{group}\PE Viewer.lnk";                        Check: not IsComponentSelected('peview')                        and IsUpgrade()
  312. Type: filesandordirs; Name: "{app}\plugins\maxminddb"
  313. Type: filesandordirs; Name: "{app}\plugins\kph2"
  314. Type: files; Name: "{app}\plugins\AtomTablePlugin.dll";            Check: not IsComponentSelected('plugins\atomtable')             and IsUpgrade()
  315. Type: files; Name: "{app}\plugins\AvgCpuPlugin.dll";               Check: not IsComponentSelected('plugins\avgcpu')                and IsUpgrade()
  316. Type: files; Name: "{app}\plugins\BootEntriesPlugin.dll";
  317. Type: files; Name: "{app}\plugins\CommonUtil.dll";
  318. Type: files; Name: "{app}\plugins\DbgViewPlugin.dll";              Check: not IsComponentSelected('plugins\dbgview')               and IsUpgrade()
  319. Type: files; Name: "{app}\plugins\DiskDrivesPlugin.dll"
  320. Type: files; Name: "{app}\plugins\DnsCachePlugin.dll";             Check: not IsComponentSelected('plugins\dnscache')              and IsUpgrade()
  321. Type: files; Name: "{app}\plugins\DotNetTools.dll";                Check: not IsComponentSelected('plugins\dotnettools')           and IsUpgrade()
  322. Type: files; Name: "{app}\plugins\EnvironmentEditPlugin.dll"
  323. Type: files; Name: "{app}\plugins\ExtendedNotifications.dll";      Check: not IsComponentSelected('plugins\extendednotifications') and IsUpgrade()
  324. Type: files; Name: "{app}\plugins\ExtendedServices.dll";           Check: not IsComponentSelected('plugins\extendedservices')      and IsUpgrade()
  325. Type: files; Name: "{app}\plugins\ExtendedTools.dll";              Check: not IsComponentSelected('plugins\extendedtools')         and IsUpgrade()
  326. Type: files; Name: "{app}\plugins\ExtraPlugins.dll"
  327. Type: files; Name: "{app}\plugins\FirewallMonitor.dll";            Check: not IsComponentSelected('plugins\fwmon')                 and IsUpgrade()
  328. Type: files; Name: "{app}\plugins\FirmwarePlugin.dll";             Check: not IsComponentSelected('plugins\uefi')                  and IsUpgrade()
  329. Type: files; Name: "{app}\plugins\ForceShutdownPlugin.dll";        Check: not IsComponentSelected('plugins\forceshutdown')         and IsUpgrade()
  330. Type: files; Name: "{app}\plugins\GraphicsInfo.dll";               Check: not IsComponentSelected('plugins\gfxinfo')               and IsUpgrade()
  331. Type: files; Name: "{app}\plugins\HardwareDevices.dll";            Check: not IsComponentSelected('plugins\hardwaredevices')       and IsUpgrade()
  332. Type: files; Name: "{app}\plugins\HexPidPlugin.dll";               Check: not IsComponentSelected('plugins\hexpid')                and IsUpgrade()
  333. Type: files; Name: "{app}\plugins\HighlightPlugin.dll"
  334. Type: files; Name: "{app}\plugins\LiveDumpPlugin.dll";             Check: not IsComponentSelected('plugins\livedump')              and IsUpgrade()
  335. Type: files; Name: "{app}\plugins\MemoryExtPlugin.dll";            Check: not IsComponentSelected('plugins\memext')                and IsUpgrade()
  336. Type: files; Name: "{app}\plugins\NetAdapters.dll"
  337. Type: files; Name: "{app}\plugins\NetAdaptersPlugin.dll"
  338. Type: files; Name: "{app}\plugins\NetExtrasPlugin.dll"
  339. Type: files; Name: "{app}\plugins\NetworkTools.dll";               Check: not IsComponentSelected('plugins\networktools')          and IsUpgrade()
  340. Type: files; Name: "{app}\plugins\NvGpuPlugin.dll";                Check: not IsComponentSelected('plugins\nvgpu')                 and IsUpgrade()
  341. Type: files; Name: "{app}\plugins\ObjectManagerPlugin.dll";        Check: not IsComponentSelected('plugins\objectmanager')         and IsUpgrade()
  342. Type: files; Name: "{app}\plugins\OnlineChecks.dll";               Check: not IsComponentSelected('plugins\onlinechecks')          and IsUpgrade()
  343. Type: files; Name: "{app}\plugins\PerfMonPlugin.dll";              Check: not IsComponentSelected('plugins\perfmon')               and IsUpgrade()
  344. Type: files; Name: "{app}\plugins\plugindata\GeoLite2-City.mmdb"
  345. Type: files; Name: "{app}\plugins\PoolMonPlugin.dll";              Check: not IsComponentSelected('plugins\poolmon')               and IsUpgrade()
  346. Type: files; Name: "{app}\plugins\ProcessActions.dll";             Check: not IsComponentSelected('plugins\processactions')        and IsUpgrade()
  347. Type: files; Name: "{app}\plugins\ProductPolicyPlugin.dll";        Check: not IsComponentSelected('plugins\productpolicy')         and IsUpgrade()
  348. Type: files; Name: "{app}\plugins\ROTViewerPlugin.dll";            Check: not IsComponentSelected('plugins\rotviewer')             and IsUpgrade()
  349. Type: files; Name: "{app}\plugins\SbieSupport.dll";                Check: not IsComponentSelected('plugins\sbiesupport')           and IsUpgrade()
  350. Type: files; Name: "{app}\plugins\SecurityExplorer.dll";           Check: not IsComponentSelected('plugins\secexp')                and IsUpgrade()
  351. Type: files; Name: "{app}\plugins\ServiceBackupRestorePlugin.dll"; Check: not IsComponentSelected('plugins\srvbakrst')             and IsUpgrade()
  352. Type: files; Name: "{app}\plugins\ServiceExtrasPlugin.dll"
  353. Type: files; Name: "{app}\plugins\SetCriticalPlugin.dll";          Check: not IsComponentSelected('plugins\setcrtical')            and IsUpgrade()
  354. Type: files; Name: "{app}\plugins\TaskbarExtPlugin.dll";           Check: not IsComponentSelected('plugins\taskbarext')            and IsUpgrade()
  355. Type: files; Name: "{app}\plugins\TerminatorPlugin.dll";           Check: not IsComponentSelected('plugins\terminator')            and IsUpgrade()
  356. Type: files; Name: "{app}\plugins\ToolStatus.dll";                 Check: not IsComponentSelected('plugins\toolstatus')            and IsUpgrade()
  357. Type: files; Name: "{app}\plugins\TrustedInstallerPlugin.dll";     Check: not IsComponentSelected('plugins\trustinst')             and IsUpgrade()
  358. Type: files; Name: "{app}\plugins\UMDFHostPlugin.dll"
  359. Type: files; Name: "{app}\plugins\Updater.dll";                    Check: not IsComponentSelected('plugins\updater')               and IsUpgrade()
  360. Type: files; Name: "{app}\plugins\UserNotes.dll";                  Check: not IsComponentSelected('plugins\usernotes')             and IsUpgrade()
  361. Type: files; Name: "{app}\plugins\WaitChainPlugin.dll";            Check: not IsComponentSelected('plugins\waitchain')             and IsUpgrade()
  362. Type: files; Name: "{app}\plugins\WindowExplorer.dll";             Check: not IsComponentSelected('plugins\windowexplorer')        and IsUpgrade()
  363. Type: dirifempty; Name: "{app}\plugins"
  364.  
  365. [Run]
  366. Filename: {app}\ProcessHacker.exe;               Description: {cm:LaunchProgram,Process Hacker}; Flags: nowait postinstall skipifsilent
  367. Filename: {app}\CHANGELOG.txt;                   Description: {cm:run_ViewChangelog};              Flags: nowait postinstall skipifsilent unchecked shellexec
  368. Filename: {#website_url};                        Description: {cm:run_VisitWebsite};               Flags: nowait postinstall skipifsilent unchecked shellexec
  369.  
  370. [Registry]
  371. Root: "HKCU"; Subkey: "Software\ProcessHacker"; Flags: dontcreatekey noerror deletekey uninsdeletekey
  372.  
  373. [Code]
  374. const
  375.   installer_mutex = 'process_hacker_setup_mutex';
  376.   IFEO            = 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe';
  377.   HKCURUN         = 'Software\Microsoft\Windows\CurrentVersion\Run';
  378.  
  379. function IsUpdKPH(): Boolean;
  380. var
  381.    x86: String;
  382.    x64: String;
  383.  
  384. begin
  385.    x86 := '5452339315254a3b7f236a10c3d1ce09d04131e3';
  386.    x64 := '624a63232e0acc4992ce01f3e836711e4f6da2f1';
  387.  
  388.    if Is64BitInstallMode() then
  389.    Result := (GetSHA1OfFile(ExpandConstant('{app}\kprocesshacker.sys')) <> x64)
  390.    else
  391.    Result := (GetSHA1OfFile(ExpandConstant('{app}\kprocesshacker.sys')) <> x86);
  392. end;
  393.  
  394.  
  395. function IsUpgrade(): Boolean;
  396. var
  397.   sPrevPath: String;
  398. begin
  399.   sPrevPath := WizardForm.PrevAppDir;
  400.   Result := (sPrevPath <> '');
  401. end;
  402.  
  403.  
  404. function NeedRestart(): Boolean;
  405. begin
  406.     Result := False;
  407.     if IsServiceStopPending('KProcessHacker3') then
  408.     Result := True;
  409. end;  
  410.  
  411.  
  412. function ShouldSkipPage(PageID: Integer): Boolean;
  413. begin
  414.   // Hide the License and the Ready to install page if it's an upgrade
  415.   if IsUpgrade() and (PageID = wpLicense) or (PageID = wpReady) then
  416.     Result := True;
  417. end;
  418.  
  419.  
  420. // Check if KProcessHacker is installed as a service
  421. function KPHServiceCheck(): Boolean;
  422. var
  423.   dwStart: DWORD;
  424. begin
  425.   if RegQueryDWordValue(HKLM, 'SYSTEM\CurrentControlSet\Services\KProcessHacker3', 'Start', dwStart) then begin
  426.     if dwStart = 1 then
  427.       Result := True;
  428.   end else
  429.     Result := False;
  430. end;
  431.  
  432.  
  433. // Check if Process Hacker is set as the default Task Manager for Windows
  434. function PHDefaulTaskmgrCheck(): Boolean;
  435. var
  436.   sDebugger: String;
  437. begin
  438.   if RegQueryStringValue(HKLM, IFEO, 'Debugger', sDebugger) then begin
  439.     if sDebugger = (ExpandConstant('"{app}\ProcessHacker.exe"')) then
  440.       Result := True;
  441.   end else
  442.     Result := False;
  443. end;
  444.  
  445.  
  446. // Check if Process Hacker's settings exist
  447. function SettingsExistCheck(): Boolean;
  448. begin
  449.   if FileExists(ExpandConstant('{userappdata}\Process Hacker\settings.xml')) then
  450.     Result := True
  451.   else
  452.     Result := False;
  453. end;
  454.  
  455.  
  456. // Check if Process Hacker is configured to run on startup in order to control
  457. // startup choice from within the installer
  458. function StartupCheck(): Boolean;
  459. var
  460.   svalue: String;
  461. begin
  462.   if RegQueryStringValue(HKCU, HKCURUN, 'Process Hacker', svalue) then begin
  463.     if (svalue = (ExpandConstant('"{app}\ProcessHacker.exe"'))) or (svalue = (ExpandConstant('"{app}\ProcessHacker.exe" -hide'))) then
  464.       Result := True;
  465.   end else
  466.     Result := False;
  467. end;
  468.  
  469.  
  470. // Correct usernotesdb.xml patch
  471. procedure CorrectSetting();
  472. var
  473.       FndStr: String;  
  474. begin
  475.   if IsUpgrade() and FileExists(ExpandConstant('{userappdata}\Process Hacker 2\usernotesdb.xml')) then
  476.   begin
  477.   FndStr := '<setting name="ProcessHacker.UserNotes.DatabasePath">%APPDATA%\Process Hacker 2\usernotesdb.xml</setting>';
  478.   StringChangeEx(FndStr, 'Process Hacker 2', 'Process Hacker', True);
  479.   end
  480. end;
  481.  
  482.  
  483. procedure CurPageChanged(CurPageID: Integer);
  484. begin
  485.   if IsUpgrade() and (CurPageID = wpSelectTasks) then
  486.     WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall);
  487. end;
  488.  
  489.  
  490. procedure CurStepChanged(CurStep: TSetupStep);
  491. var
  492.   iResultCode: Integer;
  493. begin
  494.   if CurStep = ssInstall then begin
  495.     if IsUpdKPH() and IsServiceRunning('KProcessHacker3') then
  496.     begin
  497.     StopService('KProcessHacker3');
  498.     Sleep(1500);
  499.     NeedRestart();
  500.     end;
  501.     if IsTaskSelected('delete_KPH_service') then
  502.     begin
  503.       StopService('KProcessHacker2');
  504.       StopService('KProcessHacker3');
  505.       RemoveService('KProcessHacker2');
  506.       RemoveService('KProcessHacker3');    
  507.     end;
  508.    end;
  509.  
  510.  
  511.   if CurStep = ssPostInstall then begin
  512.     if IsTaskSelected('create_KPH_service') then begin
  513.       if not Exec(ExpandConstant('{app}\ProcessHacker.exe'), '-installkph -s', '', SW_HIDE, ewWaitUntilTerminated, iResultCode) then begin
  514.         // handle failure if necessary; iResultCode contains the error code
  515.     end;
  516.   end;
  517.  
  518.     if IsTaskSelected('set_default_taskmgr') then
  519.       RegWriteStringValue(HKLM, IFEO, 'Debugger', ExpandConstant('"{app}\ProcessHacker.exe"'));
  520.     if IsTaskSelected('restore_taskmgr') then begin
  521.       RegDeleteValue(HKLM, IFEO, 'Debugger');
  522.       RegDeleteKeyIfEmpty(HKLM, IFEO);
  523.     end;
  524.  
  525.     if IsTaskSelected('startup') then
  526.       RegWriteStringValue(HKCU, HKCURUN, 'Process Hacker', ExpandConstant('"{app}\ProcessHacker.exe"'));
  527.     if IsTaskSelected('startup\minimized') then
  528.       RegWriteStringValue(HKCU, HKCURUN, 'Process Hacker', ExpandConstant('"{app}\ProcessHacker.exe" -hide'));
  529.     if IsTaskSelected('remove_startup') then
  530.       RegDeleteValue(HKCU, HKCURUN, 'Process Hacker');
  531.     end;
  532. end;
  533.  
  534. procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
  535. begin
  536.   if CurUninstallStep = usUninstall then begin
  537.     StopService('KProcessHacker3');
  538.     RemoveService('KProcessHacker3');
  539.  
  540.     // When uninstalling ask user to delete Process Hacker's settings
  541.     // based on whether the settings file exists only
  542.     if SettingsExistCheck() then begin
  543.       if SuppressibleMsgBox(CustomMessage('msg_DeleteLogSettings'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2, IDNO) = IDYES then
  544.         DeleteFile(ExpandConstant('{userappdata}\Process Hacker\settings.xml'));
  545.     end;
  546.  
  547.     if PHDefaulTaskmgrCheck() then
  548.       RegDeleteValue(HKLM, IFEO, 'Debugger');
  549.     RegDeleteKeyIfEmpty(HKLM, IFEO);
  550.     if StartupCheck() then
  551.       RegDeleteValue(HKCU, HKCURUN, 'Process Hacker');
  552.  
  553.     RemoveDir(ExpandConstant('{userappdata}\Process Hacker'));
  554.     RemoveDir(ExpandConstant('{app}\plugins'));
  555.     RemoveDir(ExpandConstant('{app}'));
  556.  
  557.   end;
  558. end;
  559.  
  560.  
  561. procedure InitializeWizard();
  562. begin
  563.   WizardForm.SelectTasksLabel.Hide;
  564.   WizardForm.TasksList.Top    := 0;
  565.   WizardForm.TasksList.Height := PageFromID(wpSelectTasks).SurfaceHeight;
  566. end;
  567.  
  568.  
  569. function InitializeSetup(): Boolean;
  570. begin
  571.   // Create a mutex for the installer and if it's already running then expose a message and stop installation
  572.   if CheckForMutexes(installer_mutex) and not WizardSilent() then begin
  573.     SuppressibleMsgBox(CustomMessage('msg_SetupIsRunningWarning'), mbError, MB_OK, MB_OK);
  574.     Result := False;
  575.   end
  576.   else begin
  577.     Result := True;
  578.     CreateMutex(installer_mutex);
  579.   end;
  580. end;
  581.  
  582.  
  583. function InitializeUninstall(): Boolean;
  584. begin
  585.   if CheckForMutexes(installer_mutex) then begin
  586.     SuppressibleMsgBox(CustomMessage('msg_SetupIsRunningWarning'), mbError, MB_OK, MB_OK);
  587.     Result := False;
  588.   end
  589.   else begin
  590.     Result := True;
  591.     CreateMutex(installer_mutex);
  592.   end;
  593. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement