release.win7.vc9.bat 3.64 KB
Newer Older
1
echo off
Claudio Valerio's avatar
Claudio Valerio committed
2 3 4
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
5
REM the Free Software Foundation, either version 2 of the License, or
Claudio Valerio's avatar
Claudio Valerio committed
6 7 8 9 10 11 12 13 14 15 16
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 ---------------------------------------------------------------------

17 18

set APPLICATION_NAME=OpenBoard
19
set QT_DIR=..\Qt-4.8
Claudio Valerio's avatar
Claudio Valerio committed
20 21 22 23
set QT_BIN=%QT_DIR%\bin

set PROGRAMS_FILE_PATH=C:\Program Files

24
set SEVEN_ZIP_EXE="%PROGRAMS_FILE_PATH%\7-Zip\7z.exe"
Claudio Valerio's avatar
Claudio Valerio committed
25 26 27 28 29
set GIT_BIN=%PROGRAMS_FILE_PATH%\Git\bin
set VS_BIN=%PROGRAMS_FILE_PATH%\Microsoft Visual Studio 9.0\VC\bin
set WIN_SDK_BIN=%PROGRAMS_FILE_PATH%\Microsoft SDKs\Windows\v6.0A\Bin
set INNO_EXE=%PROGRAMS_FILE_PATH%\Inno Setup 5\iscc.exe 
set BUILD_DIR=build\win32\release
30
set LRELEASE=%QT_DIR%\bin\lrelease
31
set BASE_QT_TRANSLATIONS_DIRECTORY=%QT_DIR%\translations
Claudio Valerio's avatar
Claudio Valerio committed
32 33 34 35 36 37 38

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

call "%VS_BIN%\vcvars32.bat"

echo %PATH%

39
REM Third party impoter application
40
set IMPORTER_NAME=OpenBoardImporter
Claudio Valerio's avatar
Claudio Valerio committed
41
set IMPORTER_PATH="%cd%\..\OpenBoard-Importer"
42 43 44 45 46

IF NOT EXIST "%IMPORTER_PATH%" GOTO EXIT_WITH_ERROR
set HOME_DIR="%cd%"
cd %IMPORTER_PATH%
IF EXIST "release" (del "release\*.*" /Q)
47 48 49 50
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)
51
"%QT_BIN%\qmake.exe" %IMPORTER_NAME%.pro"
52
nmake release
53
IF NOT EXIST release\"%IMPORTER_NAME%.exe" GOTO EXIT_WITH_ERROR
54 55
cd %HOME_DIR%

Claudio Valerio's avatar
Claudio Valerio committed
56 57 58
REM this checks if the custom qt directory path
REM is correct. This is important because installer
REM pick up dll from this directory
59
IF NOT EXIST "%QT_DIR%\lib\QtCore4.dll" GOTO EXIT_WITH_ERROR
Claudio Valerio's avatar
Claudio Valerio committed
60

61
rmdir /S /Q %BUILD_DIR%
62
rmdir /S /Q install
Claudio Valerio's avatar
Claudio Valerio committed
63

64
"%QT_BIN%\qmake.exe" %APPLICATION_NAME%.pro
Claudio Valerio's avatar
Claudio Valerio committed
65

66
%LRELEASE% %APPLICATION_NAME%.pro
67
%LRELEASE% %BASE_QT_TRANSLATIONS_DIRECTORY%\translations.pro
68

69 70 71
set /p VERSION= < build\win32\release\version
REM remove the last character that is a space
set VERSION=%VERSION: =%
72 73 74 75 76 77
REM git rev-list --tags --max-count=1 > tmp
REM set /p LAST_TAG= < tmp
REM erase tmp
REM git describe %LAST_TAG% > tmp
REM set /p LAST_TAG_VERSION=< tmp
REM erase tmp
Claudio Valerio's avatar
Claudio Valerio committed
78

79 80
REM echo %VERSION%
REM echo %LAST_TAG_VERSION%
Claudio Valerio's avatar
Claudio Valerio committed
81 82

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

85
xcopy C:\%APPLICATION_NAME%\lib\*.dll build\win32\release\product\
86 87
xcopy %QT_DIR%\lib\QtOpenGL4.dll build\win32\release\product\

Claudio Valerio's avatar
Claudio Valerio committed
88 89 90 91
set CUSTOMIZATIONS=build\win32\release\product\customizations
mkdir %CUSTOMIZATIONS%
xcopy /s resources\customizations %CUSTOMIZATIONS%

92 93
set I18n=build\win32\release\product\i18n
xcopy /s %BASE_QT_TRANSLATIONS_DIRECTORY%\qt_*.qm %I18n%\
94

95 96
del build\win32\release\product\i18n\qt_help*

97
del "build\win32\release\product\%APPLICATION_NAME%.pdb"
Claudio Valerio's avatar
Claudio Valerio committed
98

99
set INSTALLER_PATH=.\install\win32\%APPLICATION_NAME%.exe
Claudio Valerio's avatar
Claudio Valerio committed
100

101
call "%INNO_EXE%" "%APPLICATION_NAME%.iss" /F"%APPLICATION_NAME%"
Claudio Valerio's avatar
Claudio Valerio committed
102

103 104 105
set INSTALL_DIRECTORY=install\win32\
xcopy *.pdf %INSTALL_DIRECTORY%
cd %INSTALL_DIRECTORY%
106
call %SEVEN_ZIP_EXE% a %APPLICATION_NAME%_Windows_%VERSION%.zip *.exe *.pdf
107 108 109 110 111
cd ..\..\
GOTO END

:EXIT_WITH_ERROR
echo "Error found"
112
GOTO EOF
113 114

:END
115
echo "%APPLICATION_NAME% build finished"
116 117

:EOF