forked from Sankore/Sankore-3.1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.win7.vc9.bat
116 lines (88 loc) · 3.57 KB
/
release.win7.vc9.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
echo off
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
REM the Free Software Foundation, either version 2 of the License, or
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 ---------------------------------------------------------------------
set QT_DIR=..\Qt-4.8
set QT_BIN=%QT_DIR%\bin
set PROGRAMS_FILE_PATH=C:\Program Files
set SEVEN_ZIP_EXE="%PROGRAMS_FILE_PATH%\7-Zip\7z.exe"
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.exe
set LRELEASE=%QT_DIR%\bin\lrelease.exe
set BASE_QT_TRANSLATIONS_DIRECTORY=%QT_DIR%\translations
set PATH=%QT_BIN%;%PATH%;%WIN_SDK_BIN%;%GIT_BIN%
call "%VS_BIN%\vcvars32.bat"
REM echo %PATH%
REM check if the mimimal setup
IF NOT EXIST %QT_DIR% GOTO EXIT_WITH_ERROR
IF NOT EXIST %QT_BIN% GOTO EXIT_WITH_ERROR
IF NOT EXIST %SEVEN_ZIP_EXE% GOTO EXIT_WITH_ERROR
IF NOT EXIST %INNO_EXE% GOTO EXIT_WITH_ERROR
echo %LRELEASE%
IF NOT EXIST %LRELEASE% GOTO EXIT_WITH_ERROR
echo "ici"
IF NOT EXIST %BASE_QT_TRANSLATIONS_DIRECTORY% GOTO EXIT_WITH_ERROR
REM this checks if the custom qt directory path
REM is correct. This is important because installer
REM pick up dll from this directory
IF NOT EXIST "%QT_DIR%\lib\QtCore4.dll" GOTO EXIT_WITH_ERROR
rmdir /S /Q %BUILD_DIR%
rmdir /S /Q install
"%QT_BIN%\qmake.exe" Sankore_3.1.pro
%LRELEASE% Sankore_3.1.pro
%LRELEASE% %BASE_QT_TRANSLATIONS_DIRECTORY%\translations.pro
set /p VERSION= < build\win32\release\version
REM remove the last character that is a space
set VERSION=%VERSION: =%
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
REM echo %VERSION%
REM echo %LAST_TAG_VERSION%
nmake release-install
IF NOT EXIST build\win32\release\product\Open-Sankore.exe GOTO EXIT_WITH_ERROR
xcopy C:\OpenSankore\lib\QtMultimediaKit1.dll build\win32\release\product\
xcopy %QT_DIR%\lib\QtOpenGL4.dll build\win32\release\product\
set CUSTOMIZATIONS=build\win32\release\product\customizations
mkdir %CUSTOMIZATIONS%
xcopy /s resources\customizations %CUSTOMIZATIONS%
set STARTUP_HINTS=build\win32\release\product\startupHints
mkdir %STARTUP_HINTS%
xcopy /s resources\startupHints %STARTUP_HINTS%
set I18n=build\win32\release\product\i18n
xcopy /s %BASE_QT_TRANSLATIONS_DIRECTORY%\qt_*.qm %I18n%\
del build\win32\release\product\i18n\qt_help*
del "build\win32\release\product\Sankore.pdb"
set INSTALLER_NAME=Open-Sankore_Setup
set INSTALLER_PATH=.\install\win32\%INSTALLER_NAME%.exe
call "%INNO_EXE%" "Sankore 3.1.iss" /F"%INSTALLER_NAME%"
set INSTALL_DIRECTORY=install\win32\
xcopy *.pdf %INSTALL_DIRECTORY%
xcopy LICENSE.txt %INSTALL_DIRECTORY%
cd %INSTALL_DIRECTORY%
call %SEVEN_ZIP_EXE% a Open-Sankor‚_Windows_%VERSION%.zip *.exe *.pdf *.txt
cd ..\..\
GOTO END
:EXIT_WITH_ERROR
echo "Error found"
GOTO :EOF
:END
echo "Open-Sankore's build finished"
:EOF