summaryrefslogtreecommitdiff
path: root/src/SMAPI.Installer/assets/windows-install.bat
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Installer/assets/windows-install.bat')
-rw-r--r--src/SMAPI.Installer/assets/windows-install.bat35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/SMAPI.Installer/assets/windows-install.bat b/src/SMAPI.Installer/assets/windows-install.bat
index 2e0be906..e34b9554 100644
--- a/src/SMAPI.Installer/assets/windows-install.bat
+++ b/src/SMAPI.Installer/assets/windows-install.bat
@@ -1,6 +1,7 @@
@echo off
+setlocal enabledelayedexpansion
-SET installerDir=%~dp0
+SET installerDir="%~dp0"
REM make sure we're not running within a zip folder
echo %installerDir% | findstr /C:"%TEMP%" 1>nul
@@ -12,23 +13,37 @@ 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
)
REM make sure an antivirus hasn't deleted the installer DLL
-if not exist "%installerDir%internal\windows\SMAPI.Installer.dll" (
+if not exist %installerDir%"internal\windows\SMAPI.Installer.dll" (
echo Oops! SMAPI is missing one of its files. Your antivirus might have deleted it.
echo Missing file: %installerDir%internal\windows\SMAPI.Installer.dll
echo.