From bcbb7d923a6a19c043b1bb01ffc0d1ec466b052d Mon Sep 17 00:00:00 2001 From: xhmikosr Date: Tue, 10 Nov 2009 12:57:51 +0000 Subject: [PATCH] Installer: *simplified the .NET 2.0 detection using the {dotnet20} constant *installer now does not show an error if .NET 2.0 is not installed, when running silently git-svn-id: svn://svn.code.sf.net/p/processhacker/code@2343 21ef857c-d57f-4fe0-8362-d861dc6d29cd --- .../Installer/Process_Hacker_installer.iss | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/1.x/trunk/ProcessHacker/Build/Installer/Process_Hacker_installer.iss b/1.x/trunk/ProcessHacker/Build/Installer/Process_Hacker_installer.iss index 3b162380c..c2fe6d916 100644 --- a/1.x/trunk/ProcessHacker/Build/Installer/Process_Hacker_installer.iss +++ b/1.x/trunk/ProcessHacker/Build/Installer/Process_Hacker_installer.iss @@ -374,8 +374,6 @@ function InitializeSetup(): Boolean; // Check if .NET Framework 2.0 is installed and if not offer to download it var ErrorCode: Integer; - NetFrameWorkInstalled : Boolean; - Result1 : Boolean; begin // Create a mutex for the installer and if it's already running then expose a message and stop installation if CheckForMutexes(installer_mutex_name) then begin @@ -385,18 +383,20 @@ begin end; CreateMutex(installer_mutex_name); - NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0'); - if NetFrameWorkInstalled then begin + try + ExpandConstant('{dotnet20}'); Result := True; - end else begin - Result1 := MsgBox(ExpandConstant('{cm:msg_AskToDownNET}'), mbCriticalError, MB_YESNO or MB_DEFBUTTON1) = IDYES; - if Result1 = False then begin - Result := False; - end else begin - Result := False; - ShellExec('open', 'http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe', - '','',SW_SHOWNORMAL,ewNoWait,ErrorCode); - end; + except + begin + if not WizardSilent() then + if MsgBox(ExpandConstant('{cm:msg_AskToDownNET}'), mbCriticalError, MB_YESNO or MB_DEFBUTTON1) = IDYES then begin + Result := False; + ShellExec('open', 'http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe', + '','',SW_SHOWNORMAL,ewNoWait,ErrorCode); + end else begin + Result := False; + end; + end; end; end;