2015-03-19 01:19:16 +00:00
|
|
|
@ echo off
|
2016-02-12 18:37:49 +00:00
|
|
|
@ echo Salt Windows Build Package Script
|
2015-03-20 19:48:08 +00:00
|
|
|
@ echo.
|
2015-03-31 17:53:17 +00:00
|
|
|
|
2015-03-19 01:19:16 +00:00
|
|
|
:: Define Variables
|
|
|
|
@ echo Defining Variables...
|
2015-03-20 19:48:08 +00:00
|
|
|
@ echo ---------------------
|
2015-03-19 01:19:16 +00:00
|
|
|
Set "CurrDir=%cd%"
|
|
|
|
Set "BinDir=%cd%\buildenv\bin"
|
|
|
|
Set "InsDir=%cd%\installer"
|
|
|
|
Set "PyDir=C:\Python27"
|
2015-04-06 23:50:49 +00:00
|
|
|
Set "Version=%1"
|
2015-03-19 01:19:16 +00:00
|
|
|
|
|
|
|
:: Find the NSIS Installer
|
|
|
|
If Exist "C:\Program Files\NSIS\" (
|
|
|
|
Set NSIS="C:\Program Files\NSIS\"
|
|
|
|
) Else (
|
|
|
|
Set NSIS="C:\Program Files (x86)\NSIS\"
|
|
|
|
)
|
|
|
|
Set "PATH=%NSIS%;%PATH%"
|
2015-03-20 19:48:08 +00:00
|
|
|
@ echo.
|
2015-03-19 01:19:16 +00:00
|
|
|
|
|
|
|
@ echo Copying C:\Python27 to bin...
|
2015-03-20 19:48:08 +00:00
|
|
|
@ echo -----------------------------
|
2015-03-19 01:19:16 +00:00
|
|
|
:: Check for existing bin directory and remove
|
2015-03-20 19:48:08 +00:00
|
|
|
If Exist "%BinDir%\" rd /S /Q "%BinDir%"
|
2015-03-19 01:19:16 +00:00
|
|
|
|
|
|
|
:: Copy the Python27 directory to bin
|
2015-03-20 19:48:08 +00:00
|
|
|
@echo xcopy /S /E "%PyDir%" "%BinDir%\"
|
|
|
|
xcopy /S /E "%PyDir%" "%BinDir%\"
|
|
|
|
@ echo.
|
2015-03-19 01:19:16 +00:00
|
|
|
|
2015-04-06 23:04:24 +00:00
|
|
|
:: Remove the fixed path in .exe files
|
|
|
|
@echo Removing fixed path from .exe files
|
2016-06-13 18:01:15 +00:00
|
|
|
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install.exe"
|
|
|
|
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install-2.7.exe"
|
|
|
|
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip.exe"
|
|
|
|
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.7.exe"
|
|
|
|
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.exe"
|
2015-04-06 23:04:24 +00:00
|
|
|
|
2015-03-19 01:19:16 +00:00
|
|
|
@ echo Cleaning up unused files and directories...
|
2015-03-20 19:48:08 +00:00
|
|
|
@ echo -------------------------------------------
|
2015-03-19 01:19:16 +00:00
|
|
|
:: Remove all Compiled Python files (.pyc)
|
2015-03-20 19:48:08 +00:00
|
|
|
del /S /Q "%BinDir%\*.pyc"
|
2015-03-30 14:26:30 +00:00
|
|
|
:: Remove all Compiled HTML Help (.chm)
|
|
|
|
del /S /Q "%BinDir%\*.chm"
|
2016-02-09 00:29:39 +00:00
|
|
|
:: Remove all empty text files (they are placeholders for git)
|
2016-02-09 00:51:36 +00:00
|
|
|
del /S /Q "%BinDir%\..\empty.*"
|
2015-03-19 01:19:16 +00:00
|
|
|
|
|
|
|
:: Delete Unused Docs and Modules
|
2015-03-20 19:48:08 +00:00
|
|
|
If Exist "%BinDir%\Doc" rd /S /Q "%BinDir%\Doc"
|
|
|
|
If Exist "%BinDir%\share" rd /S /Q "%BinDir%\share"
|
|
|
|
If Exist "%BinDir%\tcl" rd /S /Q "%BinDir%\tcl"
|
|
|
|
If Exist "%BinDir%\Lib\idlelib" rd /S /Q "%BinDir%\Lib\idlelib"
|
|
|
|
If Exist "%BinDir%\Lib\lib-tk" rd /S /Q "%BinDir%\Lib\lib-tk"
|
|
|
|
If Exist "%BinDir%\Lib\test" rd /S /Q "%BinDir%\Lib\test"
|
|
|
|
If Exist "%BinDir%\Lib\unit-test" rd /S /Q "%BinDir%\Lib\unit-test"
|
2015-03-19 01:19:16 +00:00
|
|
|
|
|
|
|
:: Delete Unused .dll files
|
2015-03-20 19:48:08 +00:00
|
|
|
If Exist "%BinDir%\DLLs\tcl85.dll" del /S /Q "%BinDir%\DLLs\tcl85.dll"
|
|
|
|
If Exist "%BinDir%\DLLs\tclpip85.dll" del /S /Q "%BinDir%\DLLs\tclpip85.dll"
|
|
|
|
If Exist "%BinDir%\DLLs\tk85.dll" del /S /Q "%BinDir%\DLLs\tk85.dll"
|
2015-03-19 01:19:16 +00:00
|
|
|
|
2015-03-31 17:53:17 +00:00
|
|
|
:: Delete Unused .lib files
|
|
|
|
If Exist "%BinDir%\libs\_tkinter.lib" del /S /Q "%BinDir%\libs\_tkinter.lib"
|
|
|
|
|
2015-03-19 01:19:16 +00:00
|
|
|
:: Delete .txt files
|
2015-03-20 19:48:08 +00:00
|
|
|
If Exist "%BinDir%\NEWS.txt" del /q "%BinDir%\NEWS.txt"
|
|
|
|
If Exist "%BinDir%\README.txt" del /q "%BinDir%\README.txt"
|
|
|
|
@ echo.
|
2015-03-19 01:19:16 +00:00
|
|
|
|
|
|
|
@ echo Building the installer...
|
2015-03-20 19:48:08 +00:00
|
|
|
@ echo -------------------------
|
2015-04-20 21:55:57 +00:00
|
|
|
makensis.exe /DSaltVersion=%Version% "%InsDir%\Salt-Minion-Setup.nsi"
|
2015-03-20 19:48:08 +00:00
|
|
|
@ echo.
|
2015-03-19 01:19:16 +00:00
|
|
|
|
|
|
|
@ echo.
|
2015-03-20 19:48:08 +00:00
|
|
|
@ echo ===================
|
2015-03-19 01:19:16 +00:00
|
|
|
@ echo Script completed...
|
2015-03-20 19:48:08 +00:00
|
|
|
@ echo -------------------
|
2015-03-19 01:19:16 +00:00
|
|
|
@ echo Installation file can be found in the following directory:
|
|
|
|
@ echo %InsDir%
|
2015-04-06 23:52:38 +00:00
|
|
|
|
2015-04-16 22:43:51 +00:00
|
|
|
:done
|
2015-04-06 23:52:58 +00:00
|
|
|
if [%Version%] == [] pause
|