Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | |
michael@0 | 5 | ################################################################################ |
michael@0 | 6 | # Modified versions of macros provided by NSIS |
michael@0 | 7 | |
michael@0 | 8 | !ifndef OVERRIDES_INCLUDED |
michael@0 | 9 | !define OVERRIDES_INCLUDED |
michael@0 | 10 | |
michael@0 | 11 | !ifndef ___WINVER__NSH___ |
michael@0 | 12 | !include WinVer.nsh |
michael@0 | 13 | !endif |
michael@0 | 14 | |
michael@0 | 15 | ; When including a file check if its verbose macro is defined to prevent |
michael@0 | 16 | ; loading the file a second time. |
michael@0 | 17 | !ifmacrondef TEXTFUNC_VERBOSE |
michael@0 | 18 | !include TextFunc.nsh |
michael@0 | 19 | !endif |
michael@0 | 20 | |
michael@0 | 21 | !ifmacrondef FILEFUNC_VERBOSE |
michael@0 | 22 | !include FileFunc.nsh |
michael@0 | 23 | !endif |
michael@0 | 24 | |
michael@0 | 25 | !macro __MOZ__WinVer_DefineOSTests WinVer |
michael@0 | 26 | !insertmacro __WinVer_DefineOSTest AtLeast ${WinVer} "" |
michael@0 | 27 | !insertmacro __WinVer_DefineOSTest Is ${WinVer} "" |
michael@0 | 28 | !insertmacro __WinVer_DefineOSTest AtMost ${WinVer} "" |
michael@0 | 29 | !macroend |
michael@0 | 30 | |
michael@0 | 31 | !ifndef WINVER_8 |
michael@0 | 32 | !define WINVER_8 0x06020000 ;6.02.9200 |
michael@0 | 33 | !insertmacro __MOZ__WinVer_DefineOSTests 8 |
michael@0 | 34 | !endif |
michael@0 | 35 | |
michael@0 | 36 | !ifndef WINVER_8.1 |
michael@0 | 37 | !define WINVER_8.1 0x06030000 ;6.03.9600 |
michael@0 | 38 | !insertmacro __MOZ__WinVer_DefineOSTests 8.1 |
michael@0 | 39 | !endif |
michael@0 | 40 | |
michael@0 | 41 | !ifndef WINVER_2012 |
michael@0 | 42 | !define WINVER_2012 0x06020001 ;6.02.9200 |
michael@0 | 43 | !insertmacro __MOZ__WinVer_DefineOSTests 2012 |
michael@0 | 44 | !endif |
michael@0 | 45 | |
michael@0 | 46 | !ifndef WINVER_2012R2 |
michael@0 | 47 | !define WINVER_2012R2 0x06030001 ;6.03.9600 |
michael@0 | 48 | !insertmacro __MOZ__WinVer_DefineOSTests 2012R2 |
michael@0 | 49 | !endif |
michael@0 | 50 | |
michael@0 | 51 | !verbose push |
michael@0 | 52 | !verbose 3 |
michael@0 | 53 | !ifndef _OVERRIDE_VERBOSE |
michael@0 | 54 | !define _OVERRIDE_VERBOSE 3 |
michael@0 | 55 | !endif |
michael@0 | 56 | !verbose ${_OVERRIDE_VERBOSE} |
michael@0 | 57 | !define OVERRIDE_VERBOSE `!insertmacro OVERRIDE_VERBOSE` |
michael@0 | 58 | !define _OVERRIDE_UN |
michael@0 | 59 | !define _OVERRIDE_S |
michael@0 | 60 | !verbose pop |
michael@0 | 61 | |
michael@0 | 62 | !macro OVERRIDE_VERBOSE _VERBOSE |
michael@0 | 63 | !verbose push |
michael@0 | 64 | !verbose 3 |
michael@0 | 65 | !undef _OVERRIDE_VERBOSE |
michael@0 | 66 | !define _OVERRIDE_VERBOSE ${_VERBOSE} |
michael@0 | 67 | !verbose pop |
michael@0 | 68 | !macroend |
michael@0 | 69 | |
michael@0 | 70 | ; Modified version of Locate from the NSIS File Functions Header v3.4 (it has |
michael@0 | 71 | ; the same version in earlier versions of NSIS even though it has changed) that |
michael@0 | 72 | ; is distributed with NSIS v2.46-Unicode. This version has the calls to |
michael@0 | 73 | ; SetDetailsPrint commented out. |
michael@0 | 74 | ; See <NSIS v2.46-Unicode App Dir>/include/FileFunc.nsh for more information. |
michael@0 | 75 | !macro LocateNoDetailsCall _PATH _OPTIONS _FUNC |
michael@0 | 76 | !verbose push |
michael@0 | 77 | !verbose ${_OVERRIDE_VERBOSE} |
michael@0 | 78 | Push $0 |
michael@0 | 79 | Push `${_PATH}` |
michael@0 | 80 | Push `${_OPTIONS}` |
michael@0 | 81 | GetFunctionAddress $0 `${_FUNC}` |
michael@0 | 82 | Push `$0` |
michael@0 | 83 | Call LocateNoDetails |
michael@0 | 84 | Pop $0 |
michael@0 | 85 | !verbose pop |
michael@0 | 86 | !macroend |
michael@0 | 87 | |
michael@0 | 88 | !macro LocateNoDetails |
michael@0 | 89 | !ifndef ${_OVERRIDE_UN}LocateNoDetails |
michael@0 | 90 | !verbose push |
michael@0 | 91 | !verbose ${_OVERRIDE_VERBOSE} |
michael@0 | 92 | !define ${_OVERRIDE_UN}LocateNoDetails `!insertmacro ${_OVERRIDE_UN}LocateNoDetailsCall` |
michael@0 | 93 | |
michael@0 | 94 | Function ${_OVERRIDE_UN}LocateNoDetails |
michael@0 | 95 | Exch $2 |
michael@0 | 96 | Exch |
michael@0 | 97 | Exch $1 |
michael@0 | 98 | Exch |
michael@0 | 99 | Exch 2 |
michael@0 | 100 | Exch $0 |
michael@0 | 101 | Exch 2 |
michael@0 | 102 | Push $3 |
michael@0 | 103 | Push $4 |
michael@0 | 104 | Push $5 |
michael@0 | 105 | Push $6 |
michael@0 | 106 | Push $7 |
michael@0 | 107 | Push $8 |
michael@0 | 108 | Push $9 |
michael@0 | 109 | Push $R6 |
michael@0 | 110 | Push $R7 |
michael@0 | 111 | Push $R8 |
michael@0 | 112 | Push $R9 |
michael@0 | 113 | ClearErrors |
michael@0 | 114 | |
michael@0 | 115 | StrCpy $3 '' |
michael@0 | 116 | StrCpy $4 '' |
michael@0 | 117 | StrCpy $5 '' |
michael@0 | 118 | StrCpy $6 '' |
michael@0 | 119 | StrCpy $7 '' |
michael@0 | 120 | StrCpy $8 0 |
michael@0 | 121 | StrCpy $R7 '' |
michael@0 | 122 | |
michael@0 | 123 | StrCpy $R9 $0 1 -1 |
michael@0 | 124 | StrCmp $R9 '\' 0 +3 |
michael@0 | 125 | StrCpy $0 $0 -1 |
michael@0 | 126 | goto -3 |
michael@0 | 127 | IfFileExists '$0\*.*' 0 error |
michael@0 | 128 | |
michael@0 | 129 | option: |
michael@0 | 130 | StrCpy $R9 $1 1 |
michael@0 | 131 | StrCpy $1 $1 '' 1 |
michael@0 | 132 | StrCmp $R9 ' ' -2 |
michael@0 | 133 | StrCmp $R9 '' sizeset |
michael@0 | 134 | StrCmp $R9 '/' 0 -4 |
michael@0 | 135 | StrCpy $9 -1 |
michael@0 | 136 | IntOp $9 $9 + 1 |
michael@0 | 137 | StrCpy $R9 $1 1 $9 |
michael@0 | 138 | StrCmp $R9 '' +2 |
michael@0 | 139 | StrCmp $R9 '/' 0 -3 |
michael@0 | 140 | StrCpy $R8 $1 $9 |
michael@0 | 141 | StrCpy $R8 $R8 '' 2 |
michael@0 | 142 | StrCpy $R9 $R8 '' -1 |
michael@0 | 143 | StrCmp $R9 ' ' 0 +3 |
michael@0 | 144 | StrCpy $R8 $R8 -1 |
michael@0 | 145 | goto -3 |
michael@0 | 146 | StrCpy $R9 $1 2 |
michael@0 | 147 | StrCpy $1 $1 '' $9 |
michael@0 | 148 | |
michael@0 | 149 | StrCmp $R9 'L=' 0 mask |
michael@0 | 150 | StrCpy $3 $R8 |
michael@0 | 151 | StrCmp $3 '' +6 |
michael@0 | 152 | StrCmp $3 'FD' +5 |
michael@0 | 153 | StrCmp $3 'F' +4 |
michael@0 | 154 | StrCmp $3 'D' +3 |
michael@0 | 155 | StrCmp $3 'DE' +2 |
michael@0 | 156 | StrCmp $3 'FDE' 0 error |
michael@0 | 157 | goto option |
michael@0 | 158 | |
michael@0 | 159 | mask: |
michael@0 | 160 | StrCmp $R9 'M=' 0 size |
michael@0 | 161 | StrCpy $4 $R8 |
michael@0 | 162 | goto option |
michael@0 | 163 | |
michael@0 | 164 | size: |
michael@0 | 165 | StrCmp $R9 'S=' 0 gotosubdir |
michael@0 | 166 | StrCpy $6 $R8 |
michael@0 | 167 | goto option |
michael@0 | 168 | |
michael@0 | 169 | gotosubdir: |
michael@0 | 170 | StrCmp $R9 'G=' 0 banner |
michael@0 | 171 | StrCpy $7 $R8 |
michael@0 | 172 | StrCmp $7 '' +3 |
michael@0 | 173 | StrCmp $7 '1' +2 |
michael@0 | 174 | StrCmp $7 '0' 0 error |
michael@0 | 175 | goto option |
michael@0 | 176 | |
michael@0 | 177 | banner: |
michael@0 | 178 | StrCmp $R9 'B=' 0 error |
michael@0 | 179 | StrCpy $R7 $R8 |
michael@0 | 180 | StrCmp $R7 '' +3 |
michael@0 | 181 | StrCmp $R7 '1' +2 |
michael@0 | 182 | StrCmp $R7 '0' 0 error |
michael@0 | 183 | goto option |
michael@0 | 184 | |
michael@0 | 185 | sizeset: |
michael@0 | 186 | StrCmp $6 '' default |
michael@0 | 187 | StrCpy $9 0 |
michael@0 | 188 | StrCpy $R9 $6 1 $9 |
michael@0 | 189 | StrCmp $R9 '' +4 |
michael@0 | 190 | StrCmp $R9 ':' +3 |
michael@0 | 191 | IntOp $9 $9 + 1 |
michael@0 | 192 | goto -4 |
michael@0 | 193 | StrCpy $5 $6 $9 |
michael@0 | 194 | IntOp $9 $9 + 1 |
michael@0 | 195 | StrCpy $1 $6 1 -1 |
michael@0 | 196 | StrCpy $6 $6 -1 $9 |
michael@0 | 197 | StrCmp $5 '' +2 |
michael@0 | 198 | IntOp $5 $5 + 0 |
michael@0 | 199 | StrCmp $6 '' +2 |
michael@0 | 200 | IntOp $6 $6 + 0 |
michael@0 | 201 | |
michael@0 | 202 | StrCmp $1 'B' 0 +3 |
michael@0 | 203 | StrCpy $1 1 |
michael@0 | 204 | goto default |
michael@0 | 205 | StrCmp $1 'K' 0 +3 |
michael@0 | 206 | StrCpy $1 1024 |
michael@0 | 207 | goto default |
michael@0 | 208 | StrCmp $1 'M' 0 +3 |
michael@0 | 209 | StrCpy $1 1048576 |
michael@0 | 210 | goto default |
michael@0 | 211 | StrCmp $1 'G' 0 error |
michael@0 | 212 | StrCpy $1 1073741824 |
michael@0 | 213 | |
michael@0 | 214 | default: |
michael@0 | 215 | StrCmp $3 '' 0 +2 |
michael@0 | 216 | StrCpy $3 'FD' |
michael@0 | 217 | StrCmp $4 '' 0 +2 |
michael@0 | 218 | StrCpy $4 '*.*' |
michael@0 | 219 | StrCmp $7 '' 0 +2 |
michael@0 | 220 | StrCpy $7 '1' |
michael@0 | 221 | StrCmp $R7 '' 0 +2 |
michael@0 | 222 | StrCpy $R7 '0' |
michael@0 | 223 | StrCpy $7 'G$7B$R7' |
michael@0 | 224 | |
michael@0 | 225 | StrCpy $8 1 |
michael@0 | 226 | Push $0 |
michael@0 | 227 | ; SetDetailsPrint textonly |
michael@0 | 228 | |
michael@0 | 229 | nextdir: |
michael@0 | 230 | IntOp $8 $8 - 1 |
michael@0 | 231 | Pop $R8 |
michael@0 | 232 | |
michael@0 | 233 | StrCpy $9 $7 2 2 |
michael@0 | 234 | StrCmp $9 'B0' +3 |
michael@0 | 235 | GetLabelAddress $9 findfirst |
michael@0 | 236 | goto call |
michael@0 | 237 | ; DetailPrint 'Search in: $R8' |
michael@0 | 238 | |
michael@0 | 239 | findfirst: |
michael@0 | 240 | FindFirst $0 $R7 '$R8\$4' |
michael@0 | 241 | IfErrors subdir |
michael@0 | 242 | StrCmp $R7 '.' 0 dir |
michael@0 | 243 | FindNext $0 $R7 |
michael@0 | 244 | StrCmp $R7 '..' 0 dir |
michael@0 | 245 | FindNext $0 $R7 |
michael@0 | 246 | IfErrors 0 dir |
michael@0 | 247 | FindClose $0 |
michael@0 | 248 | goto subdir |
michael@0 | 249 | |
michael@0 | 250 | dir: |
michael@0 | 251 | IfFileExists '$R8\$R7\*.*' 0 file |
michael@0 | 252 | StrCpy $R6 '' |
michael@0 | 253 | StrCmp $3 'DE' +4 |
michael@0 | 254 | StrCmp $3 'FDE' +3 |
michael@0 | 255 | StrCmp $3 'FD' precall |
michael@0 | 256 | StrCmp $3 'F' findnext precall |
michael@0 | 257 | FindFirst $9 $R9 '$R8\$R7\*.*' |
michael@0 | 258 | StrCmp $R9 '.' 0 +4 |
michael@0 | 259 | FindNext $9 $R9 |
michael@0 | 260 | StrCmp $R9 '..' 0 +2 |
michael@0 | 261 | FindNext $9 $R9 |
michael@0 | 262 | FindClose $9 |
michael@0 | 263 | IfErrors precall findnext |
michael@0 | 264 | |
michael@0 | 265 | file: |
michael@0 | 266 | StrCmp $3 'FDE' +3 |
michael@0 | 267 | StrCmp $3 'FD' +2 |
michael@0 | 268 | StrCmp $3 'F' 0 findnext |
michael@0 | 269 | StrCpy $R6 0 |
michael@0 | 270 | StrCmp $5$6 '' precall |
michael@0 | 271 | FileOpen $9 '$R8\$R7' r |
michael@0 | 272 | IfErrors +3 |
michael@0 | 273 | FileSeek $9 0 END $R6 |
michael@0 | 274 | FileClose $9 |
michael@0 | 275 | System::Int64Op $R6 / $1 |
michael@0 | 276 | Pop $R6 |
michael@0 | 277 | StrCmp $5 '' +2 |
michael@0 | 278 | IntCmp $R6 $5 0 findnext |
michael@0 | 279 | StrCmp $6 '' +2 |
michael@0 | 280 | IntCmp $R6 $6 0 0 findnext |
michael@0 | 281 | |
michael@0 | 282 | precall: |
michael@0 | 283 | StrCpy $9 0 |
michael@0 | 284 | StrCpy $R9 '$R8\$R7' |
michael@0 | 285 | |
michael@0 | 286 | call: |
michael@0 | 287 | Push $0 |
michael@0 | 288 | Push $1 |
michael@0 | 289 | Push $2 |
michael@0 | 290 | Push $3 |
michael@0 | 291 | Push $4 |
michael@0 | 292 | Push $5 |
michael@0 | 293 | Push $6 |
michael@0 | 294 | Push $7 |
michael@0 | 295 | Push $8 |
michael@0 | 296 | Push $9 |
michael@0 | 297 | Push $R7 |
michael@0 | 298 | Push $R8 |
michael@0 | 299 | StrCmp $9 0 +4 |
michael@0 | 300 | StrCpy $R6 '' |
michael@0 | 301 | StrCpy $R7 '' |
michael@0 | 302 | StrCpy $R9 '' |
michael@0 | 303 | Call $2 |
michael@0 | 304 | Pop $R9 |
michael@0 | 305 | Pop $R8 |
michael@0 | 306 | Pop $R7 |
michael@0 | 307 | Pop $9 |
michael@0 | 308 | Pop $8 |
michael@0 | 309 | Pop $7 |
michael@0 | 310 | Pop $6 |
michael@0 | 311 | Pop $5 |
michael@0 | 312 | Pop $4 |
michael@0 | 313 | Pop $3 |
michael@0 | 314 | Pop $2 |
michael@0 | 315 | Pop $1 |
michael@0 | 316 | Pop $0 |
michael@0 | 317 | |
michael@0 | 318 | IfErrors 0 +3 |
michael@0 | 319 | FindClose $0 |
michael@0 | 320 | goto error |
michael@0 | 321 | StrCmp $R9 'StopLocateNoDetails' 0 +3 |
michael@0 | 322 | FindClose $0 |
michael@0 | 323 | goto clearstack |
michael@0 | 324 | goto $9 |
michael@0 | 325 | |
michael@0 | 326 | findnext: |
michael@0 | 327 | FindNext $0 $R7 |
michael@0 | 328 | IfErrors 0 dir |
michael@0 | 329 | FindClose $0 |
michael@0 | 330 | |
michael@0 | 331 | subdir: |
michael@0 | 332 | StrCpy $9 $7 2 |
michael@0 | 333 | StrCmp $9 'G0' end |
michael@0 | 334 | FindFirst $0 $R7 '$R8\*.*' |
michael@0 | 335 | StrCmp $R7 '.' 0 pushdir |
michael@0 | 336 | FindNext $0 $R7 |
michael@0 | 337 | StrCmp $R7 '..' 0 pushdir |
michael@0 | 338 | FindNext $0 $R7 |
michael@0 | 339 | IfErrors 0 pushdir |
michael@0 | 340 | FindClose $0 |
michael@0 | 341 | StrCmp $8 0 end nextdir |
michael@0 | 342 | |
michael@0 | 343 | pushdir: |
michael@0 | 344 | IfFileExists '$R8\$R7\*.*' 0 +3 |
michael@0 | 345 | Push '$R8\$R7' |
michael@0 | 346 | IntOp $8 $8 + 1 |
michael@0 | 347 | FindNext $0 $R7 |
michael@0 | 348 | IfErrors 0 pushdir |
michael@0 | 349 | FindClose $0 |
michael@0 | 350 | StrCmp $8 0 end nextdir |
michael@0 | 351 | |
michael@0 | 352 | error: |
michael@0 | 353 | SetErrors |
michael@0 | 354 | |
michael@0 | 355 | clearstack: |
michael@0 | 356 | StrCmp $8 0 end |
michael@0 | 357 | IntOp $8 $8 - 1 |
michael@0 | 358 | Pop $R8 |
michael@0 | 359 | goto clearstack |
michael@0 | 360 | |
michael@0 | 361 | end: |
michael@0 | 362 | ; SetDetailsPrint both |
michael@0 | 363 | Pop $R9 |
michael@0 | 364 | Pop $R8 |
michael@0 | 365 | Pop $R7 |
michael@0 | 366 | Pop $R6 |
michael@0 | 367 | Pop $9 |
michael@0 | 368 | Pop $8 |
michael@0 | 369 | Pop $7 |
michael@0 | 370 | Pop $6 |
michael@0 | 371 | Pop $5 |
michael@0 | 372 | Pop $4 |
michael@0 | 373 | Pop $3 |
michael@0 | 374 | Pop $2 |
michael@0 | 375 | Pop $1 |
michael@0 | 376 | Pop $0 |
michael@0 | 377 | FunctionEnd |
michael@0 | 378 | |
michael@0 | 379 | !verbose pop |
michael@0 | 380 | !endif |
michael@0 | 381 | !macroend |
michael@0 | 382 | |
michael@0 | 383 | !macro un.LocateNoDetailsCall _PATH _OPTIONS _FUNC |
michael@0 | 384 | !verbose push |
michael@0 | 385 | !verbose ${_OVERRIDE_VERBOSE} |
michael@0 | 386 | Push $0 |
michael@0 | 387 | Push `${_PATH}` |
michael@0 | 388 | Push `${_OPTIONS}` |
michael@0 | 389 | GetFunctionAddress $0 `${_FUNC}` |
michael@0 | 390 | Push `$0` |
michael@0 | 391 | Call un.LocateNoDetails |
michael@0 | 392 | Pop $0 |
michael@0 | 393 | !verbose pop |
michael@0 | 394 | !macroend |
michael@0 | 395 | |
michael@0 | 396 | !macro un.LocateNoDetails |
michael@0 | 397 | !ifndef un.LocateNoDetails |
michael@0 | 398 | !verbose push |
michael@0 | 399 | !verbose ${_OVERRIDE_VERBOSE} |
michael@0 | 400 | !undef _OVERRIDE_UN |
michael@0 | 401 | !define _OVERRIDE_UN `un.` |
michael@0 | 402 | |
michael@0 | 403 | !insertmacro LocateNoDetails |
michael@0 | 404 | |
michael@0 | 405 | !undef _OVERRIDE_UN |
michael@0 | 406 | !define _OVERRIDE_UN |
michael@0 | 407 | !verbose pop |
michael@0 | 408 | !endif |
michael@0 | 409 | !macroend |
michael@0 | 410 | |
michael@0 | 411 | ; Modified version of TextCompare from the NSIS Text Functions Header v2.4 (it |
michael@0 | 412 | ; has the same version in earlier versions of NSIS even though it has changed) |
michael@0 | 413 | ; that is distributed with NSIS v2.46-Unicode. This version has the calls to |
michael@0 | 414 | ; SetDetailsPrint commented out. |
michael@0 | 415 | ; See <NSIS v2.46-Unicode App Dir>/include/TextFunc.nsh for more information. |
michael@0 | 416 | !macro TextCompareNoDetailsCall _FILE1 _FILE2 _OPTION _FUNC |
michael@0 | 417 | !verbose push |
michael@0 | 418 | !verbose ${_OVERRIDE_VERBOSE} |
michael@0 | 419 | Push $0 |
michael@0 | 420 | Push `${_FILE1}` |
michael@0 | 421 | Push `${_FILE2}` |
michael@0 | 422 | Push `${_OPTION}` |
michael@0 | 423 | GetFunctionAddress $0 `${_FUNC}` |
michael@0 | 424 | Push `$0` |
michael@0 | 425 | ${CallArtificialFunction} TextCompareNoDetails_ |
michael@0 | 426 | Pop $0 |
michael@0 | 427 | !verbose pop |
michael@0 | 428 | !macroend |
michael@0 | 429 | |
michael@0 | 430 | !macro TextCompareNoDetailsSCall _FILE1 _FILE2 _OPTION _FUNC |
michael@0 | 431 | !verbose push |
michael@0 | 432 | !verbose ${_OVERRIDE_VERBOSE} |
michael@0 | 433 | Push $0 |
michael@0 | 434 | Push `${_FILE1}` |
michael@0 | 435 | Push `${_FILE2}` |
michael@0 | 436 | Push `${_OPTION}` |
michael@0 | 437 | GetFunctionAddress $0 `${_FUNC}` |
michael@0 | 438 | Push `$0` |
michael@0 | 439 | ${CallArtificialFunction} TextCompareNoDetailsS_ |
michael@0 | 440 | Pop $0 |
michael@0 | 441 | !verbose pop |
michael@0 | 442 | !macroend |
michael@0 | 443 | |
michael@0 | 444 | |
michael@0 | 445 | !macro TextCompareNoDetailsBody _OVERRIDE_S |
michael@0 | 446 | Exch $3 |
michael@0 | 447 | Exch |
michael@0 | 448 | Exch $2 |
michael@0 | 449 | Exch |
michael@0 | 450 | Exch 2 |
michael@0 | 451 | Exch $1 |
michael@0 | 452 | Exch 2 |
michael@0 | 453 | Exch 3 |
michael@0 | 454 | Exch $0 |
michael@0 | 455 | Exch 3 |
michael@0 | 456 | Push $4 |
michael@0 | 457 | Push $5 |
michael@0 | 458 | Push $6 |
michael@0 | 459 | Push $7 |
michael@0 | 460 | Push $8 |
michael@0 | 461 | Push $9 |
michael@0 | 462 | ClearErrors |
michael@0 | 463 | |
michael@0 | 464 | IfFileExists $0 0 TextFunc_TextCompareNoDetails${_OVERRIDE_S}_error |
michael@0 | 465 | IfFileExists $1 0 TextFunc_TextCompareNoDetails${_OVERRIDE_S}_error |
michael@0 | 466 | StrCmp $2 'FastDiff' +5 |
michael@0 | 467 | StrCmp $2 'FastEqual' +4 |
michael@0 | 468 | StrCmp $2 'SlowDiff' +3 |
michael@0 | 469 | StrCmp $2 'SlowEqual' +2 |
michael@0 | 470 | goto TextFunc_TextCompareNoDetails${_OVERRIDE_S}_error |
michael@0 | 471 | |
michael@0 | 472 | FileOpen $4 $0 r |
michael@0 | 473 | IfErrors TextFunc_TextCompareNoDetails${_OVERRIDE_S}_error |
michael@0 | 474 | FileOpen $5 $1 r |
michael@0 | 475 | IfErrors TextFunc_TextCompareNoDetails${_OVERRIDE_S}_error |
michael@0 | 476 | ; SetDetailsPrint textonly |
michael@0 | 477 | |
michael@0 | 478 | StrCpy $6 0 |
michael@0 | 479 | StrCpy $8 0 |
michael@0 | 480 | |
michael@0 | 481 | TextFunc_TextCompareNoDetails${_OVERRIDE_S}_nextline: |
michael@0 | 482 | StrCmp${_OVERRIDE_S} $4 '' TextFunc_TextCompareNoDetails${_OVERRIDE_S}_fast |
michael@0 | 483 | IntOp $8 $8 + 1 |
michael@0 | 484 | FileRead $4 $9 |
michael@0 | 485 | IfErrors 0 +4 |
michael@0 | 486 | FileClose $4 |
michael@0 | 487 | StrCpy $4 '' |
michael@0 | 488 | StrCmp${_OVERRIDE_S} $5 '' TextFunc_TextCompareNoDetails${_OVERRIDE_S}_end |
michael@0 | 489 | StrCmp $2 'FastDiff' TextFunc_TextCompareNoDetails${_OVERRIDE_S}_fast |
michael@0 | 490 | StrCmp $2 'FastEqual' TextFunc_TextCompareNoDetails${_OVERRIDE_S}_fast TextFunc_TextCompareNoDetails${_OVERRIDE_S}_slow |
michael@0 | 491 | |
michael@0 | 492 | TextFunc_TextCompareNoDetails${_OVERRIDE_S}_fast: |
michael@0 | 493 | StrCmp${_OVERRIDE_S} $5 '' TextFunc_TextCompareNoDetails${_OVERRIDE_S}_call |
michael@0 | 494 | IntOp $6 $6 + 1 |
michael@0 | 495 | FileRead $5 $7 |
michael@0 | 496 | IfErrors 0 +5 |
michael@0 | 497 | FileClose $5 |
michael@0 | 498 | StrCpy $5 '' |
michael@0 | 499 | StrCmp${_OVERRIDE_S} $4 '' TextFunc_TextCompareNoDetails${_OVERRIDE_S}_end |
michael@0 | 500 | StrCmp $2 'FastDiff' TextFunc_TextCompareNoDetails${_OVERRIDE_S}_call TextFunc_TextCompareNoDetails${_OVERRIDE_S}_close |
michael@0 | 501 | StrCmp $2 'FastDiff' 0 +2 |
michael@0 | 502 | StrCmp${_OVERRIDE_S} $7 $9 TextFunc_TextCompareNoDetails${_OVERRIDE_S}_nextline TextFunc_TextCompareNoDetails${_OVERRIDE_S}_call |
michael@0 | 503 | StrCmp${_OVERRIDE_S} $7 $9 TextFunc_TextCompareNoDetails${_OVERRIDE_S}_call TextFunc_TextCompareNoDetails${_OVERRIDE_S}_nextline |
michael@0 | 504 | |
michael@0 | 505 | TextFunc_TextCompareNoDetails${_OVERRIDE_S}_slow: |
michael@0 | 506 | StrCmp${_OVERRIDE_S} $4 '' TextFunc_TextCompareNoDetails${_OVERRIDE_S}_close |
michael@0 | 507 | StrCpy $6 '' |
michael@0 | 508 | ; DetailPrint '$8. $9' |
michael@0 | 509 | FileSeek $5 0 |
michael@0 | 510 | |
michael@0 | 511 | TextFunc_TextCompareNoDetails${_OVERRIDE_S}_slownext: |
michael@0 | 512 | FileRead $5 $7 |
michael@0 | 513 | IfErrors 0 +2 |
michael@0 | 514 | StrCmp $2 'SlowDiff' TextFunc_TextCompareNoDetails${_OVERRIDE_S}_call TextFunc_TextCompareNoDetails${_OVERRIDE_S}_nextline |
michael@0 | 515 | StrCmp $2 'SlowDiff' 0 +2 |
michael@0 | 516 | StrCmp${_OVERRIDE_S} $7 $9 TextFunc_TextCompareNoDetails${_OVERRIDE_S}_nextline TextFunc_TextCompareNoDetails${_OVERRIDE_S}_slownext |
michael@0 | 517 | IntOp $6 $6 + 1 |
michael@0 | 518 | StrCmp${_OVERRIDE_S} $7 $9 0 TextFunc_TextCompareNoDetails${_OVERRIDE_S}_slownext |
michael@0 | 519 | |
michael@0 | 520 | TextFunc_TextCompareNoDetails${_OVERRIDE_S}_call: |
michael@0 | 521 | Push $2 |
michael@0 | 522 | Push $3 |
michael@0 | 523 | Push $4 |
michael@0 | 524 | Push $5 |
michael@0 | 525 | Push $6 |
michael@0 | 526 | Push $7 |
michael@0 | 527 | Push $8 |
michael@0 | 528 | Push $9 |
michael@0 | 529 | Call $3 |
michael@0 | 530 | Pop $0 |
michael@0 | 531 | Pop $9 |
michael@0 | 532 | Pop $8 |
michael@0 | 533 | Pop $7 |
michael@0 | 534 | Pop $6 |
michael@0 | 535 | Pop $5 |
michael@0 | 536 | Pop $4 |
michael@0 | 537 | Pop $3 |
michael@0 | 538 | Pop $2 |
michael@0 | 539 | StrCmp $0 'StopTextCompareNoDetails' 0 TextFunc_TextCompareNoDetails${_OVERRIDE_S}_nextline |
michael@0 | 540 | |
michael@0 | 541 | TextFunc_TextCompareNoDetails${_OVERRIDE_S}_close: |
michael@0 | 542 | FileClose $4 |
michael@0 | 543 | FileClose $5 |
michael@0 | 544 | goto TextFunc_TextCompareNoDetails${_OVERRIDE_S}_end |
michael@0 | 545 | |
michael@0 | 546 | TextFunc_TextCompareNoDetails${_OVERRIDE_S}_error: |
michael@0 | 547 | SetErrors |
michael@0 | 548 | |
michael@0 | 549 | TextFunc_TextCompareNoDetails${_OVERRIDE_S}_end: |
michael@0 | 550 | ; SetDetailsPrint both |
michael@0 | 551 | Pop $9 |
michael@0 | 552 | Pop $8 |
michael@0 | 553 | Pop $7 |
michael@0 | 554 | Pop $6 |
michael@0 | 555 | Pop $5 |
michael@0 | 556 | Pop $4 |
michael@0 | 557 | Pop $3 |
michael@0 | 558 | Pop $2 |
michael@0 | 559 | Pop $1 |
michael@0 | 560 | Pop $0 |
michael@0 | 561 | !macroend |
michael@0 | 562 | |
michael@0 | 563 | !define TextCompareNoDetails `!insertmacro TextCompareNoDetailsCall` |
michael@0 | 564 | !define un.TextCompareNoDetails `!insertmacro TextCompareNoDetailsCall` |
michael@0 | 565 | |
michael@0 | 566 | !macro TextCompareNoDetails |
michael@0 | 567 | !macroend |
michael@0 | 568 | |
michael@0 | 569 | !macro un.TextCompareNoDetails |
michael@0 | 570 | !macroend |
michael@0 | 571 | |
michael@0 | 572 | !macro TextCompareNoDetails_ |
michael@0 | 573 | !verbose push |
michael@0 | 574 | !verbose ${_OVERRIDE_VERBOSE} |
michael@0 | 575 | |
michael@0 | 576 | !insertmacro TextCompareNoDetailsBody '' |
michael@0 | 577 | |
michael@0 | 578 | !verbose pop |
michael@0 | 579 | !macroend |
michael@0 | 580 | |
michael@0 | 581 | !define TextCompareNoDetailsS `!insertmacro TextCompareNoDetailsSCall` |
michael@0 | 582 | !define un.TextCompareNoDetailsS `!insertmacro TextCompareNoDetailsSCall` |
michael@0 | 583 | |
michael@0 | 584 | !macro TextCompareNoDetailsS |
michael@0 | 585 | !macroend |
michael@0 | 586 | |
michael@0 | 587 | !macro un.TextCompareNoDetailsS |
michael@0 | 588 | !macroend |
michael@0 | 589 | |
michael@0 | 590 | !macro TextCompareNoDetailsS_ |
michael@0 | 591 | !verbose push |
michael@0 | 592 | !verbose ${_OVERRIDE_VERBOSE} |
michael@0 | 593 | |
michael@0 | 594 | !insertmacro TextCompareNoDetailsBody 'S' |
michael@0 | 595 | |
michael@0 | 596 | !verbose pop |
michael@0 | 597 | !macroend |
michael@0 | 598 | |
michael@0 | 599 | !endif |