pgadmin4/Make.bat

446 lines
16 KiB
Batchfile
Raw Normal View History

2016-06-08 11:29:21 +00:00
@ECHO off
SETLOCAL
REM
REM ****************************************************************
SET WD=%CD%
SET "PGBUILDPATH=%WD%\win-build"
SET CMDOPTION=""
IF "%1" == "clean" SET CMDOPTION="VALID"
IF "%1" == "x86" SET CMDOPTION="VALID"
IF NOT %CMDOPTION%=="VALID" ( GOTO USAGE )
SET ARCHITECTURE=%1
IF "%ARCHITECTURE%"=="clean" (
GOTO CLEAN_RELEASE
GOTO EXIT
2016-06-08 11:29:21 +00:00
)
REM Main Functions
CALL :SET_PGADMIN4_ENVIRONMENT
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
CALL :VALIDATE_ENVIRONMENT
CALL :CLEAN_RELEASE
2016-06-08 11:29:21 +00:00
CALL :CREATE_VIRTUAL_ENV
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
CALL :CREATE_RUNTIME_ENV
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
CALL :CREATE_PYTHON_ENV
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
CALL :CLEANUP_ENV
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
CALL :CREATE_INSTALLER
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
CALL :SIGN_INSTALLER
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
2016-06-08 11:29:21 +00:00
CD %WD%
GOTO EXIT
2016-06-08 11:29:21 +00:00
REM Main function Ends
:CLEAN_RELEASE
ECHO Calling clean target...
IF EXIST "%PGBUILDPATH%" rd "%PGBUILDPATH%" /S /Q
FOR /R "%WD%" %%f in (*.pyc *.pyo) do DEL /q "%%f" > nul
2016-06-08 11:29:21 +00:00
IF EXIST "%WD%\pkg\win32\Output" rd "%WD%\pkg\win32\Output" /S /Q
IF EXIST DEL /q "%WD%\pkg\win32\installer.iss" > nul
CD %WD%
GOTO:eof
2016-06-08 11:29:21 +00:00
:SET_PGADMIN4_ENVIRONMENT
IF "%PYTHON_HOME%" == "" SET "PYTHON_HOME=C:\Python27"
IF "%PYTHON_DLL%" == "" SET "PYTHON_DLL=C:\Windows\SysWOW64\python27.dll"
IF "%QTDIR%" == "" SET "QTDIR=C:\Qt\5.9.1\mingw53_32"
IF "%MAKE%" == "" SET "MAKE=mingw32-make.exe"
IF "%PGDIR%" == "" SET "PGDIR=C:\Program Files (x86)\PostgreSQL\10"
IF "%INNOTOOL%" == "" SET "INNOTOOL=C:\Program Files (x86)\Inno Setup 5"
IF "%VCREDIST%" == "" SET "VCREDIST=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\1033\vcredist_x86.exe"
IF "%SIGNTOOL%" == "" SET "SIGNTOOL=C:\Program Files\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe"
2016-06-08 11:29:21 +00:00
2018-05-16 15:15:44 +00:00
REM Set VCREDISTNAME (the filename)
for /f "delims=" %%i in ("%VCREDIST%") do set "VCREDISTNAME=%%~nxi"
2016-06-08 11:29:21 +00:00
2018-05-16 15:15:44 +00:00
REM Set additional variables we need
2016-06-08 11:29:21 +00:00
SET "QMAKE=%QTDIR%\bin\qmake.exe"
SET "VIRTUALENV=venv"
SET "TARGETINSTALLER=%WD%\dist"
FOR /F "tokens=3" %%a IN ('findstr /C:"APP_RELEASE =" %WD%\web\config.py') DO SET APP_MAJOR=%%a
FOR /F "tokens=3" %%a IN ('findstr /C:"APP_REVISION =" %WD%\web\config.py') DO SET APP_MINOR=%%a
FOR /F "tokens=3" %%a IN ('findstr /C:"APP_SUFFIX =" %WD%\web\config.py') DO SET APP_VERSION_SUFFIX=%%a
2016-06-08 11:29:21 +00:00
REM remove single quote from the string
SET APP_SUFFIX_VERSION=%APP_SUFFIX_VERSION:'=%
SET APP_NAME=""
FOR /F "tokens=2* DELims='" %%a IN ('findstr /C:"APP_NAME =" web\config.py') DO SET APP_NAME=%%a
FOR /f "tokens=1 DELims=." %%G IN ('%PYTHON_HOME%/python.exe -c "print('%APP_NAME%'.lower().replace(' ', ''))"') DO SET APP_SHORTNAME=%%G
FOR /F "tokens=4,5 delims=. " %%a IN ('%QMAKE% -v ^| findstr /B /C:"Using Qt version "') DO SET QT_VERSION=%%a.%%b
2018-05-16 15:15:44 +00:00
SET INSTALLERNAME=%APP_SHORTNAME%-%APP_MAJOR%.%APP_MINOR%-%APP_VERSION_SUFFIX%-%ARCHITECTURE%.exe
IF "%APP_VERSION_SUFFIX%" == "" SET INSTALLERNAME=%APP_SHORTNAME%-%APP_MAJOR%.%APP_MINOR%-%ARCHITECTURE%.exe
2016-06-08 11:29:21 +00:00
SET PGADMIN4_APP_VERSION=%APP_MAJOR%.%APP_MINOR%
2016-06-08 11:29:21 +00:00
2018-05-16 15:15:44 +00:00
REM get Python version ex. 2.7.1 will get as 27
FOR /f "tokens=1 DELims=." %%G IN ('%PYTHON_HOME%/python.exe -c "import sys; print(sys.version.split(' ')[0])"') DO SET PYTHON_MAJOR=%%G
FOR /f "tokens=2 DELims=." %%G IN ('%PYTHON_HOME%/python.exe -c "import sys; print(sys.version.split(' ')[0])"') DO SET PYTHON_MINOR=%%G
SET "PYTHON_VERSION=%PYTHON_MAJOR%%PYTHON_MINOR%"
GOTO:eof
:VALIDATE_ENVIRONMENT
2016-06-08 11:29:21 +00:00
ECHO ****************************************************************
ECHO S U M M A R Y
ECHO ****************************************************************
ECHO Build path: %PGBUILDPATH%
ECHO Output directory: %TARGETINSTALLER%
ECHO Installer name: %INSTALLERNAME%
2018-05-16 15:15:44 +00:00
ECHO.
ECHO Python home: %PYTHON_HOME%
ECHO Python DLL: %PYTHON_DLL%
ECHO Python version: %PYTHON_VERSION%
ECHO Python major version: %PYTHON_MAJOR%
ECHO Python minor version: %PYTHON_MINOR%
ECHO Virtual environment: %VIRTUALENV%
2018-05-16 15:15:44 +00:00
ECHO.
ECHO Qt home: %QTDIR%
ECHO qmake executable: %QMAKE%
ECHO Qt version: %QT_VERSION%
2018-05-16 15:15:44 +00:00
ECHO.
ECHO PostgreSQL home: %PGDIR%
2018-05-16 15:15:44 +00:00
ECHO.
ECHO VC++ redistributable: %VCREDIST%
ECHO VC++ redistributable file: %VCREDISTNAME%
2018-05-16 15:15:44 +00:00
ECHO.
ECHO innotool executable: %INNOTOOL%
ECHO signtool executable: %SIGNTOOL%
2018-05-16 15:15:44 +00:00
ECHO.
ECHO App major version: %APP_MAJOR%
ECHO App minor version: %APP_MINOR%
ECHO App version: %APP_VERSION%
ECHO App version suffix: %APP_VERSION_SUFFIX%
ECHO App short name: %APP_SHORTNAME%
ECHO App name: %APP_NAME%
2016-06-08 11:29:21 +00:00
ECHO ****************************************************************
2018-05-16 15:15:44 +00:00
REM Check IF path SET in environment really exist or not ?
2016-06-08 11:29:21 +00:00
IF NOT EXIST "%INNOTOOL%" GOTO err_handle_inno
2018-05-16 15:15:44 +00:00
IF NOT EXIST "%VCREDIST%" GOTO err_handle_vcredist
2016-06-08 11:29:21 +00:00
IF NOT EXIST "%QTDIR%" GOTO err_handle_qt
IF NOT EXIST "%QMAKE%" GOTO err_handle_qt
IF NOT EXIST "%PYTHON_HOME%" GOTO err_handle_python
IF NOT EXIST "%PYTHON_DLL%" GOTO err_handle_python
IF NOT EXIST "%PGDIR%" GOTO err_handle_pg
IF NOT EXIST "%PYTHON_HOME%\Scripts\virtualenv.exe" GOTO err_handle_pythonvirtualenv
SET PATH=%PGDIR%\bin;%PATH%;
GOTO:eof
2016-06-08 11:29:21 +00:00
:CREATE_VIRTUAL_ENV
ECHO Creating Virtual Enviroment...
IF NOT EXIST "%PGBUILDPATH%" MKDIR "%PGBUILDPATH%"
CD "%PGBUILDPATH%"
"%PYTHON_HOME%\Scripts\virtualenv.exe" "%VIRTUALENV%"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
ECHO Activating Virtual Enviroment - %PGBUILDPATH%\%VIRTUALENV%\Scripts\activate...
CALL "%PGBUILDPATH%\%VIRTUALENV%\Scripts\activate"
SET PATH=%PGDIR%\bin;%PATH%
ECHO Installing dependencies...
pip install -r "%WD%\requirements.txt"
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
pip install sphinx
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
ECHO Virtual Environment created successfully.
2016-06-08 11:29:21 +00:00
ECHO Deactivating Virtual Enviroment - %PGBUILDPATH%\%VIRTUALENV%\Scripts\deactivate...
CALL "%PGBUILDPATH%\%VIRTUALENV%\Scripts\deactivate"
CD %WD%
GOTO:eof
2016-06-08 11:29:21 +00:00
:CREATE_RUNTIME_ENV
ECHO Compiling source code...
MKDIR "%PGBUILDPATH%\runtime" > nul
REM --- Processing WEB ---
CD "%WD%\web"
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
ECHO Install Javascript dependencies
2017-06-15 14:32:07 +00:00
call yarn install
ECHO Bundle all Javascript
2017-06-15 14:32:07 +00:00
call yarn run bundle
REM Remove any cache
RD /Q /S "%WD%\web\pgadmin\static\js\generated\.cache"
2016-06-08 11:29:21 +00:00
XCOPY /S /I /E /H /Y "%WD%\web" "%PGBUILDPATH%\web" > nul
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
REM Clean up .pyc, .pyo, pgadmin4.db, config_local.py
2016-06-08 11:29:21 +00:00
ECHO Cleaning up unnecessary files...
FOR /R "%PGBUILDPATH%\web" %%f in (*.pyc *.pyo) do DEL /q "%%f"
FOR /R "%PGBUILDPATH%\web" %%f in (tests feature_tests __pycache__ node_modules) do RD /Q /S "%%f"
RD /Q /S "%PGBUILDPATH%\web\regression"
RD /Q /S "%PGBUILDPATH%\web\tools"
DEL /q "%PGBUILDPATH%\web\pgadmin4.db"
DEL /q "%PGBUILDPATH%\web\config_local.py"
2016-06-08 11:29:21 +00:00
ECHO Creating config_distro.py
ECHO SERVER_MODE = False > "%PGBUILDPATH%\web\config_distro.py"
ECHO HELP_PATH = '../../../docs/en_US/html/' >> "%PGBUILDPATH%\web\config_distro.py"
ECHO DEFAULT_BINARY_PATHS = { >> "%PGBUILDPATH%\web\config_distro.py"
ECHO 'pg': '$DIR/../runtime', >> "%PGBUILDPATH%\web\config_distro.py"
ECHO 'ppas': '' >> "%PGBUILDPATH%\web\config_distro.py"
ECHO } >> "%PGBUILDPATH%\web\config_distro.py"
2016-06-08 11:29:21 +00:00
ECHO Activating Virtual Enviroment - %PGBUILDPATH%\%VIRTUALENV%\Scripts\activate...
CALL "%PGBUILDPATH%\%VIRTUALENV%\Scripts\activate"
2016-06-08 11:29:21 +00:00
ECHO Building docs...
MKDIR "%PGBUILDPATH%\docs\en_US\html"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
CD "%WD%\docs\en_US"
"%PGBUILDPATH%\%VIRTUALENV%\Scripts\python.exe" build_code_snippet.py
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
2016-06-08 11:29:21 +00:00
"%PGBUILDPATH%\%VIRTUALENV%\Scripts\sphinx-build.exe" "%WD%\docs\en_US" "%PGBUILDPATH%\docs\en_US\html"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
ECHO Removing Sphinx
pip uninstall -y sphinx Pygments alabaster colorama docutils imagesize requests snowballstemmer
2016-06-08 11:29:21 +00:00
2018-05-16 15:15:44 +00:00
IF %PYTHON_MAJOR% == 2 (
ECHO Fixing backports.csv for Python 2 by adding missing __init__.py
type nul >> "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\backports\__init__.py"
)
2016-06-08 11:29:21 +00:00
ECHO Assembling runtime environment...
CD "%WD%\runtime"
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
CALL "%QMAKE%"
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
CALL %MAKE% clean
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
CALL mingw32-make.exe
2016-06-08 11:29:21 +00:00
IF ERRORLEVEL 1 GOTO ERR_HANDLER
2016-06-08 11:29:21 +00:00
REM Copy binary to Release Folder
copy "%WD%\runtime\release\pgAdmin4.exe" "%PGBUILDPATH%\runtime"
IF ERRORLEVEL 1 GOTO ERR_HANDLER
REM Copy QT dependences
2016-06-08 11:29:21 +00:00
copy "%QTDIR%\bin\Qt5Core.dll" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%QTDIR%\bin\Qt5Gui.dll" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%QTDIR%\bin\Qt5Widgets.dll" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%QTDIR%\bin\Qt5Network.dll" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%QTDIR%\bin\libgcc_s_dw2-1.dll" "%PGBUILDPATH%\runtime"
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%QTDIR%\bin\libstdc++-6.dll" "%PGBUILDPATH%\runtime"
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%QTDIR%\bin\libwinpthread-1.dll" "%PGBUILDPATH%\runtime"
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
MKDIR "%PGBUILDPATH%\runtime\platforms"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%QTDIR%\plugins\platforms\qwindows.dll" "%PGBUILDPATH%\runtime\platforms" > nul
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
2016-06-08 11:29:21 +00:00
ECHO [Paths] > "%PGBUILDPATH%\runtime\qt.conf"
ECHO Plugins=plugins >> "%PGBUILDPATH%\runtime\qt.conf"
copy "%PGDIR%\bin\libpq.dll" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%PGDIR%\bin\ssleay32.dll" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%PGDIR%\bin\libeay32.dll" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%PGDIR%\bin\libintl-*.dll" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%PGDIR%\bin\libiconv-*.dll" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%PGDIR%\bin\zlib1.dll" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%PGDIR%\bin\pg_dump.exe" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%PGDIR%\bin\pg_dumpall.exe" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%PGDIR%\bin\pg_restore.exe" "%PGBUILDPATH%\runtime"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%PGDIR%\bin\psql.exe" "%PGBUILDPATH%\runtime"
2016-06-08 11:29:21 +00:00
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
MKDIR "%PGBUILDPATH%\installer"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy "%VCREDIST%" "%PGBUILDPATH%\installer" > nul
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
ECHO Runtime built successfully.
CD %WD%
GOTO:eof
2016-06-08 11:29:21 +00:00
:CREATE_PYTHON_ENV
copy %PYTHON_DLL% "%PGBUILDPATH%\runtime" > nul
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
REM Copy Python interpretor as it's needed to run background processes
copy %PYTHON_HOME%\python.exe "%PGBUILDPATH%\runtime" > nul
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
copy %PYTHON_HOME%\pythonw.exe "%PGBUILDPATH%\runtime" > nul
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
2016-06-08 11:29:21 +00:00
XCOPY /S /I /E /H /Y "%PYTHON_HOME%\DLLs" "%PGBUILDPATH%\%VIRTUALENV%\DLLs" > nul
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
XCOPY /S /I /E /H /Y "%PYTHON_HOME%\Lib" "%PGBUILDPATH%\%VIRTUALENV%\Lib" > nul
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
ECHO Cleaning up unnecessary files...
FOR /R "%PGBUILDPATH%\%VIRTUALENV%" %%f in (*.pyc *.pyo) do DEL /q "%%f"
FOR /R "%PGBUILDPATH%\%VIRTUALENV%\Lib" %%f in (test tests) do RD /Q /S "%%f"
RD /Q /S "%PGBUILDPATH%\%VIRTUALENV%\tcl"
2016-06-08 11:29:21 +00:00
CD %WD%
GOTO:eof
2016-06-08 11:29:21 +00:00
:CREATE_INSTALLER
ECHO Preparing for creation of windows installer...
IF NOT EXIST "%TARGETINSTALLER%" MKDIR "%TARGETINSTALLER%"
copy "%WD%\pkg\win32\Resources\pgAdmin4.ico" "%PGBUILDPATH%"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
2016-06-08 11:29:21 +00:00
CD "%WD%"
CD pkg
CD win32
"%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in" "-o" "%WD%\pkg\win32\installer.iss.in_stage1" "-s" MYAPP_NAME -r """%APP_NAME%"""
"%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage1" "-o" "%WD%\pkg\win32\installer.iss.in_stage2" "-s" MYAPP_FULLVERSION -r """%APP_VERSION%"""
"%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage2" "-o" "%WD%\pkg\win32\installer.iss.in_stage3" "-s" MYAPP_VERSION -r """v%APP_MAJOR%"""
2016-06-08 11:29:21 +00:00
set ARCMODE=
IF "%ARCHITECTURE%"=="amd64" (
set ARCMODE="x64"
)
"%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage3" "-o" "%WD%\pkg\win32\installer.iss.in_stage4" "-s" MYAPP_ARCHITECTURESMODE -r """%ARCMODE%"""
"%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage4" "-o" "%WD%\pkg\win32\installer.iss" "-s" MYAPP_VCDIST -r """%VCREDISTNAME%"""
DEL /s "%WD%\pkg\win32\installer.iss.in_stage*" > nul
ECHO Creating windows installer... using INNO tool
2016-06-21 11:43:01 +00:00
2016-06-08 11:29:21 +00:00
CALL "%INNOTOOL%\ISCC.exe" /q "%WD%\pkg\win32\installer.iss"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
2016-06-21 11:43:01 +00:00
2016-06-08 11:29:21 +00:00
MOVE "%WD%\pkg\win32\Output\Setup.exe" "%TARGETINSTALLER%\%INSTALLERNAME%"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
ECHO "Location - %TARGETINSTALLER%\%INSTALLERNAME%"
ECHO Installer generated successfully.
2016-06-08 11:29:21 +00:00
CD %WD%
GOTO:eof
2016-06-08 11:29:21 +00:00
:SIGN_INSTALLER
ECHO Attempting to sign the installer...
"%SIGNTOOL%" sign /t http://timestamp.verisign.com/scripts/timstamp.dll "%TARGETINSTALLER%\%INSTALLERNAME%"
IF %ERRORLEVEL% NEQ 0 (
ECHO
ECHO ************************************************************
ECHO * Failed to sign the installer
ECHO ************************************************************
PAUSE
)
CD %WD%
GOTO:eof
2016-06-08 11:29:21 +00:00
:CLEANUP_ENV
ECHO Cleaning up private environment...
rd "%PGBUILDPATH%\%VIRTUALENV%\Include" /S /Q
DEL /s "%PGBUILDPATH%\%VIRTUALENV%\pip-selfcheck.json"
ECHO Cleaned up private environment successfully.
CD %WD%
GOTO:eof
2016-06-08 11:29:21 +00:00
:err_handle_inno
ECHO %INNOTOOL% does not exist
ECHO Please Install Innotool and SET INNOTOOL enviroment Variable.
ECHO SET "INNOTOOL=<PATH>"
exit /B 1
GOTO EXIT
2016-06-08 11:29:21 +00:00
2018-05-16 15:15:44 +00:00
:err_handle_vcredist
2016-06-08 11:29:21 +00:00
ECHO %VCREDIST% does not exist
2018-05-14 15:16:18 +00:00
ECHO Please Install Microsoft Visual studio and SET the VCREDIST enviroment Variable.
ECHO SET "VCREDIST=<PATH>"
2016-06-08 11:29:21 +00:00
exit /B 1
GOTO EXIT
2016-06-08 11:29:21 +00:00
:err_handle_python
ECHO %PYTHON_HOME% does not exist, or %PYTHON_DLL% does not exist.
2016-06-08 11:29:21 +00:00
ECHO Please install Python and SET the PYTHON_HOME enviroment Variable.
ECHO SET "PYTHON_HOME=<PATH>"
ECHO SET "PYTHON_DLL=<PATH>"
exit /B 1
GOTO EXIT
2016-06-08 11:29:21 +00:00
:err_handle_qt
ECHO %QTDIR% does not exist.
ECHO Please Install QT SDK and SET the QTDIR enviroment variable.
ECHO SET "QTDIR=<PATH>"
exit /B 1
GOTO EXIT
2016-06-08 11:29:21 +00:00
:err_handle_pg
ECHO %PGDIR% does not exist.
ECHO Please Install Postgres and SET enviroment Variable
ECHO SET "PGDIR=<PATH>"
exit /B 1
GOTO EXIT
2016-06-08 11:29:21 +00:00
:err_handle_pythonvirtualenv
ECHO Python virtualenv is missing @ location - %PYTHON_HOME%\Scripts\virtualenv.exe
exit /B 1
GOTO EXIT
2016-06-08 11:29:21 +00:00
:ERR_HANDLER
ECHO.
ECHO Aborting build!
CD %WD%
exit /B 1
GOTO EXIT
2016-06-08 11:29:21 +00:00
:USAGE
ECHO Invalid command line options....
ECHO Usage: "Make.bat <x86 | clean>"
2016-06-08 11:29:21 +00:00
ECHO.
exit /B 1
GOTO EXIT
2016-06-08 11:29:21 +00:00
:EXIT