From 05b06e7a9faccfa0998bc3f7f9953817cd473bfb Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 30 Nov 2021 21:53:09 -0500 Subject: improve installer's .NET 5 validation to explain how to fix it --- src/SMAPI.Installer/assets/windows-install.bat | 31 +++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'src/SMAPI.Installer/assets') diff --git a/src/SMAPI.Installer/assets/windows-install.bat b/src/SMAPI.Installer/assets/windows-install.bat index f21679ae..e34b9554 100644 --- a/src/SMAPI.Installer/assets/windows-install.bat +++ b/src/SMAPI.Installer/assets/windows-install.bat @@ -1,4 +1,5 @@ @echo off +setlocal enabledelayedexpansion SET installerDir="%~dp0" @@ -12,16 +13,30 @@ if %ERRORLEVEL% EQU 0 ( ) REM make sure .NET 5 is installed +SET hasNet5=1 WHERE dotnet /q -if %ERRORLEVEL% NEQ 0 ( - echo Oops! You must have .NET 5 ^(desktop x64^) installed to use SMAPI: https://dotnet.microsoft.com/download/dotnet/5.0/runtime - echo. - pause - exit +if !ERRORLEVEL! NEQ 0 ( + SET hasNet5=0 +) else ( + dotnet --info | findstr /C:"Microsoft.WindowsDesktop.App 5." 1>nul + if !ERRORLEVEL! NEQ 0 ( + SET hasNet5=0 + ) ) -dotnet --info | findstr /C:"Microsoft.WindowsDesktop.App 5." 1>nul -if %ERRORLEVEL% NEQ 0 ( - echo Oops! You must have .NET 5 ^(desktop x64^) installed to use SMAPI: https://dotnet.microsoft.com/download/dotnet/5.0/runtime +if "%hasNet5%" == "0" ( + echo Oops! You don't have the required .NET version installed. + echo. + echo To install it: + echo 1. Go to https://dotnet.microsoft.com/download/dotnet/5.0/runtime + + if "%PROCESSOR_ARCHITECTURE%" == "ARM64" ( + echo 2. Under "Run desktop apps", click "Download Arm64". + ) else ( + echo 2. Under "Run desktop apps", click "Download x64". + ) + + echo 3. Run the downloaded installer. + echo 4. Restart your computer. echo. pause exit -- cgit