release.win7.vc9.bat 3.26 KB
Newer Older
1
@echo off
2
@echo off
Claudio Valerio's avatar
Claudio Valerio committed
3 4 5
REM --------------------------------------------------------------------
REM This program is free software: you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
6
REM the Free Software Foundation, either version 2 of the License, or
Claudio Valerio's avatar
Claudio Valerio committed
7 8 9 10 11 12 13 14 15 16 17
REM (at your option) any later version.
REM 
REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
REM GNU General Public License for more details.
REM 
REM You should have received a copy of the GNU General Public License
REM along with this program.  If not, see <http://www.gnu.org/licenses/>.
REM ---------------------------------------------------------------------

18 19
set SCRIPT_PATH=%~dp0
set PROJECT_ROOT=%SCRIPT_PATH%\..\..
20 21

set APPLICATION_NAME=OpenBoard
22
set QT_DIR=C:\Program Files\Qt\5.5\msvc2010
Claudio Valerio's avatar
Claudio Valerio committed
23 24
set QT_BIN=%QT_DIR%\bin

25
set PROGRAMS_FILE_PATH=C:\Program Files (x86)
Claudio Valerio's avatar
Claudio Valerio committed
26

27
set GIT_BIN=C:\Program Files\Git\bin
28
set VS_BIN=%PROGRAMS_FILE_PATH%\Microsoft Visual Studio 10.0\VC\bin
Claudio Valerio's avatar
Claudio Valerio committed
29 30
set WIN_SDK_BIN=%PROGRAMS_FILE_PATH%\Microsoft SDKs\Windows\v6.0A\Bin
set INNO_EXE=%PROGRAMS_FILE_PATH%\Inno Setup 5\iscc.exe 
31
set BUILD_DIR=%PROJECT_ROOT%\build\win32\release
32
set LRELEASE=%QT_DIR%\bin\lrelease.exe
33
set BASE_QT_TRANSLATIONS_DIRECTORY=%QT_DIR%\translations
Claudio Valerio's avatar
Claudio Valerio committed
34 35 36 37 38 39 40

set PATH=%QT_BIN%;%PATH%;%WIN_SDK_BIN%;%GIT_BIN%

call "%VS_BIN%\vcvars32.bat"

echo %PATH%

41 42
cd %PROJECT_ROOT%

43
REM Third party impoter application
44
set IMPORTER_NAME=OpenBoardImporter
45
set IMPORTER_PATH="..\OpenBoard-Importer"
46 47

IF NOT EXIST "%IMPORTER_PATH%" GOTO EXIT_WITH_ERROR
48

49 50 51
set HOME_DIR="%cd%"
cd %IMPORTER_PATH%
IF EXIST "release" (del "release\*.*" /Q)
52 53 54 55
IF EXIST "debug" (del "debug\*.*" /Q)
IF EXIST "MakeFile" (del "MakeFile*" /Q)
IF EXIST "MakeFile" (del "MakeFile*" /Q)
IF EXIST "%IMPORTER_NAME%.exe" (del "%IMPORTER_NAME%.exe" /Q)
56
"%QT_BIN%\qmake.exe" %IMPORTER_NAME%.pro
57
nmake release
58
IF NOT EXIST release\"%IMPORTER_NAME%.exe" GOTO EXIT_WITH_ERROR
59 60
cd %HOME_DIR%

Claudio Valerio's avatar
Claudio Valerio committed
61 62 63
REM this checks if the custom qt directory path
REM is correct. This is important because installer
REM pick up dll from this directory
64
REM IF NOT EXIST "%QT_DIR%\bin\Qt5Core.dll" GOTO EXIT_WITH_ERROR
Claudio Valerio's avatar
Claudio Valerio committed
65

66
rmdir /S /Q %BUILD_DIR%
67
rmdir /S /Q install
Claudio Valerio's avatar
Claudio Valerio committed
68

69
"%QT_BIN%\qmake.exe" %APPLICATION_NAME%.pro
Claudio Valerio's avatar
Claudio Valerio committed
70

71
call "%LRELEASE%" "%APPLICATION_NAME%.pro"
72

73 74 75
set /p VERSION= < build\win32\release\version
REM remove the last character that is a space
set VERSION=%VERSION: =%
Claudio Valerio's avatar
Claudio Valerio committed
76 77 78


nmake release-install
79
IF NOT EXIST build\win32\release\product\%APPLICATION_NAME%.exe GOTO EXIT_WITH_ERROR
Claudio Valerio's avatar
Claudio Valerio committed
80

81
xcopy C:\%APPLICATION_NAME%\bin\*.dll build\win32\release\product\
82
xcopy "%QT_DIR%\bin\Qt5OpenGL.dll" build\win32\release\product\
83

Claudio Valerio's avatar
Claudio Valerio committed
84 85 86 87
set CUSTOMIZATIONS=build\win32\release\product\customizations
mkdir %CUSTOMIZATIONS%
xcopy /s resources\customizations %CUSTOMIZATIONS%

88
set I18n=build\win32\release\product\i18n
89
xcopy /s "%BASE_QT_TRANSLATIONS_DIRECTORY%\qt_*.qm" %I18n%\
90

91 92
del build\win32\release\product\i18n\qt_help*

93
del "build\win32\release\product\%APPLICATION_NAME%.pdb"
Claudio Valerio's avatar
Claudio Valerio committed
94 95


96
call "%INNO_EXE%" "%SCRIPT_PATH%\%APPLICATION_NAME%.iss" /F"%APPLICATION_NAME%_Installer_%VERSION%"
Claudio Valerio's avatar
Claudio Valerio committed
97

98 99 100 101
GOTO END

:EXIT_WITH_ERROR
echo "Error found"
102
GOTO EOF
103 104

:END
105
echo "%APPLICATION_NAME% build finished"
106 107

:EOF