-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0c9c125
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
@echo off | ||
|
||
REM Verifica la version de Python en python_embeded | ||
for /f "tokens=2 delims= " %%a in ('python_embeded\python.exe --version') do set PYTHON_VERSION=%%a | ||
|
||
REM Extrae la version principal y secundaria | ||
for /f "tokens=1,2 delims=." %%b in ("%PYTHON_VERSION%") do ( | ||
set PYTHON_MAJOR=%%b | ||
set PYTHON_MINOR=%%c | ||
) | ||
|
||
REM Determina la URL a descargar segun la version de Python | ||
set WHL_URL= | ||
if %PYTHON_MAJOR%==3 ( | ||
if %PYTHON_MINOR% geq 9 if %PYTHON_MINOR% lss 10 set WHL_URL=https://github.com/woct0rdho/triton-windows/releases/download/v3.1.0-windows.post5/triton-3.1.0-cp39-cp39-win_amd64.whl | ||
if %PYTHON_MINOR% geq 10 if %PYTHON_MINOR% lss 11 set WHL_URL=https://github.com/woct0rdho/triton-windows/releases/download/v3.1.0-windows.post5/triton-3.1.0-cp310-cp310-win_amd64.whl | ||
if %PYTHON_MINOR% geq 11 if %PYTHON_MINOR% lss 12 set WHL_URL=https://github.com/woct0rdho/triton-windows/releases/download/v3.1.0-windows.post5/triton-3.1.0-cp311-cp311-win_amd64.whl | ||
if %PYTHON_MINOR% geq 12 if %PYTHON_MINOR% lss 13 set WHL_URL=https://github.com/woct0rdho/triton-windows/releases/download/v3.1.0-windows.post5/triton-3.1.0-cp312-cp312-win_amd64.whl | ||
) | ||
|
||
REM Comprueba si se establecio una URL valida | ||
if "%WHL_URL%"=="" ( | ||
echo No se encontro una version compatible de Python. | ||
pause | ||
exit /b | ||
) | ||
|
||
REM Extrae el nombre del archivo de la URL | ||
for %%i in (%WHL_URL%) do set WHL_FILE=%%~nxi | ||
|
||
REM Descarga el archivo .whl correspondiente | ||
powershell -command "Invoke-WebRequest -Uri %WHL_URL% -OutFile %WHL_FILE%" | ||
|
||
REM Verifica si la descarga fue exitosa | ||
if not exist "%WHL_FILE%" ( | ||
echo Error al descargar %WHL_FILE%. | ||
pause | ||
exit /b | ||
) | ||
|
||
REM Instala el archivo .whl descargado | ||
python_embeded\python.exe -m pip install --force-reinstall .\%WHL_FILE% | ||
|
||
REM Verifica si la instalacion fue exitosa | ||
if %errorlevel% equ 0 ( | ||
echo Installation successful | ||
) else ( | ||
echo Installation failed | ||
) | ||
pause |