Skip to content

Instantly share code, notes, and snippets.

@paulwinex
Created February 17, 2017 17:11
Show Gist options
  • Save paulwinex/1052eadb3e33e90f43b2fbb8bc26c716 to your computer and use it in GitHub Desktop.
Save paulwinex/1052eadb3e33e90f43b2fbb8bc26c716 to your computer and use it in GitHub Desktop.
REM http://www.microsoft.com/en-us/download/details.aspx?id=40855
REM INSTALL: Windows6.1-KB2819745-x64-MultiPkg
@ECHO off
rem VARIABLES
SET PYTHONINSTALL=C:\python27
SET LOCALFILE=c:\python-2.7.6.amd64.msi
SET PYTHONURL=http://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi
REM My installation python script
SET PWINSTALLER=http://paulwinex.ru/files/pipeline/pwpipeline_install.py
SET PWINSTALLERLOCAL=c:\pwpipeline_install.py
rem =====================================================
ECHO START INSTALL...
rem install python
IF EXIST %PYTHONINSTALL% (
ECHO PYTHON ALREADY INSTALLED
) ELSE (
ECHO DOWNLOAD PYTHON
IF NOT EXIST %LOCALFILE% CALL powershell -Command "(New-Object Net.WebClient).DownloadFile('%PYTHONURL%','c:\python-2.7.6.amd64.msi')"
ECHO INSTALL PYTHON...
msiexec /qn /i %LOCALFILE% TARGETDIR=%PYTHONINSTALL%
DEL /q %LOCALFILE%
)
rem install \ pip
IF EXIST %PYTHONINSTALL%\Scripts\pip.exe (
ECHO PIP ALREADY INSTALLED
) ELSE (
ECHO INSTALL PIP...
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'c:\get-pip.py')"
CALL c:\python27\python.exe c:\get-pip.py
DEL /q c:\get-pip.py
)
timeout /t 1 /NOBREAK
rem install pyside
IF EXIST %PYTHONINSTALL%\Scripts\pyside_postinstall.py (
ECHO PYSIDE ALREADY INSTALLED
) ELSE (
ECHO INSTALL PYSIDE...
CALL C:\Python27\Scripts\pip.exe install PySide
)
REM add system variable
SET EXISTS=1
FOR %%A IN ("%path:;=";"%") DO (
if %%~A==%PYTHONINSTALL% SET EXISTS=0
)
IF %EXISTS%==1 (
ECHO SET PATH ENV
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PATH /t REG_SZ /d "%PYTHONINSTALL%;%path%" /f
)
REM ====================INSTALL PIPELINE
timeout /t 1 /NOBREAK
REM download install script
powershell -Command "(New-Object Net.WebClient).DownloadFile('%PWINSTALLER%', '%PWINSTALLERLOCAL%')"
start c:\python27\pythonw.exe %PWINSTALLERLOCAL%
ECHO INSTALL COMPLETE
timeout /t 2 /NOBREAK
DEL /q %PWINSTALLERLOCAL%
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment