From 689c562dfbd38dac5a015463573fccf74db6f7e7 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Tue, 28 Jun 2022 08:11:28 +0200 Subject: [PATCH] Update run batch scripts to no longer depend on advancedrun --- run-online.bat | 25 ++++++++++++++----------- run.bat | 25 +++++++++++++------------ 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/run-online.bat b/run-online.bat index 9205557..6f3f731 100644 --- a/run-online.bat +++ b/run-online.bat @@ -1,17 +1,20 @@ @echo off -setlocal enabledelayedexpansion +setlocal cd /d "%~dp0" -set path=%cd%\path;%path% - -REM Location to your py.exe/python.exe - If the Python launcher is installed (fairly likely), py should suffice. -REM If Python does not launch, set this to the full path if your python.exe, like so: -REM set pyexe=C:\Program Files\Python38\python.exe -set pyexe=py - echo WARNING! This will apply opus-nt to your currently running OS. echo On Windows 10, make sure to disable tamper protection. pause -advancedrun /exefilename "cmd.exe" /commandline '/c "set path=%path% & call "%pyexe%" run.py online"' /startdirectory "%cd%" /runas 4 /waitprocess 1 /run -advancedrun /exefilename "cmd.exe" /commandline '/c "set path=%path% & call "%pyexe%" run.py online modpath=mods-trustedInstaller"' /startdirectory "%cd%" /runas 8 /waitprocess 1 /run -advancedrun /exefilename "cmd.exe" /commandline '/c "set path=%path% & call "%pyexe%" run.py online modpath=mods-online"' /startdirectory "%cd%" /runas 4 /waitprocess 1 /run +call "%pyexe%" run.py online +if not "%errorlevel%" == "0" goto error +call "%pyexe%" run.py online modpath=mods-trustedInstaller +if not "%errorlevel%" == "0" goto error +call "%pyexe%" run.py online modpath=mods-online +if not "%errorlevel%" == "0" goto error +goto exit + +:error +echo An error occured. +goto exit + +:exit pause \ No newline at end of file diff --git a/run.bat b/run.bat index 55e03d1..b0e287f 100644 --- a/run.bat +++ b/run.bat @@ -1,28 +1,29 @@ @echo off setlocal enabledelayedexpansion cd /d "%~dp0" -set path=%cd%\path;%path% - -REM Location to your py.exe/python.exe - If the Python launcher is installed (fairly likely), py should suffice. -REM If Python does not launch, set this to the full path if your python.exe, like so: -REM set pyexe=C:\Program Files\Python38\python.exe -set pyexe=py - REM Ask for wim file, if not set -set wim=%~1 +set "wim=%~2" if "%wim%" == "" ( set /p "wim=.wim: " set wim=!wim:"=! ) REM Ask for wim index, if not set -set index=%~2 +set "index=%~3" if "%index%" == "" ( set /p "index=Index (* for all): " set index=!index:"=! ) -set pyexe=%pyexe:"=% -advancedrun /exefilename "cmd.exe" /commandline '/c "set path=%path% & call "%pyexe%" run.py wim="%wim%" index=%index%"' /startdirectory "%cd%" /runas 4 /waitprocess 1 /run -advancedrun /exefilename "cmd.exe" /commandline '/c "set path=%path% & call "%pyexe%" run.py wim="%wim%" index=%index% modpath=mods-trustedInstaller"' /startdirectory "%cd%" /runas 8 /waitprocess 1 /run +call "%pyexe%" run.py wim="%wim%" index=%index% +if not "%errorlevel%" == "0" goto error +call "%pyexe%" run.py wim="%wim%" index=%index% modpath=mods-trustedInstaller +if not "%errorlevel%" == "0" goto error +goto exit + +:error +echo An error occured. +goto exit + +:exit pause \ No newline at end of file