aboutsummaryrefslogtreecommitdiff
path: root/installer
diff options
context:
space:
mode:
Diffstat (limited to 'installer')
-rw-r--r--installer/pip_install.cmd25
1 files changed, 25 insertions, 0 deletions
diff --git a/installer/pip_install.cmd b/installer/pip_install.cmd
index 9b8a0b1..c551b7b 100644
--- a/installer/pip_install.cmd
+++ b/installer/pip_install.cmd
@@ -8,6 +8,30 @@ rd /Q /S "%server_dir%" 2>NUL
md "%server_dir%"
cd "%server_dir%"
+where python && goto :python
+:python_fail
+where python3 && goto :python3
+:python3_fail
+goto :EOF
+
+:python
+python -c "import sys; from distutils.version import LooseVersion;sys.exit(0 if (LooseVersion(sys.version) > LooseVersion('3')) else 1)"
+if errorlevel 1 goto :python_fail
+
+python -m venv ./venv
+venv\Scripts\pip3 install %2
+
+echo @echo off ^
+
+%%~dp0\venv\Scripts\%1.exe %%* ^
+
+> %1.cmd
+goto :EOF
+
+:python3
+python3 -c "import sys; from distutils.version import LooseVersion;sys.exit(0 if (LooseVersion(sys.version) > LooseVersion('3')) else 1)"
+if errorlevel 1 goto :python3_fail
+
python3 -m venv ./venv
venv\bin\pip3 install %2
@@ -16,3 +40,4 @@ echo @echo off ^
%%~dp0\venv\bin\%1.cmd %%* ^
> %1.cmd
+goto :EOF