diff --git a/CheckPython.bat b/CheckPython.bat new file mode 100644 index 0000000..0efe7b2 --- /dev/null +++ b/CheckPython.bat @@ -0,0 +1,25 @@ +@echo off +Setlocal EnableDelayedExpansion +python CheckPython.py >nul 2>&1 +IF !ERRORLEVEL! NEQ 3 ( + WHERE winget + IF !ERRORLEVEL! NEQ 0 ( + echo It appears you do not have Python installed! Please install Python 3.9 or higher from python.org or the Microsoft Store. + pause + exit + ) ELSE ( + choice /C:yn /m "You do not have Python installed. Do you wish to install it? [Y] / [N]" + if !ERRORLEVEL! == 1 ( + echo Please accept any licence agreements after this to install python by pressing Y then enter. + winget install python + if !ERRORLEVEL! NEQ 0 ( + echo For some reason Python failed to install with winget, install Python manually with the windows store or using python.org + echo Feel free to contact the vrc-osc-scripts Discord for more help. + pause + exit + ) + ) + ) +) ELSE ( + echo Python is installed! +) \ No newline at end of file diff --git a/CheckPython.py b/CheckPython.py new file mode 100644 index 0000000..1154cfc --- /dev/null +++ b/CheckPython.py @@ -0,0 +1,4 @@ +# This script returns 3. + +if __name__ == "__main__": + exit(3) \ No newline at end of file diff --git a/RunVRCNowPlaying.bat b/RunVRCNowPlaying.bat index 5a36336..c2a2d0f 100644 --- a/RunVRCNowPlaying.bat +++ b/RunVRCNowPlaying.bat @@ -1,4 +1,5 @@ @echo off +call CheckPython.bat call UpdateScripts.bat echo [%~n0] Installing requirements (be sure to have python installed and in PATH) python -m pip install -r VRCNowPlaying/Requirements.txt -q diff --git a/RunVRCSubs.bat b/RunVRCSubs.bat index bf59aa7..5ae6389 100644 --- a/RunVRCSubs.bat +++ b/RunVRCSubs.bat @@ -1,4 +1,5 @@ @echo off +call CheckPython.bat call UpdateScripts.bat echo [%~n0] Installing requirements (be sure to have python installed and in PATH) python -m pip install -r VRCSubs/Requirements.txt -q