Update run batch scripts to no longer depend on advancedrun

This commit is contained in:
Fierelier 2022-06-28 08:11:28 +02:00
parent 693bf97255
commit 689c562dfb
2 changed files with 27 additions and 23 deletions

View File

@ -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

25
run.bat
View File

@ -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