From 6a1f543d7f0a9c4fc7cbd208437e26d53be37cd2 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 18 Feb 2023 17:52:46 +0530 Subject: [PATCH] inno: updated setup to install ASP.NET Core Runtime. --- DnsServerWindowsSetup/dotnet.iss | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/DnsServerWindowsSetup/dotnet.iss b/DnsServerWindowsSetup/dotnet.iss index 92368de3..d88b8bb0 100644 --- a/DnsServerWindowsSetup/dotnet.iss +++ b/DnsServerWindowsSetup/dotnet.iss @@ -305,12 +305,24 @@ end; { Check if dotnet is installed } +function IsAspDotNetInstalled: Boolean; +var + ResultCode: Integer; +begin + Result := false; + Exec('cmd.exe', '/c dotnet --list-runtimes | find /n "Microsoft.AspNetCore.App 7.0.3"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); + if ResultCode = 0 then + begin + Result := true; + end; +end; + function IsDotNetDesktopInstalled: Boolean; var ResultCode: Integer; begin Result := false; - Exec('cmd.exe', '/c dotnet --list-runtimes | find /n "Microsoft.WindowsDesktop.App 7.0.0"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); + Exec('cmd.exe', '/c dotnet --list-runtimes | find /n "Microsoft.WindowsDesktop.App 7.0.3"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); if ResultCode = 0 then begin Result := true; @@ -320,12 +332,21 @@ end; { if dotnet is not installed then add it for download } procedure CheckDotnetDependency; begin + if not IsAspDotNetInstalled then + begin + AddDependency('aspdotnet70' + GetArchitectureSuffix + '.exe', + '/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart', + 'ASP.NET Core Runtime 7.0.3' + GetArchitectureTitle, + GetString('https://download.visualstudio.microsoft.com/download/pr/4bf0f350-f947-408b-9ee4-539313b85634/b17087052d6192b5d59735ae6f208c19/aspnetcore-runtime-7.0.3-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/d37efccc-2ba1-4fc9-a1ef-a8e1e77fb681/b9a20fc29ff05f18d81620ec88ade699/aspnetcore-runtime-7.0.3-win-x64.exe'), + '', False, False, False); + end; + if not IsDotNetDesktopInstalled then begin AddDependency('dotnet70desktop' + GetArchitectureSuffix + '.exe', '/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart', - '.NET Desktop Runtime 7.0.0' + GetArchitectureTitle, - GetString('https://download.visualstudio.microsoft.com/download/pr/d05a833c-2cf9-4d06-89ae-a0f3e10c5c91/c668ff42e23c2f67aa3d80227860585f/windowsdesktop-runtime-7.0.0-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/5b2fbe00-507e-450e-8b52-43ab052aadf2/79d54c3a19ce3fce314f2367cf4e3b21/windowsdesktop-runtime-7.0.0-win-x64.exe'), + '.NET Desktop Runtime 7.0.3' + GetArchitectureTitle, + GetString('https://download.visualstudio.microsoft.com/download/pr/fb8bf100-9e1c-472c-8bc8-aa16fff44f53/8d36f5a56edff8620f9c63c1e73ba88c/windowsdesktop-runtime-7.0.3-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/3ebf014d-fcb9-4200-b3fe-76ba2000b027/840f2f95833ce400a9949e35f1581d28/windowsdesktop-runtime-7.0.3-win-x64.exe'), '', False, False, False); end; end;