Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to detect Python and install it if not #26

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CheckPython.bat
Original file line number Diff line number Diff line change
@@ -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!
)
4 changes: 4 additions & 0 deletions CheckPython.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This script returns 3.

if __name__ == "__main__":
exit(3)
1 change: 1 addition & 0 deletions RunVRCNowPlaying.bat
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions RunVRCSubs.bat
Original file line number Diff line number Diff line change
@@ -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
Expand Down