| 1 | ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | 
|---|
| 2 | :: | 
|---|
| 3 | :: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). | 
|---|
| 4 | :: Contact: Qt Software Information (qt-info@nokia.com) | 
|---|
| 5 | :: | 
|---|
| 6 | :: This file is part of the tools applications of the Qt Toolkit. | 
|---|
| 7 | :: | 
|---|
| 8 | :: $QT_BEGIN_LICENSE:LGPL$ | 
|---|
| 9 | :: Commercial Usage | 
|---|
| 10 | :: Licensees holding valid Qt Commercial licenses may use this file in | 
|---|
| 11 | :: accordance with the Qt Commercial License Agreement provided with the | 
|---|
| 12 | :: Software or, alternatively, in accordance with the terms contained in | 
|---|
| 13 | :: a written agreement between you and Nokia. | 
|---|
| 14 | :: | 
|---|
| 15 | :: GNU Lesser General Public License Usage | 
|---|
| 16 | :: Alternatively, this file may be used under the terms of the GNU Lesser | 
|---|
| 17 | :: General Public License version 2.1 as published by the Free Software | 
|---|
| 18 | :: Foundation and appearing in the file LICENSE.LGPL included in the | 
|---|
| 19 | :: packaging of this file.  Please review the following information to | 
|---|
| 20 | :: ensure the GNU Lesser General Public License version 2.1 requirements | 
|---|
| 21 | :: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | 
|---|
| 22 | :: | 
|---|
| 23 | :: In addition, as a special exception, Nokia gives you certain | 
|---|
| 24 | :: additional rights. These rights are described in the Nokia Qt LGPL | 
|---|
| 25 | :: Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this | 
|---|
| 26 | :: package. | 
|---|
| 27 | :: | 
|---|
| 28 | :: GNU General Public License Usage | 
|---|
| 29 | :: Alternatively, this file may be used under the terms of the GNU | 
|---|
| 30 | :: General Public License version 3.0 as published by the Free Software | 
|---|
| 31 | :: Foundation and appearing in the file LICENSE.GPL included in the | 
|---|
| 32 | :: packaging of this file.  Please review the following information to | 
|---|
| 33 | :: ensure the GNU General Public License version 3.0 requirements will be | 
|---|
| 34 | :: met: http://www.gnu.org/copyleft/gpl.html. | 
|---|
| 35 | :: | 
|---|
| 36 | :: If you are unsure which license is appropriate for your use, please | 
|---|
| 37 | :: contact the sales department at qt-sales@nokia.com. | 
|---|
| 38 | :: $QT_END_LICENSE$ | 
|---|
| 39 | :: | 
|---|
| 40 | :: This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 
|---|
| 41 | :: WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 
|---|
| 42 | :: | 
|---|
| 43 | ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | 
|---|
| 44 | call :%1 %2 | 
|---|
| 45 | goto END | 
|---|
| 46 |  | 
|---|
| 47 | :begin | 
|---|
| 48 | call :reset | 
|---|
| 49 | echo !define PRODUCT_NAME "%~1" >> %IWMAKE_NSISCONF% | 
|---|
| 50 | echo !define INSTALL_ROOT "%IWMAKE_ROOT%" >> %IWMAKE_NSISCONF% | 
|---|
| 51 | goto :eof | 
|---|
| 52 |  | 
|---|
| 53 | :output | 
|---|
| 54 | set IWMAKE_OUTPUT_FILE=%~1 | 
|---|
| 55 | echo !define OUTPUT_FILE "%~1" >> %IWMAKE_NSISCONF% | 
|---|
| 56 | goto :eof | 
|---|
| 57 |  | 
|---|
| 58 | :module | 
|---|
| 59 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %~1 | 
|---|
| 60 | echo !define MODULE_%IWMAKE_RESULT% >> %IWMAKE_NSISCONF% | 
|---|
| 61 | goto :eof | 
|---|
| 62 |  | 
|---|
| 63 | :enable | 
|---|
| 64 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %~1 | 
|---|
| 65 | echo !define USE_%IWMAKE_RESULT:"=% >> %IWMAKE_NSISCONF% | 
|---|
| 66 | goto :eof | 
|---|
| 67 |  | 
|---|
| 68 | :disable | 
|---|
| 69 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %~1 | 
|---|
| 70 | echo !undef USE_%IWMAKE_RESULT:"=% >> %IWMAKE_NSISCONF% | 
|---|
| 71 | goto :eof | 
|---|
| 72 |  | 
|---|
| 73 | :startmenu | 
|---|
| 74 | echo !define DEFAULT_STARTMENU_STRING "%~1" >> %IWMAKE_NSISCONF% | 
|---|
| 75 | goto :eof | 
|---|
| 76 |  | 
|---|
| 77 | :reset | 
|---|
| 78 | if exist "%IWMAKE_NSISCONF%" del /Q /F "%IWMAKE_NSISCONF%" | 
|---|
| 79 | goto :eof | 
|---|
| 80 |  | 
|---|
| 81 | :instdir | 
|---|
| 82 | for /F "tokens=1,2*" %%m in ("%~1") do set IWMAKE_TMP=%%~m& set IWMAKE_TMP2=%%~n& set IWMAKE_TMP3="%%~o" | 
|---|
| 83 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %IWMAKE_TMP% | 
|---|
| 84 | echo !define INSTDIR_%IWMAKE_TMP2% %IWMAKE_RESULT:"=% >> "%IWMAKE_NSISCONF%" | 
|---|
| 85 | echo !define INSTDIR_%IWMAKE_TMP2%_TEXT %IWMAKE_TMP3% >> "%IWMAKE_NSISCONF%" | 
|---|
| 86 | goto :eof | 
|---|
| 87 |  | 
|---|
| 88 | :version | 
|---|
| 89 | echo !define PRODUCT_VERSION "%~1" >> "%IWMAKE_NSISCONF%" | 
|---|
| 90 | goto :eof | 
|---|
| 91 |  | 
|---|
| 92 | :readme | 
|---|
| 93 | echo !define README_FILE "%~1" >> "%IWMAKE_NSISCONF%" | 
|---|
| 94 | goto :eof | 
|---|
| 95 |  | 
|---|
| 96 | :licenseFile | 
|---|
| 97 | echo !define LICENSE_FILE "%~1" >> "%IWMAKE_NSISCONF%" | 
|---|
| 98 | goto :eof | 
|---|
| 99 |  | 
|---|
| 100 | :runfunction | 
|---|
| 101 | echo !define RUN_FUNCTION "%~1" >> "%IWMAKE_NSISCONF%" | 
|---|
| 102 | goto :eof | 
|---|
| 103 |  | 
|---|
| 104 | :readmefunction | 
|---|
| 105 | echo !define README_FUNCTION "%~1" >> "%IWMAKE_NSISCONF%" | 
|---|
| 106 | goto :eof | 
|---|
| 107 |  | 
|---|
| 108 | :welcomenote | 
|---|
| 109 | echo !define WELCOME_NOTE "%~1" >> "%IWMAKE_NSISCONF%" | 
|---|
| 110 | goto :eof | 
|---|
| 111 |  | 
|---|
| 112 | :updateplugins | 
|---|
| 113 | call "%IWMAKE_SCRIPTDIR%\batch\copy.bat" extsync INetLoad | 
|---|
| 114 | xcopy /Q /Y /R "%IWMAKE_ROOT%\INetLoad\INetLoad.dll" "%IWMAKE_NSISPATH%\Plugins\" >> %IWMAKE_LOGFILE% | 
|---|
| 115 | ::  xcopy /Q /Y /R "%IWMAKE_SCRIPTDIR%\nsis\qtnsisext\qtnsisext.dll" "%IWMAKE_NSISPATH%\Plugins\" >> %IWMAKE_LOGFILE% | 
|---|
| 116 | goto :eof | 
|---|
| 117 |  | 
|---|
| 118 | :defineDir | 
|---|
| 119 | for /F "tokens=1,2*" %%m in ("%~1") do set IWMAKE_TMP=%%~m& set IWMAKE_TMP2=%%~n& set IWMAKE_TMP3=%%~o | 
|---|
| 120 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %IWMAKE_TMP% | 
|---|
| 121 | set IWMAKE_TMP=%IWMAKE_RESULT% | 
|---|
| 122 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %IWMAKE_TMP2% | 
|---|
| 123 | set IWMAKE_TMP2=%IWMAKE_RESULT% | 
|---|
| 124 | echo !define MODULE_%IWMAKE_TMP%_%IWMAKE_TMP2% "%IWMAKE_ROOT%\%IWMAKE_TMP3%" >> "%IWMAKE_NSISCONF%" | 
|---|
| 125 | goto :eof | 
|---|
| 126 |  | 
|---|
| 127 | :define | 
|---|
| 128 | for /F "tokens=1,2*" %%m in ("%~1") do set IWMAKE_TMP=%%~m& set IWMAKE_TMP2=%%~n& set IWMAKE_TMP3="%%~o" | 
|---|
| 129 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %IWMAKE_TMP% | 
|---|
| 130 | set IWMAKE_TMP=%IWMAKE_RESULT% | 
|---|
| 131 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %IWMAKE_TMP2% | 
|---|
| 132 | set IWMAKE_TMP2=%IWMAKE_RESULT% | 
|---|
| 133 | if %IWMAKE_TMP3%=="" set IWMAKE_TMP3= | 
|---|
| 134 | echo !define MODULE_%IWMAKE_TMP%_%IWMAKE_TMP2% %IWMAKE_TMP3% >> "%IWMAKE_NSISCONF%" | 
|---|
| 135 | goto :eof | 
|---|
| 136 |  | 
|---|
| 137 | :src | 
|---|
| 138 | for /F "tokens=1*" %%m in ("%~1") do set IWMAKE_TMP=%%~m& set IWMAKE_TMP2=%%~n | 
|---|
| 139 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %IWMAKE_TMP% | 
|---|
| 140 | set IWMAKE_TMP=%IWMAKE_RESULT% | 
|---|
| 141 | set IWMAKE_TMP3="%IWMAKE_ROOT%\%IWMAKE_TMP2%" | 
|---|
| 142 | echo !define MODULE_%IWMAKE_TMP%_ROOT %IWMAKE_TMP3% >> "%IWMAKE_NSISCONF%" | 
|---|
| 143 | goto :eof | 
|---|
| 144 |  | 
|---|
| 145 | :buildDir | 
|---|
| 146 | for /F "tokens=1*" %%m in ("%~1") do set IWMAKE_TMP=%%~m& set IWMAKE_TMP2=%%~n | 
|---|
| 147 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %IWMAKE_TMP% | 
|---|
| 148 | set IWMAKE_TMP=%IWMAKE_RESULT% | 
|---|
| 149 | set IWMAKE_TMP3="%IWMAKE_ROOT%\%IWMAKE_TMP2%" | 
|---|
| 150 | echo !define MODULE_%IWMAKE_TMP%_BUILDDIR %IWMAKE_TMP3% >> "%IWMAKE_NSISCONF%" | 
|---|
| 151 | for /F "eol=- tokens=1,2,3" %%m in ('%SystemRoot%\system32\find "QT_PACKAGEDATE_STR" %IWMAKE_ROOT%\%IWMAKE_TMP2%\src\corelib\global\qglobal.h') do echo !define MODULE_LICENSECHECK_PACKAGEDATE %%o >> "%IWMAKE_NSISCONF%" | 
|---|
| 152 | goto :eof | 
|---|
| 153 |  | 
|---|
| 154 | :compile | 
|---|
| 155 | call :required | 
|---|
| 156 | pushd %IWMAKE_SCRIPTDIR%\nsis | 
|---|
| 157 | "%IWMAKE_NSISPATH%\makensis.exe" installer.nsi >> %IWMAKE_LOGFILE% | 
|---|
| 158 | popd | 
|---|
| 159 | goto :eof | 
|---|
| 160 |  | 
|---|
| 161 | :required | 
|---|
| 162 | call :setrequired PRODUCT_NAME | 
|---|
| 163 | call :setrequired INSTALL_ROOT | 
|---|
| 164 | call :setrequired PRODUCT_VERSION | 
|---|
| 165 | call :setrequired OUTPUT_FILE | 
|---|
| 166 | call :setrequired INSTDIR_0 | 
|---|
| 167 | call :setrequired DEFAULT_STARTMENU_STRING | 
|---|
| 168 | goto :eof | 
|---|
| 169 |  | 
|---|
| 170 | :setrequired | 
|---|
| 171 | echo !ifndef %1 >> "%IWMAKE_NSISCONF%" | 
|---|
| 172 | echo   !error "%1 must be in the .conf file..." >> "%IWMAKE_NSISCONF%" | 
|---|
| 173 | echo !endif >> "%IWMAKE_NSISCONF%" | 
|---|
| 174 | goto :eof | 
|---|
| 175 |  | 
|---|
| 176 | :makeFileList | 
|---|
| 177 | for /F "tokens=1*" %%m in ("%~1") do set IWMAKE_TMP=%%~m& set IWMAKE_TMP2=%%~n | 
|---|
| 178 | call "%IWMAKE_SCRIPTDIR%\batch\toupper.bat" %IWMAKE_TMP% | 
|---|
| 179 | set IWMAKE_TMP=%IWMAKE_RESULT% | 
|---|
| 180 | set IWMAKE_TMP3="%IWMAKE_ROOT%\%IWMAKE_TMP2%" | 
|---|
| 181 |  | 
|---|
| 182 |  | 
|---|
| 183 | echo !macro MODULE_%IWMAKE_TMP%_INSTALLFILES >> "%IWMAKE_NSISCONF%" | 
|---|
| 184 |  | 
|---|
| 185 | pushd %IWMAKE_TMP3% | 
|---|
| 186 |  | 
|---|
| 187 | echo set IWMAKE_TMP2=%%IWMAKE_TMP2:%CD%\=%% > "%IWMAKE_ROOT%\iwmake_tmp.bat" | 
|---|
| 188 |  | 
|---|
| 189 | dir /AD /B /S | %SystemRoot%\system32\sort /R > "%IWMAKE_ROOT%\iwmake_tmp.txt" | 
|---|
| 190 | for /F "tokens=1" %%m in (%IWMAKE_ROOT%\iwmake_tmp.txt) do call :addInstallDirectory "%%m" | 
|---|
| 191 |  | 
|---|
| 192 |  | 
|---|
| 193 | dir /A-D /B /S > "%IWMAKE_ROOT%\iwmake_tmp.txt" | 
|---|
| 194 | for /F "tokens=1" %%m in (%IWMAKE_ROOT%\iwmake_tmp.txt) do call :addInstallFile "%%m" | 
|---|
| 195 |  | 
|---|
| 196 | popd | 
|---|
| 197 | echo !macroend >> "%IWMAKE_NSISCONF%" | 
|---|
| 198 |  | 
|---|
| 199 |  | 
|---|
| 200 | echo !macro MODULE_%IWMAKE_TMP%_REMOVE removepath >> "%IWMAKE_NSISCONF%" | 
|---|
| 201 | echo     strcmp ${removepath} "" MODULE_%IWMAKE_TMP%_REMOVE_SAFETYLABEL >> "%IWMAKE_NSISCONF%" | 
|---|
| 202 | pushd %IWMAKE_TMP3% | 
|---|
| 203 |  | 
|---|
| 204 | echo set IWMAKE_TMP2=%%IWMAKE_TMP2:%CD%\=%% > "%IWMAKE_ROOT%\iwmake_tmp.bat" | 
|---|
| 205 |  | 
|---|
| 206 | dir /A-D /B /S > "%IWMAKE_ROOT%\iwmake_tmp.txt" | 
|---|
| 207 | for /F "tokens=1" %%m in (%IWMAKE_ROOT%\iwmake_tmp.txt) do call :addRemoveFiles "%%m" | 
|---|
| 208 |  | 
|---|
| 209 | dir /AD /B /S | %SystemRoot%\system32\sort /R > "%IWMAKE_ROOT%\iwmake_tmp.txt" | 
|---|
| 210 | for /F "tokens=1" %%m in (%IWMAKE_ROOT%\iwmake_tmp.txt) do call :addRemoveDirectory "%%m" | 
|---|
| 211 |  | 
|---|
| 212 | popd | 
|---|
| 213 | echo     MODULE_%IWMAKE_TMP%_REMOVE_SAFETYLABEL: >> "%IWMAKE_NSISCONF%" | 
|---|
| 214 | echo !macroend >> "%IWMAKE_NSISCONF%" | 
|---|
| 215 | goto :eof | 
|---|
| 216 |  | 
|---|
| 217 | :addInstallFile | 
|---|
| 218 | set IWMAKE_TMP2=%~1 | 
|---|
| 219 | call "%IWMAKE_ROOT%\iwmake_tmp.bat" | 
|---|
| 220 | echo     File "/oname=%IWMAKE_TMP2%" "%~1" >> "%IWMAKE_NSISCONF%" | 
|---|
| 221 | goto :eof | 
|---|
| 222 |  | 
|---|
| 223 | :addInstallDirectory | 
|---|
| 224 | set IWMAKE_TMP2=%~1 | 
|---|
| 225 | call "%IWMAKE_ROOT%\iwmake_tmp.bat" | 
|---|
| 226 | echo     CreateDirectory "$OUTDIR\%IWMAKE_TMP2%" >> "%IWMAKE_NSISCONF%" | 
|---|
| 227 | goto :eof | 
|---|
| 228 |  | 
|---|
| 229 | :addRemoveDirectory | 
|---|
| 230 | set IWMAKE_TMP2=%~1 | 
|---|
| 231 | call "%IWMAKE_ROOT%\iwmake_tmp.bat" | 
|---|
| 232 | echo     RMDir ${removepath}\%IWMAKE_TMP2% >> "%IWMAKE_NSISCONF%" | 
|---|
| 233 | goto :eof | 
|---|
| 234 |  | 
|---|
| 235 | :addRemoveFiles | 
|---|
| 236 | set IWMAKE_TMP2=%~1 | 
|---|
| 237 | call "%IWMAKE_ROOT%\iwmake_tmp.bat" | 
|---|
| 238 | echo     Delete ${removepath}\%IWMAKE_TMP2% >> "%IWMAKE_NSISCONF%" | 
|---|
| 239 | goto :eof | 
|---|
| 240 |  | 
|---|
| 241 | :sign | 
|---|
| 242 | echo Signing Installer ... | 
|---|
| 243 | %IWMAKE_SIGNPATH%\signtool.exe sign /v /t http://timestamp.verisign.com/scripts/timestamp.dll /f "%IWMAKE_SIGNPATH%\keys.pfx" "%IWMAKE_OUTPUT_FILE%" >> %IWMAKE_LOGFILE% | 
|---|
| 244 | goto :eof | 
|---|
| 245 |  | 
|---|
| 246 | :openpackage | 
|---|
| 247 | echo !define OPENSOURCE_BUILD >> "%IWMAKE_NSISCONF%" | 
|---|
| 248 | goto :eof | 
|---|
| 249 |  | 
|---|
| 250 | :END | 
|---|