C:
cd \Users\Docker\Downloads
mkdir setup

rem creamos directorio setup, nos bajamos cosas y mas tarde lo borramos
rem pero el VC_redist hace falta para el empaquetado, asi que lo descargamos fuera de setup para no borrarlo

curl https://www.python.org/ftp/python/3.12.3/amd64/core.msi                                           --output setup\core.msi
curl https://www.python.org/ftp/python/3.12.3/amd64/dev.msi                                            --output setup\dev.msi
curl https://www.python.org/ftp/python/3.12.3/amd64/exe.msi                                            --output setup\exe.msi
curl https://www.python.org/ftp/python/3.12.3/amd64/lib.msi                                            --output setup\lib.msi
curl https://www.python.org/ftp/python/3.12.3/amd64/path.msi                                           --output setup\path.msi
curl https://www.python.org/ftp/python/3.12.3/amd64/pip.msi                                            --output setup\pip.msi
curl https://aka.ms/vs/17/release/vc_redist.x64.exe                                         --location --output       VC_redist.x64.exe
curl https://prdownloads.sourceforge.net/nsis/nsis-3.05-setup.exe?download                  --location --output setup\nsis-install.exe
curl http://nsis.sourceforge.net/mediawiki/images/d/d7/NSIS_Simple_Firewall_Plugin_1.20.zip --location --output setup\NSIS_Simple_Firewall_Plugin_1.20.zip

cd setup
msiexec /i core.msi TARGETDIR=C:\Python312
msiexec /i dev.msi TARGETDIR=C:\Python312
msiexec /i exe.msi TARGETDIR=C:\Python312
msiexec /i lib.msi TARGETDIR=C:\Python312
msiexec /i path.msi TARGETDIR=C:\Python312
msiexec /i pip.msi TARGETDIR=C:\Python312
cd ..
VC_redist.x64.exe /install /quiet /passive /norestart

ftype PythonScript=C:\Python312\python.exe "%1" %*
assoc .py=PythonScript
PATH=C:\Python312;C:\Python312\Scripts;%PATH%
setx PATH "C:\Python312;C:\Python312\Scripts;%PATH%"

python -m pip install --upgrade wheel pip
pip install -r F:\src\requirements.txt

setup\nsis-install.exe /S

powershell -command "Expand-Archive setup\NSIS_Simple_Firewall_Plugin_1.20.zip nsis-fp"
copy nsis-fp\SimpleFC.dll "C:\Program Files (x86)\NSIS\Plugins\x86-ansi\"
copy nsis-fp\SimpleFC.dll "C:\Program Files (x86)\NSIS\Plugins\x86-unicode\"
rmdir nsis-fp /s /q

rmdir setup /s /q
