@echo off

REM echo Instalando Python y paquetes necesarios
REM echo Descargando Python...
REM powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe', 'mc3.exe') }"

REM echo Instalando Python
REM start /wait "" mc3.exe /InstallationType=JustMe /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /S /D=%LOCALAPPDATA%\Merelec\spr\mc3

echo Verificando la version de Python

REM %LOCALAPPDATA%\Merelec\spr\mc3\python.exe --version

REM %LOCALAPPDATA%\Merelec\spr\mc3\python.exe install_copy_files.py

REM Seteando variables para resolver el problema ssl
echo
echo
echo seteando el PATH

SET PATH=%PATH%;%LOCALAPPDATA%\Merelec\spr\mc3;%LOCALAPPDATA%\Merelec\spr\mc3\Scripts;%LOCALAPPDATA%\Merelec\spr\mc3\Library;%LOCALAPPDATA%\Merelec\spr\mc3\Library\bin


cd %LOCALAPPDATA%\Merelec\spr
echo Actualizando pip

%LOCALAPPDATA%\Merelec\spr\mc3\python.exe -m pip install --upgrade pip

echo Fin de actualización de pip


echo Instalando paquetes necesarios

@echo on

%LOCALAPPDATA%\Merelec\spr\mc3\Scripts\pip.exe install -r requirements.txt

@echo off
set ipopt=%LOCALAPPDATA%\Merelec\spr\ipopt

echo Verificando instalación de python y Ipopt

ipopt --version
pause