-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller_python_-m.bat
More file actions
50 lines (40 loc) · 1.18 KB
/
installer_python_-m.bat
File metadata and controls
50 lines (40 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@echo off
@REM installer_python_-m.bat
setlocal
@REM If you are missing pip, use this
@REM python -m ensurepip --upgrade
REM Define the path to the Python executable
set "PYTHON_EXEC=C:\Program Files\Python313\python.exe"
REM Check if the Python executable exists
if not exist "%PYTHON_EXEC%" (
echo "%PYTHON_EXEC%" not found. Falling back to Python in PATH.
set "PYTHON_EXEC=python"
)
REM Define the working path
set "PACKAGE_DIR=%~dp0dist"
echo Using Python executable: %PYTHON_EXEC%
echo %PACKAGE_DIR%
REM Find the latest version of the package (wheel format)
for /f "delims=" %%i in ('dir /b /o-n "%PACKAGE_DIR%\ryan_functions-*.whl"') do (
set "LATEST_PACKAGE=%%i"
goto found
)
:found
if "%LATEST_PACKAGE%"=="" (
echo No package found in the directory.
pause
endlocal
goto :EOF
)
echo Installing or updating "%LATEST_PACKAGE%"
REM Install or update the package using pip
"%PYTHON_EXEC%" -m pip install --upgrade "%PACKAGE_DIR%\%LATEST_PACKAGE%"
REM Check if the installation was successful
if %ERRORLEVEL% equ 0 (
echo Installation completed successfully.
) else (
echo Installation failed. Please check the path and try again.
)
endlocal
pause
goto :EOF