@echo off

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

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

echo Verificando la version de Python

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

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

Seteando variables para resolver el problema ssl
echo
echo
echo Seteando variables de entorno...

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 la version de 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