From c91a5c80d39f6e9913f284f3c547ea3bbd90b7fe Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Wed, 25 Dec 2019 11:47:30 +0100 Subject: [PATCH] Added .NET Framework 4.7.2 requirement check to windows installer --- setup/sonarr.iss | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/setup/sonarr.iss b/setup/sonarr.iss index 4362e391b..a77709494 100644 --- a/setup/sonarr.iss +++ b/setup/sonarr.iss @@ -48,8 +48,8 @@ Name: "startupShortcut"; Description: "Create shortcut in Startup folder (Starts Name: "none"; Description: "Do not start automatically"; GroupDescription: "Start automatically"; Flags: exclusive unchecked [Files] -Source: "..\_output\Sonarr.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\_output\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "..\_output_windows\Sonarr.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\_output_windows\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] @@ -77,3 +77,26 @@ var begin Exec(ExpandConstant('{commonappdata}\NzbDrone\bin\NzbDrone.Console.exe'), '/u', '', 0, ewWaitUntilTerminated, ResultCode) end; + +function Framework472IsNotInstalled(): Boolean; +var + bSuccess: Boolean; + regVersion: Cardinal; +begin + Result := True; +bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', regVersion); + if (True = bSuccess) and (regVersion >= 461808) then begin + Result := False; + end; +end; + +function InitializeSetup(): Boolean; +begin + if Framework472IsNotInstalled() then begin + MsgBox('Sonarr requires Microsoft .NET Framework 4.7.2 or higher.'#13#13 + 'Please use Windows Update to install this version'#13 + 'or download it from https://dotnet.microsoft.com/download/dotnet-framework.', mbInformation, MB_OK); + result := false; + end else + result := true; +end; \ No newline at end of file