comparison mupdf-source/thirdparty/tesseract/nsis/tesseract.nsi @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 ; (C) Copyright 2010, Sergey Bronnikov
2 ; (C) Copyright 2010-2012, Zdenko Podobný
3 ; (C) Copyright 2015-2024 Stefan Weil
4 ;
5 ; Licensed under the Apache License, Version 2.0 (the "License");
6 ; you may not use this file except in compliance with the License.
7 ; You may obtain a copy of the License at
8 ; http://www.apache.org/licenses/LICENSE-2.0
9 ; Unless required by applicable law or agreed to in writing, software
10 ; distributed under the License is distributed on an "AS IS" BASIS,
11 ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 ; See the License for the specific language governing permissions and
13 ; limitations under the License.
14
15 ; Links to NSIS documentation:
16 ; https://nsis.sourceforge.io/Docs/Modern%20UI%202/Readme.html
17
18 ; TODO:
19 ; * Fix PreventMultipleInstances.
20 ; * Add Tesseract icon and images for installer.
21
22 SetCompressor /FINAL /SOLID lzma
23 SetCompressorDictSize 32
24
25 Unicode true
26
27 ; Settings which normally should be passed as command line arguments.
28 ;define CROSSBUILD
29 ;define SHARED
30 ;define W64
31 !ifndef COMMENTS
32 !define COMMENTS "GitHub CI build"
33 !endif
34 !ifndef COMPANYNAME
35 !define COMPANYNAME "Open Source Community"
36 !endif
37 !ifndef SRCDIR
38 !define SRCDIR .
39 !endif
40 !ifndef VERSION
41 !define VERSION undefined
42 !endif
43
44 !define PRODUCT_NAME "Tesseract-OCR"
45 !define PRODUCT_VERSION "${VERSION}"
46 !define PRODUCT_PUBLISHER "Tesseract-OCR community"
47 !ifndef PRODUCT_WEB_SITE
48 !define PRODUCT_WEB_SITE "https://github.com/tesseract-ocr/tesseract"
49 !endif
50 !define GITHUB_RAW_FILE_URL \
51 "https://raw.githubusercontent.com/tesseract-ocr/tessdata_fast/main"
52
53 !ifdef CROSSBUILD
54 !addincludedir ${SRCDIR}\nsis\include
55 !addplugindir Plugins/x86-unicode
56 !endif
57
58 !ifdef W64
59 !define ARCH "x86_64"
60 !define SETUP "tesseract-ocr-w64-setup"
61 !else
62 !define ARCH "i686"
63 !define SETUP "tesseract-ocr-w32-setup"
64 !endif
65
66 # Name of program and file
67 !define OUTFILE "${SETUP}-${VERSION}.exe"
68 OutFile ${OUTFILE}
69
70 !ifdef SIGNCODE
71 !finalize "${SIGNCODE} %1"
72 !uninstfinalize "${SIGNCODE} %1"
73 !endif
74
75 !ifndef PREFIX
76 !define PREFIX "../mingw64"
77 !endif
78 !define BINDIR "${PREFIX}/bin"
79
80 # General Definitions
81 Name "${PRODUCT_NAME}"
82 Caption "${PRODUCT_NAME} ${VERSION}"
83 !ifndef CROSSBUILD
84 BrandingText /TRIMCENTER "(c) 2010-2019 ${PRODUCT_NAME}"
85 !endif
86
87 ; File properties.
88 !define /date DATEVERSION "%Y%m%d%H%M%S"
89 VIProductVersion "${VERSION}"
90 VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
91 VIAddVersionKey "Comments" "${COMMENTS}"
92 VIAddVersionKey "CompanyName" "${COMPANYNAME}"
93 VIAddVersionKey "FileDescription" "Tesseract OCR"
94 !define /date DATETIME "%Y-%m-%d-%H-%M-%S"
95 VIAddVersionKey "FileVersion" "${DATETIME}"
96 VIAddVersionKey "InternalName" "Tesseract"
97 VIAddVersionKey "LegalCopyright" "Apache-2.0"
98 #VIAddVersionKey "LegalTrademarks" ""
99 VIAddVersionKey "OriginalFilename" "${OUTFILE}"
100 VIAddVersionKey "ProductVersion" "${VERSION}"
101
102 !define REGKEY "SOFTWARE\${PRODUCT_NAME}"
103 ; HKLM (all users) vs HKCU (current user) defines
104 !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
105 !define env_hkcu 'HKCU "Environment"'
106
107 # MultiUser Symbol Definitions
108 # https://nsis.sourceforge.io/Docs/MultiUser/Readme.html
109 !define MULTIUSER_EXECUTIONLEVEL Highest
110 !define MULTIUSER_MUI
111 !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${REGKEY}"
112 !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME MultiUserInstallMode
113 !define MULTIUSER_INSTALLMODE_COMMANDLINE
114 !define MULTIUSER_INSTALLMODE_INSTDIR ${PRODUCT_NAME}
115 !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${REGKEY}"
116 !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path"
117 !ifdef W64
118 !define MULTIUSER_USE_PROGRAMFILES64
119 !endif
120
121 # MUI Symbol Definitions
122 !define MUI_ABORTWARNING
123 !define MUI_COMPONENTSPAGE_SMALLDESC
124 !define MUI_HEADERIMAGE
125 !define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
126 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-blue-full.ico"
127 !define MUI_FINISHPAGE_LINK "View Tesseract on GitHub"
128 !define MUI_FINISHPAGE_LINK_LOCATION "https://github.com/tesseract-ocr/tesseract"
129 !define MUI_FINISHPAGE_NOAUTOCLOSE
130 !ifdef SHOW_README
131 ; Showing the README does not work.
132 !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\README.md"
133 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadme
134 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show README"
135 !endif
136 !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
137 !define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
138 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
139 !define MUI_STARTMENUPAGE_DEFAULTFOLDER ${PRODUCT_NAME}
140 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
141 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
142 !define MUI_WELCOMEPAGE_TITLE_3LINES
143
144 # Included files
145 !include MultiUser.nsh
146 !include Sections.nsh
147 !include MUI2.nsh
148 !include LogicLib.nsh
149 !include winmessages.nsh # include for some of the windows messages defines
150
151 # Variables
152 Var StartMenuGroup
153 ; Define user variables
154 Var OLD_KEY
155
156 # Installer pages
157 !insertmacro MUI_PAGE_WELCOME
158 !insertmacro MUI_PAGE_LICENSE "${SRCDIR}\LICENSE"
159 !insertmacro MULTIUSER_PAGE_INSTALLMODE
160 Page custom PageReinstall PageLeaveReinstall
161 !insertmacro MUI_PAGE_COMPONENTS
162 !insertmacro MUI_PAGE_DIRECTORY
163 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
164 !insertmacro MUI_PAGE_INSTFILES
165 !insertmacro MUI_PAGE_FINISH
166 !insertmacro MUI_UNPAGE_CONFIRM
167 !insertmacro MUI_UNPAGE_INSTFILES
168
169 # Languages
170 !insertmacro MUI_LANGUAGE "English"
171 !insertmacro MUI_LANGUAGE "French"
172 !insertmacro MUI_LANGUAGE "German"
173 !insertmacro MUI_LANGUAGE "Italian"
174 !insertmacro MUI_LANGUAGE "Russian"
175 !insertmacro MUI_LANGUAGE "Slovak"
176 !insertmacro MUI_LANGUAGE "Spanish"
177 !insertmacro MUI_LANGUAGE "SpanishInternational"
178
179 # Installer attributes
180 ShowInstDetails hide
181 InstProgressFlags smooth colored
182 XPStyle on
183 SpaceTexts
184 CRCCheck on
185 InstProgressFlags smooth colored
186 CRCCheck On # Do a CRC check before installing
187
188 !macro Download_Lang_Data Lang
189 ; Download traineddata file.
190 DetailPrint "Download: ${Lang} language file"
191 inetc::get /caption "Downloading ${Lang} language file" \
192 "${GITHUB_RAW_FILE_URL}/${Lang}.traineddata" $INSTDIR/tessdata/${Lang}.traineddata \
193 /END
194 Pop $0 # return value = exit code, "OK" if OK
195 StrCmp $0 "OK" +2
196 MessageBox MB_OK|MB_ICONEXCLAMATION \
197 "Download error. Status of ${Lang}: $0. Click OK to continue." /SD IDOK
198 !macroend
199
200 Section -Main SEC0000
201 ; mark as read only component
202 SectionIn RO
203 SetOutPath "$INSTDIR"
204 # files included in distribution
205 File ${BINDIR}/tesseract.exe
206 File ${BINDIR}/libtesseract-*.dll
207 !ifdef CROSSBUILD
208 File ../dll/*.dll
209 !endif
210 File winpath.exe
211 File ../doc/*.html
212 CreateDirectory "$INSTDIR\tessdata"
213 SetOutPath "$INSTDIR\tessdata"
214 File ${PREFIX}/share/tessdata/pdf.ttf
215 CreateDirectory "$INSTDIR\tessdata\configs"
216 SetOutPath "$INSTDIR\tessdata\configs"
217 File ${PREFIX}/share/tessdata/configs/*
218 CreateDirectory "$INSTDIR\tessdata\script"
219 CreateDirectory "$INSTDIR\tessdata\tessconfigs"
220 SetOutPath "$INSTDIR\tessdata\tessconfigs"
221 File ${PREFIX}/share/tessdata/tessconfigs/*
222 CreateDirectory "$INSTDIR\doc"
223 SetOutPath "$INSTDIR\doc"
224 File ${SRCDIR}\AUTHORS
225 File ${SRCDIR}\LICENSE
226 File ${SRCDIR}\README.md
227 ## File ${SRCDIR}\ReleaseNotes
228 SectionEnd
229
230 Section "ScrollView" SecScrollView
231 SectionIn 1
232 SetOutPath "$INSTDIR\tessdata"
233 File ${PREFIX}/share/tessdata/*.jar
234 SectionEnd
235
236 Section "Training Tools" SecTr
237 SectionIn 1
238 SetOutPath "$INSTDIR"
239 File /x tesseract.exe ${BINDIR}/*.exe
240 SectionEnd
241
242 !define UNINST_EXE "$INSTDIR\tesseract-uninstall.exe"
243 !define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
244
245 Section -post SEC0001
246 !ifdef W64
247 SetRegView 64
248 !endif
249 ;Store installation folder - we always use HKLM!
250 WriteRegStr HKLM "${REGKEY}" "Path" "$INSTDIR"
251 WriteRegStr HKLM "${REGKEY}" "Mode" $MultiUser.InstallMode
252 WriteRegStr HKLM "${REGKEY}" "InstallDir" "$INSTDIR"
253 WriteRegStr HKLM "${REGKEY}" "CurrentVersion" "${VERSION}"
254 WriteRegStr HKLM "${REGKEY}" "Uninstaller" "${UNINST_EXE}"
255 ;WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\tesseract.exe" "$INSTDIR\tesseract.exe"
256 ;WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "Tesseract-OCR" "$INSTDIR\tesseract.exe"
257 ; Register to Add/Remove program in control panel
258 WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} - open source OCR engine"
259 WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${VERSION}"
260 WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
261 WriteRegStr HKLM "${UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
262 WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "${UNINST_EXE}"
263 WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "${UNINST_EXE}"
264 WriteRegStr HKLM "${UNINST_KEY}" "QuietUninstallString" '"${UNINST_EXE}" /S'
265 WriteRegDWORD HKLM "${UNINST_KEY}" "NoModify" 1
266 WriteRegDWORD HKLM "${UNINST_KEY}" "NoRepair" 1
267 ;Create uninstaller
268 WriteUninstaller "${UNINST_EXE}"
269 ;ExecShell "open" "https://github.com/tesseract-ocr/tesseract"
270 ;ExecShell "open" '"$INSTDIR"'
271 ;BringToFront
272 SectionEnd
273
274 Section "Shortcuts creation" SecCS
275 SetOutPath $INSTDIR
276 CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
277 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Console.lnk" "$INSTDIR\winpath.exe" "cmd"
278 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Dokumentation.lnk" "$INSTDIR\tesseract.1.html"
279 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Homepage.lnk" "${PRODUCT_WEB_SITE}"
280 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\ReadMe.lnk" "${PRODUCT_WEB_SITE}/wiki/ReadMe"
281 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\FAQ.lnk" "${PRODUCT_WEB_SITE}/wiki/FAQ"
282 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "${UNINST_EXE}" "" "${UNINST_EXE}" 0
283 ;CreateShortCut "$DESKTOP\Tesseract-OCR.lnk" "$INSTDIR\tesseract.exe" "" "$INSTDIR\tesseract.exe" 0
284 ;CreateShortCut "$QUICKLAUNCH\.lnk" "$INSTDIR\tesseract.exe" "" "$INSTDIR\tesseract.exe" 0
285 SectionEnd
286
287 ; Language files
288 SectionGroup "Language data" SecGrp_LD
289 Section "English" SecLang_eng
290 SectionIn RO
291 !insertmacro Download_Lang_Data eng
292 SectionEnd
293
294 Section "Orientation and script detection" SecLang_osd
295 SectionIn 1
296 !insertmacro Download_Lang_Data osd
297 SectionEnd
298 SectionGroupEnd
299
300 ; Download script files
301 SectionGroup "Additional script data (download)" SecGrp_ASD
302 Section /o "Arabic script" SecLang_Arabic
303 AddSize 8880
304 !insertmacro Download_Lang_Data script/Arabic
305 SectionEnd
306
307 Section /o "Armenian script" SecLang_Armenian
308 AddSize 7510
309 !insertmacro Download_Lang_Data script/Armenian
310 SectionEnd
311
312 Section /o "Bengali script" SecLang_Bengali
313 AddSize 5450
314 !insertmacro Download_Lang_Data script/Bengali
315 SectionEnd
316
317 Section /o "Canadian Aboriginal script" SecLang_Canadian_Aboriginal
318 AddSize 6850
319 !insertmacro Download_Lang_Data script/Canadian_Aboriginal
320 SectionEnd
321
322 Section /o "Cherokee script" SecLang_Cherokee
323 AddSize 4040
324 !insertmacro Download_Lang_Data script/Cherokee
325 SectionEnd
326
327 Section /o "Cyrillic script" SecLang_Cyrillic
328 AddSize 27900
329 !insertmacro Download_Lang_Data script/Cyrillic
330 SectionEnd
331
332 Section /o "Devanagari script" SecLang_Devanagari
333 AddSize 17100
334 !insertmacro Download_Lang_Data script/Devanagari
335 SectionEnd
336
337 Section /o "Ethiopic script" SecLang_Ethiopic
338 AddSize 8650
339 !insertmacro Download_Lang_Data script/Ethiopic
340 SectionEnd
341
342 Section /o "Fraktur script" SecLang_Fraktur
343 AddSize 10400
344 !insertmacro Download_Lang_Data script/Fraktur
345 SectionEnd
346
347 Section /o "Georgian script" SecLang_Georgian
348 AddSize 6630
349 !insertmacro Download_Lang_Data script/Georgian
350 SectionEnd
351
352 Section /o "Greek script" SecLang_Greek
353 AddSize 2900
354 !insertmacro Download_Lang_Data script/Greek
355 SectionEnd
356
357 Section /o "Gujarati script" SecLang_Gujarati
358 AddSize 4780
359 !insertmacro Download_Lang_Data script/Gujarati
360 SectionEnd
361
362 Section /o "Gurmukhi script" SecLang_Gurmukhi
363 AddSize 4020
364 !insertmacro Download_Lang_Data script/Gurmukhi
365 SectionEnd
366
367 Section /o "Han Simplified script" SecLang_HanS
368 AddSize 5700
369 !insertmacro Download_Lang_Data script/HanS
370 SectionEnd
371
372 Section /o "Han Simplified vertical script" SecLang_HanS_vert
373 AddSize 5304
374 !insertmacro Download_Lang_Data script/HanS_vert
375 SectionEnd
376
377 Section /o "Han Traditional script" SecLang_HanT
378 AddSize 5200
379 !insertmacro Download_Lang_Data script/HanT
380 SectionEnd
381
382 Section /o "Han Traditional vertical script" SecLang_HanT_vert
383 AddSize 5200
384 !insertmacro Download_Lang_Data script/HanT_vert
385 SectionEnd
386
387 Section /o "Hangul script" SecLang_Hangul
388 AddSize 4620
389 !insertmacro Download_Lang_Data script/Hangul
390 SectionEnd
391
392 Section /o "Hangul vertical script" SecLang_Hangul_vert
393 AddSize 4510
394 !insertmacro Download_Lang_Data script/Hangul_vert
395 SectionEnd
396
397 Section /o "Hebrew script" SecLang_Hebrew
398 AddSize 4640
399 !insertmacro Download_Lang_Data script/Hebrew
400 SectionEnd
401
402 Section /o "Japanese script" SecLang_Japanese
403 AddSize 5610
404 !insertmacro Download_Lang_Data script/Japanese
405 SectionEnd
406
407 Section /o "Japanese vertical script" SecLang_Japanese_vert
408 AddSize 6150
409 !insertmacro Download_Lang_Data script/Japanese_vert
410 SectionEnd
411
412 Section /o "Kannada script" SecLang_Kannada
413 AddSize 6460
414 !insertmacro Download_Lang_Data script/Kannada
415 SectionEnd
416
417 Section /o "Khmer script" SecLang_Khmer
418 AddSize 4270
419 !insertmacro Download_Lang_Data script/Khmer
420 SectionEnd
421
422 Section /o "Lao script" SecLang_Script_Lao
423 AddSize 9640
424 !insertmacro Download_Lang_Data script/Lao
425 SectionEnd
426
427 Section /o "Latin script" SecLang_Latin
428 AddSize 85200
429 !insertmacro Download_Lang_Data script/Latin
430 SectionEnd
431
432 Section /o "Malayalam script" SecLang_Malayalam
433 AddSize 8590
434 !insertmacro Download_Lang_Data script/Malayalam
435 SectionEnd
436
437 Section /o "Myanmar script" SecLang_Myanmar
438 AddSize 7480
439 !insertmacro Download_Lang_Data script/Myanmar
440 SectionEnd
441
442 Section /o "Oriya script" SecLang_Oriya
443 AddSize 5480
444 !insertmacro Download_Lang_Data script/Oriya
445 SectionEnd
446
447 Section /o "Sinhala script" SecLang_Sinhala
448 AddSize 4560
449 !insertmacro Download_Lang_Data script/Sinhala
450 SectionEnd
451
452 Section /o "Syriac script" SecLang_Syriac
453 AddSize 5530
454 !insertmacro Download_Lang_Data script/Syriac
455 SectionEnd
456
457 Section /o "Tamil script" SecLang_Tamil
458 AddSize 6760
459 !insertmacro Download_Lang_Data script/Tamil
460 SectionEnd
461
462 Section /o "Telugu script" SecLang_Telugu
463 AddSize 6180
464 !insertmacro Download_Lang_Data script/Telugu
465 SectionEnd
466
467 Section /o "Thaana script" SecLang_Thaana
468 AddSize 5770
469 !insertmacro Download_Lang_Data script/Thaana
470 SectionEnd
471
472 Section /o "Thai script" SecLang_Thai
473 AddSize 4050
474 !insertmacro Download_Lang_Data script/Thai
475 SectionEnd
476
477 Section /o "Tibetan script" SecLang_Tibetan
478 AddSize 5440
479 !insertmacro Download_Lang_Data script/Tibetan
480 SectionEnd
481
482 Section /o "Vietnamese script" SecLang_Vietnamese
483 AddSize 1590
484 !insertmacro Download_Lang_Data script/Vietnamese
485 SectionEnd
486
487 SectionGroupEnd
488
489 ; Download language files
490 SectionGroup "Additional language data (download)" SecGrp_ALD
491 Section /o "Math / equation detection module" SecLang_equ
492 AddSize 2200
493 !insertmacro Download_Lang_Data equ
494 SectionEnd
495
496 ; The language names are documented here:
497 ; https://github.com/tesseract-ocr/tesseract/blob/main/doc/tesseract.1.asc#languages
498
499 Section /o "Afrikaans" SecLang_afr
500 AddSize 2530
501 !insertmacro Download_Lang_Data afr
502 SectionEnd
503
504 Section /o "Amharic" SecLang_amh
505 AddSize 5220
506 !insertmacro Download_Lang_Data amh
507 SectionEnd
508
509 Section /o "Arabic" SecLang_ara
510 AddSize 1370
511 !insertmacro Download_Lang_Data ara
512 SectionEnd
513
514 Section /o "Assamese" SecLang_asm
515 AddSize 1950
516 !insertmacro Download_Lang_Data asm
517 SectionEnd
518
519 Section /o "Azerbaijani" SecLang_aze
520 AddSize 3360
521 !insertmacro Download_Lang_Data aze
522 SectionEnd
523
524 Section /o "Azerbaijani (Cyrillic)" SecLang_aze_cyrl
525 AddSize 1850
526 !insertmacro Download_Lang_Data aze_cyrl
527 SectionEnd
528
529 Section /o "Belarusian" SecLang_bel
530 AddSize 3520
531 !insertmacro Download_Lang_Data bel
532 SectionEnd
533
534 Section /o "Bengali" SecLang_ben
535 AddSize 836
536 !insertmacro Download_Lang_Data ben
537 SectionEnd
538
539 Section /o "Tibetan" SecLang_bod
540 AddSize 1880
541 !insertmacro Download_Lang_Data bod
542 SectionEnd
543
544 Section /o "Bosnian" SecLang_bos
545 AddSize 2380
546 !insertmacro Download_Lang_Data bos
547 SectionEnd
548
549 Section /o "Breton" SecLang_bre
550 AddSize 6188
551 !insertmacro Download_Lang_Data bre
552 SectionEnd
553
554 Section /o "Bulgarian" SecLang_bul
555 AddSize 1600
556 !insertmacro Download_Lang_Data bul
557 SectionEnd
558
559 Section /o "Catalan" SecLang_cat
560 AddSize 1090
561 !insertmacro Download_Lang_Data cat
562 SectionEnd
563
564 Section /o "Cebuano" SecLang_ceb
565 AddSize 699
566 !insertmacro Download_Lang_Data ceb
567 SectionEnd
568
569 Section /o "Czech" SecLang_ces
570 AddSize 3620
571 !insertmacro Download_Lang_Data ces
572 SectionEnd
573
574 Section /o "Chinese (Simplified)" SecLang_chi_sim
575 AddSize 2350
576 !insertmacro Download_Lang_Data chi_sim
577 SectionEnd
578
579 Section /o "Chinese (Simplified vertical)" SecLang_chi_sim_vert
580 AddSize 1840
581 !insertmacro Download_Lang_Data chi_sim_vert
582 SectionEnd
583
584 Section /o "Chinese (Traditional)" SecLang_chi_tra
585 AddSize 2260
586 !insertmacro Download_Lang_Data chi_tra
587 SectionEnd
588
589 Section /o "Chinese (Traditional vertical)" SecLang_chi_tra_vert
590 AddSize 1740
591 !insertmacro Download_Lang_Data chi_tra_vert
592 SectionEnd
593
594 Section /o "Cherokee" SecLang_chr
595 AddSize 366
596 !insertmacro Download_Lang_Data chr
597 SectionEnd
598
599 Section /o "Corsican" SecLang_cos
600 AddSize 2190
601 !insertmacro Download_Lang_Data cos
602 SectionEnd
603
604 Section /o "Welsh" SecLang_cym
605 AddSize 2110
606 !insertmacro Download_Lang_Data cym
607 SectionEnd
608
609 Section /o "Danish" SecLang_dan
610 AddSize 2460
611 !insertmacro Download_Lang_Data dan
612 SectionEnd
613
614 Section /o "German" SecLang_deu
615 AddSize 1450
616 !insertmacro Download_Lang_Data deu
617 SectionEnd
618
619 Section /o "German Fraktur" SecLang_deu_latf
620 AddSize 6130
621 !insertmacro Download_Lang_Data deu_latf
622 SectionEnd
623
624 Section /o "Divehi" SecLang_div
625 AddSize 1690
626 !insertmacro Download_Lang_Data div
627 SectionEnd
628
629 Section /o "Dzongkha" SecLang_dzo
630 AddSize 439
631 !insertmacro Download_Lang_Data dzo
632 SectionEnd
633
634 Section /o "Greek" SecLang_ell
635 AddSize 1350
636 !insertmacro Download_Lang_Data ell
637 SectionEnd
638
639 Section /o "English - Middle (1100-1500)" SecLang_enm
640 AddSize 2960
641 !insertmacro Download_Lang_Data enm
642 SectionEnd
643
644 Section /o "Esperanto" SecLang_epo
645 AddSize 4510
646 !insertmacro Download_Lang_Data epo
647 SectionEnd
648
649 Section /o "Estonian" SecLang_est
650 AddSize 4250
651 !insertmacro Download_Lang_Data est
652 SectionEnd
653
654 Section /o "Basque" SecLang_eus
655 AddSize 4940
656 !insertmacro Download_Lang_Data eus
657 SectionEnd
658
659 Section /o "Faroese" SecLang_fao
660 AddSize 3280
661 !insertmacro Download_Lang_Data fao
662 SectionEnd
663
664 Section /o "Persian" SecLang_fas
665 AddSize 421
666 !insertmacro Download_Lang_Data fas
667 SectionEnd
668
669 Section /o "Filipino" SecLang_fil
670 AddSize 1760
671 !insertmacro Download_Lang_Data fil
672 SectionEnd
673
674 Section /o "Finnish" SecLang_fin
675 AddSize 7500
676 !insertmacro Download_Lang_Data fin
677 SectionEnd
678
679 Section /o "French" SecLang_fra
680 AddSize 1080
681 !insertmacro Download_Lang_Data fra
682 SectionEnd
683
684 Section /o "French - Middle (ca. 1400-1600)" SecLang_frm
685 AddSize 1930
686 !insertmacro Download_Lang_Data frm
687 SectionEnd
688
689 Section /o "Frisian (Western)" SecLang_fry
690 AddSize 1820
691 !insertmacro Download_Lang_Data fry
692 SectionEnd
693
694 Section /o "Gaelic (Scots)" SecLang_gla
695 AddSize 2930
696 !insertmacro Download_Lang_Data gla
697 SectionEnd
698
699 Section /o "Irish" SecLang_gle
700 AddSize 1130
701 !insertmacro Download_Lang_Data gle
702 SectionEnd
703
704 Section /o "Galician" SecLang_glg
705 AddSize 2440
706 !insertmacro Download_Lang_Data glg
707 SectionEnd
708
709 Section /o "Greek, Ancient (-1453)" SecLang_grc
710 AddSize 2140
711 !insertmacro Download_Lang_Data grc
712 SectionEnd
713
714 Section /o "Gujarati" SecLang_guj
715 AddSize 1350
716 !insertmacro Download_Lang_Data guj
717 SectionEnd
718
719 Section /o "Haitian" SecLang_hat
720 AddSize 1890
721 !insertmacro Download_Lang_Data hat
722 SectionEnd
723
724 Section /o "Hebrew" SecLang_heb
725 AddSize 939
726 !insertmacro Download_Lang_Data heb
727 SectionEnd
728
729 Section /o "Hindi" SecLang_hin
730 AddSize 1070
731 !insertmacro Download_Lang_Data hin
732 SectionEnd
733
734 Section /o "Croatian" SecLang_hrv
735 AddSize 3910
736 !insertmacro Download_Lang_Data hrv
737 SectionEnd
738
739 Section /o "Hungarian" SecLang_hun
740 AddSize 5050
741 !insertmacro Download_Lang_Data hun
742 SectionEnd
743
744 Section /o "Armenian" SecLang_hye
745 AddSize 3300
746 !insertmacro Download_Lang_Data hye
747 SectionEnd
748
749 Section /o "Inuktitut" SecLang_iku
750 AddSize 2670
751 !insertmacro Download_Lang_Data iku
752 SectionEnd
753
754 Section /o "Indonesian" SecLang_ind
755 AddSize 1070
756 !insertmacro Download_Lang_Data ind
757 SectionEnd
758
759 Section /o "Icelandic" SecLang_isl
760 AddSize 2170
761 !insertmacro Download_Lang_Data isl
762 SectionEnd
763
764 Section /o "Italian" SecLang_ita
765 AddSize 2580
766 !insertmacro Download_Lang_Data ita
767 SectionEnd
768
769 Section /o "Italian (Old)" SecLang_ita_old
770 AddSize 3130
771 !insertmacro Download_Lang_Data ita_old
772 SectionEnd
773
774 Section /o "Javanese" SecLang_jav
775 AddSize 2840
776 !insertmacro Download_Lang_Data jav
777 SectionEnd
778
779 Section /o "Japanese" SecLang_jpn
780 AddSize 2360
781 !insertmacro Download_Lang_Data jpn
782 SectionEnd
783
784 Section /o "Japanese (vertical)" SecLang_jpn_vert
785 AddSize 2900
786 !insertmacro Download_Lang_Data jpn_vert
787 SectionEnd
788
789 Section /o "Kannada" SecLang_kan
790 AddSize 3440
791 !insertmacro Download_Lang_Data kan
792 SectionEnd
793
794 Section /o "Georgian" SecLang_kat
795 AddSize 2410
796 !insertmacro Download_Lang_Data kat
797 SectionEnd
798
799 Section /o "Georgian (Old)" SecLang_kat_old
800 AddSize 413
801 !insertmacro Download_Lang_Data kat_old
802 SectionEnd
803
804 Section /o "Kazakh" SecLang_kaz
805 AddSize 4520
806 !insertmacro Download_Lang_Data kaz
807 SectionEnd
808
809 Section /o "Central Khmer" SecLang_khm
810 AddSize 1380
811 !insertmacro Download_Lang_Data khm
812 SectionEnd
813
814 Section /o "Kirghiz" SecLang_kir
815 AddSize 9470
816 !insertmacro Download_Lang_Data kir
817 SectionEnd
818
819 Section /o "Korean" SecLang_kor
820 AddSize 1600
821 !insertmacro Download_Lang_Data kor
822 SectionEnd
823
824 Section /o "Kurdish (Kurmanji)" SecLang_kmr
825 AddSize 3400
826 !insertmacro Download_Lang_Data kmr
827 SectionEnd
828
829 Section /o "Lao" SecLang_lao
830 AddSize 6090
831 !insertmacro Download_Lang_Data lao
832 SectionEnd
833
834 Section /o "Latin" SecLang_lat
835 AddSize 3040
836 !insertmacro Download_Lang_Data lat
837 SectionEnd
838
839 Section /o "Latvian" SecLang_lav
840 AddSize 2590
841 !insertmacro Download_Lang_Data lav
842 SectionEnd
843
844 Section /o "Lithuanian" SecLang_lit
845 AddSize 3010
846 !insertmacro Download_Lang_Data lit
847 SectionEnd
848
849 Section /o "Luxembourgish" SecLang_ltz
850 AddSize 2490
851 !insertmacro Download_Lang_Data ltz
852 SectionEnd
853
854 Section /o "Malayalam" SecLang_mal
855 AddSize 5030
856 !insertmacro Download_Lang_Data mal
857 SectionEnd
858
859 Section /o "Marathi" SecLang_mar
860 AddSize 2020
861 !insertmacro Download_Lang_Data mar
862 SectionEnd
863
864 Section /o "Macedonian" SecLang_mkd
865 AddSize 1530
866 !insertmacro Download_Lang_Data mkd
867 SectionEnd
868
869 Section /o "Maltese" SecLang_mlt
870 AddSize 2200
871 !insertmacro Download_Lang_Data mlt
872 SectionEnd
873
874 Section /o "Mongolian" SecLang_mon
875 AddSize 2040
876 !insertmacro Download_Lang_Data mon
877 SectionEnd
878
879 Section /o "Maori" SecLang_mri
880 AddSize 843
881 !insertmacro Download_Lang_Data mri
882 SectionEnd
883
884 Section /o "Malay" SecLang_msa
885 AddSize 1670
886 !insertmacro Download_Lang_Data msa
887 SectionEnd
888
889 Section /o "Burmese" SecLang_mya
890 AddSize 4430
891 !insertmacro Download_Lang_Data mya
892 SectionEnd
893
894 Section /o "Nepali" SecLang_nep
895 AddSize 979
896 !insertmacro Download_Lang_Data nep
897 SectionEnd
898
899 Section /o "Dutch; Flemish" SecLang_nld
900 AddSize 5770
901 !insertmacro Download_Lang_Data nld
902 SectionEnd
903
904 Section /o "Norwegian" SecLang_nor
905 AddSize 3440
906 !insertmacro Download_Lang_Data nor
907 SectionEnd
908
909 Section /o "Occitan (post 1500)" SecLang_oci
910 AddSize 6030
911 !insertmacro Download_Lang_Data oci
912 SectionEnd
913
914 Section /o "Oriya" SecLang_ori
915 AddSize 1410
916 !insertmacro Download_Lang_Data ori
917 SectionEnd
918
919 Section /o "Panjabi / Punjabi" SecLang_pan
920 AddSize 4860
921 !insertmacro Download_Lang_Data pan
922 SectionEnd
923
924 Section /o "Polish" SecLang_pol
925 AddSize 4540
926 !insertmacro Download_Lang_Data pol
927 SectionEnd
928
929 Section /o "Portuguese" SecLang_por
930 AddSize 1890
931 !insertmacro Download_Lang_Data por
932 SectionEnd
933
934 Section /o "Pushto / Pashto" SecLang_pus
935 AddSize 1690
936 !insertmacro Download_Lang_Data pus
937 SectionEnd
938
939 Section /o "Quechua" SecLang_que
940 AddSize 4790
941 !insertmacro Download_Lang_Data que
942 SectionEnd
943
944 Section /o "Romanian" SecLang_ron
945 AddSize 2270
946 !insertmacro Download_Lang_Data ron
947 SectionEnd
948
949 Section /o "Russian" SecLang_rus
950 AddSize 3680
951 !insertmacro Download_Lang_Data rus
952 SectionEnd
953
954 Section /o "Sanskrit" SecLang_san
955 AddSize 1180
956 !insertmacro Download_Lang_Data san
957 SectionEnd
958
959 Section /o "Sinhala / Sinhalese" SecLang_sin
960 AddSize 1650
961 !insertmacro Download_Lang_Data sin
962 SectionEnd
963
964 Section /o "Slovak" SecLang_slk
965 AddSize 4220
966 !insertmacro Download_Lang_Data slk
967 SectionEnd
968
969 Section /o "Slovenian" SecLang_slv
970 AddSize 2860
971 !insertmacro Download_Lang_Data slv
972 SectionEnd
973
974 Section /o "Sindhi" SecLang_snd
975 AddSize 1620
976 !insertmacro Download_Lang_Data snd
977 SectionEnd
978
979 Section /o "Spanish" SecLang_spa
980 AddSize 2190
981 !insertmacro Download_Lang_Data spa
982 SectionEnd
983
984 Section /o "Spanish (Old)" SecLang_spa_old
985 AddSize 2760
986 !insertmacro Download_Lang_Data spa_old
987 SectionEnd
988
989 Section /o "Albanian" SecLang_sqi
990 AddSize 1790
991 !insertmacro Download_Lang_Data sqi
992 SectionEnd
993
994 Section /o "Serbian" SecLang_srp
995 AddSize 2050
996 !insertmacro Download_Lang_Data srp
997 SectionEnd
998
999 Section /o "Serbian (Latin)" SecLang_srp_latn
1000 AddSize 3130
1001 !insertmacro Download_Lang_Data srp_latn
1002 SectionEnd
1003
1004 Section /o "Sundanese" SecLang_sun
1005 AddSize 1310
1006 !insertmacro Download_Lang_Data sun
1007 SectionEnd
1008
1009 Section /o "Swahili" SecLang_swa
1010 AddSize 2070
1011 !insertmacro Download_Lang_Data swa
1012 SectionEnd
1013
1014 Section /o "Swedish" SecLang_swe
1015 AddSize 3970
1016 !insertmacro Download_Lang_Data swe
1017 SectionEnd
1018
1019 Section /o "Syriac" SecLang_syr
1020 AddSize 2100
1021 !insertmacro Download_Lang_Data syr
1022 SectionEnd
1023
1024 Section /o "Tamil" SecLang_tam
1025 AddSize 3090
1026 !insertmacro Download_Lang_Data tam
1027 SectionEnd
1028
1029 Section /o "Tatar" SecLang_tat
1030 AddSize 1020
1031 !insertmacro Download_Lang_Data tat
1032 SectionEnd
1033
1034 Section /o "Telugu" SecLang_tel
1035 AddSize 2640
1036 !insertmacro Download_Lang_Data tel
1037 SectionEnd
1038
1039 Section /o "Tajik" SecLang_tgk
1040 AddSize 2480
1041 !insertmacro Download_Lang_Data tgk
1042 SectionEnd
1043
1044 Section /o "Thai" SecLang_tha
1045 AddSize 1020
1046 !insertmacro Download_Lang_Data tha
1047 SectionEnd
1048
1049 Section /o "Tigrinya" SecLang_tir
1050 AddSize 370
1051 !insertmacro Download_Lang_Data tir
1052 SectionEnd
1053
1054 Section /o "Tonga" SecLang_ton
1055 AddSize 925
1056 !insertmacro Download_Lang_Data ton
1057 SectionEnd
1058
1059 Section /o "Turkish" SecLang_tur
1060 AddSize 4240
1061 !insertmacro Download_Lang_Data tur
1062 SectionEnd
1063
1064 Section /o "Uighur" SecLang_uig
1065 AddSize 2660
1066 !insertmacro Download_Lang_Data uig
1067 SectionEnd
1068
1069 Section /o "Ukrainian" SecLang_ukr
1070 AddSize 3650
1071 !insertmacro Download_Lang_Data ukr
1072 SectionEnd
1073
1074 Section /o "Urdu" SecLang_urd
1075 AddSize 1330
1076 !insertmacro Download_Lang_Data urd
1077 SectionEnd
1078
1079 Section /o "Uzbek" SecLang_uzb
1080 AddSize 6170
1081 !insertmacro Download_Lang_Data uzb
1082 SectionEnd
1083
1084 Section /o "Uzbek (Cyrillic)" SecLang_uzb_cyrl
1085 AddSize 1490
1086 !insertmacro Download_Lang_Data uzb_cyrl
1087 SectionEnd
1088
1089 Section /o "Vietnamese" SecLang_vie
1090 AddSize 519
1091 !insertmacro Download_Lang_Data vie
1092 SectionEnd
1093
1094 Section /o "Yiddish" SecLang_yid
1095 AddSize 533
1096 !insertmacro Download_Lang_Data yid
1097 SectionEnd
1098
1099 Section /o "Yoruba" SecLang_yor
1100 AddSize 941
1101 !insertmacro Download_Lang_Data yor
1102 SectionEnd
1103
1104 SectionGroupEnd
1105
1106 ;--------------------------------
1107 ;Descriptions
1108 ; At first we need to localize installer for languages which supports well in tesseract: Eng, Spa, Ger, Ita, Dutch + Russian (it is authors native language)
1109 ;Language strings
1110 LangString DESC_SEC0001 ${LANG_RUSSIAN} "Установочные файлы."
1111 ;LangString DESC_SecHelp ${LANG_RUSSIAN} "Справочная информация."
1112 LangString DESC_SecCS ${LANG_RUSSIAN} "Добавить ярлыки в меню Пуск"
1113
1114 LangString DESC_SEC0001 ${LANG_ENGLISH} "Installation files."
1115 ;LangString DESC_SecHelp ${LANG_ENGLISH} "Help information."
1116 LangString DESC_SecCS ${LANG_ENGLISH} "Add shortcuts to Start menu."
1117
1118 LangString DESC_SEC0001 ${LANG_FRENCH} "Fichier d'installation."
1119 ;LangString DESC_SecHelp ${LANG_FRENCH} "Aide."
1120 LangString DESC_SecCS ${LANG_FRENCH} "Ajouter des raccourcis vers le menu démarrer."
1121
1122 LangString DESC_SEC0001 ${LANG_GERMAN} "Dateien für die Installation."
1123 ;LangString DESC_SecHelp ${LANG_GERMAN} "Hilfe."
1124 LangString DESC_SecCS ${LANG_GERMAN} "Einträge im Startmenü hinzufügen."
1125
1126 LangString DESC_SEC0001 ${LANG_ITALIAN} "File di installazione."
1127 ;LangString DESC_SecHelp ${LANG_ITALIAN} "Guida di informazioni."
1128 LangString DESC_SecCS ${LANG_ITALIAN} "Aggiungere collegamenti al menu Start."
1129
1130 LangString DESC_SEC0001 ${LANG_SLOVAK} "Súbory inštalácie."
1131 ;LangString DESC_SecHelp ${LANG_ENGLISH} "Pomocné informácie."
1132 LangString DESC_SecCS ${LANG_SLOVAK} "Pridať odkaz do Start menu."
1133
1134 LangString DESC_SEC0001 ${LANG_SPANISH} "Los archivos de instalación."
1135 ;LangString DESC_SecHelp ${LANG_SPANISH} "Información de ayuda."
1136 LangString DESC_SecCS ${LANG_SPANISH} "Ańadir accesos directos al menú Inicio."
1137
1138 LangString DESC_SEC0001 ${LANG_SPANISHINTERNATIONAL} "Los archivos de instalación."
1139 ;LangString DESC_SecHelp ${LANG_SPANISHINTERNATIONAL} "Información de ayuda."
1140 LangString DESC_SecCS ${LANG_SPANISHINTERNATIONAL} "Ańadir accesos directos al menú Inicio."
1141
1142 ;Assign language strings to sections
1143 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1144 !insertmacro MUI_DESCRIPTION_TEXT ${SEC0001} $(DESC_SEC0001)
1145 !insertmacro MUI_DESCRIPTION_TEXT ${SecCS} $(DESC_SecCS)
1146 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1147
1148 ;--------------------------------
1149 ;Uninstaller Section
1150
1151 ;Section /o -un.Main UNSEC0000
1152 Section -un.Main UNSEC0000
1153 !ifdef W64
1154 SetRegView 64
1155 !endif
1156 DetailPrint "Removing everything"
1157 Delete "$SMPROGRAMS\${PRODUCT_NAME}\*.*"
1158 RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
1159 DetailPrint "Removing registry info"
1160 DeleteRegKey HKLM "Software\Tesseract-OCR"
1161 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=1000
1162
1163 # remove the Add/Remove information
1164 DeleteRegKey HKLM "${UNINST_KEY}"
1165 Delete "${UNINST_EXE}"
1166 DeleteRegValue HKLM "${REGKEY}" Path
1167 DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
1168 DeleteRegKey /IfEmpty HKLM "${REGKEY}"
1169 Delete "$INSTDIR\*.dll"
1170 Delete "$INSTDIR\*.exe"
1171 Delete "$INSTDIR\*.html"
1172 Delete "$INSTDIR\doc\AUTHORS"
1173 Delete "$INSTDIR\doc\LICENSE"
1174 Delete "$INSTDIR\doc\README.md"
1175 RMDir "$INSTDIR\doc"
1176 RMDir /r "$INSTDIR\tessdata"
1177 RMDir "$INSTDIR"
1178 SectionEnd
1179
1180 Function PageReinstall
1181
1182 FunctionEnd
1183
1184 Function PageLeaveReinstall
1185
1186 FunctionEnd
1187
1188 !macro REMOVE_REGKEY OLD_KEY
1189 StrCmp ${OLD_KEY} HKLM 0 +3
1190 DeleteRegKey HKLM "${REGKEY}"
1191 Goto End
1192 DeleteRegKey HKCU "${REGKEY}"
1193 End:
1194 !macroend
1195
1196 Function .onInit
1197 !ifdef W64
1198 SetRegView 64
1199 !endif
1200 Call PreventMultipleInstances
1201 !insertmacro MUI_LANGDLL_DISPLAY
1202 ;RequestExecutionLevel admin
1203 !insertmacro MULTIUSER_INIT
1204
1205 ; is tesseract already installed?
1206 ReadRegStr $R0 HKCU "${REGKEY}" "CurrentVersion"
1207 StrCpy $OLD_KEY HKCU
1208 StrCmp $R0 "" TestHKLM AskUninstall
1209 TestHKLM:
1210 ReadRegStr $R0 HKLM "${REGKEY}" "CurrentVersion"
1211 StrCpy $OLD_KEY HKLM
1212 StrCmp $R0 "" SkipUnInstall
1213 AskUninstall:
1214 MessageBox MB_YESNO|MB_ICONEXCLAMATION \
1215 "Tesseract-ocr version $R0 is installed (in $OLD_KEY)! Do you want to uninstall it first?$\nUninstall will delete all files in '$INSTDIR'!" \
1216 /SD IDYES IDNO SkipUnInstall IDYES UnInstall
1217 UnInstall:
1218 StrCmp $OLD_KEY "HKLM" UnInst_hklm
1219 DetailPrint "Uninstall: current user"
1220 readRegStr $R1 HKCU "${UNINST_KEY}" "UninstallString"
1221 Goto try_uninstall
1222 UnInst_hklm:
1223 DetailPrint "UnInstall: all users"
1224 readRegStr $R1 HKLM "${UNINST_KEY}" "UninstallString"
1225 try_uninstall:
1226 ClearErrors
1227 ExecWait '$R1 _?=$INSTDIR'$0
1228 ; Check if unstaller finished ok. If yes, then try to remove it from installer.
1229 StrCmp $0 0 0 +3
1230 !insertmacro REMOVE_REGKEY ${OLD_KEY}
1231 Goto SkipUnInstall
1232 messagebox mb_ok "Uninstaller failed:\n$0\n\nYou need to remove program manually."
1233 SkipUnInstall:
1234 ;InitPluginsDir
1235 ;File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
1236 ;File /oname=$PLUGINSDIR\splash.bmp "new.bmp"
1237 ;advsplash::show 1000 600 400 -1 $PLUGINSDIR\splash
1238 ;Pop $0 ; $0 has '1' if the user closed the splash screen early,
1239 ; '0' if everything closed normal, and '-1' if some error occurred.
1240 ;IfFileExists $INSTDIR\loadmain.exe PathGood
1241 ;done:
1242 ; Make selection based on System language ID
1243 System::Call 'kernel32::GetSystemDefaultLangID() i .r0'
1244 ;http://msdn.microsoft.com/en-us/library/dd318693%28v=VS.85%29.aspx
1245 StrCmp $0 "1078" Afrikaans
1246 StrCmp $0 "1052" Albanian
1247 StrCmp $0 "5121" Arabic
1248 StrCmp $0 "1068" Azerbaijani
1249 StrCmp $0 "1069" Basque
1250 StrCmp $0 "1059" Belarusian
1251 StrCmp $0 "1093" Bengali
1252 StrCmp $0 "1026" Bulgarian
1253 StrCmp $0 "1027" Catalan
1254 StrCmp $0 "1116" Cherokee
1255 StrCmp $0 "31748" Chinese_tra
1256 StrCmp $0 "4" Chinese_sim
1257 StrCmp $0 "26" Croatian
1258 StrCmp $0 "1029" Czech
1259 StrCmp $0 "1030" Danish
1260 StrCmp $0 "2067" Dutch
1261 StrCmp $0 "1061" Estonian
1262 StrCmp $0 "3079" German
1263 StrCmp $0 "1032" Greek
1264 StrCmp $0 "1035" Finnish
1265 StrCmp $0 "2060" French
1266 StrCmp $0 "1037" Hebrew
1267 StrCmp $0 "1081" Hindi
1268 StrCmp $0 "1038" Hungarian
1269 StrCmp $0 "1039" Icelandic
1270 StrCmp $0 "1057" Indonesian
1271 StrCmp $0 "1040" Italian
1272 StrCmp $0 "1041" Japanese
1273 StrCmp $0 "1099" Kannada
1274 StrCmp $0 "1042" Korean
1275 StrCmp $0 "1062" Latvian
1276 StrCmp $0 "1063" Lithuanian
1277 StrCmp $0 "1071" Macedonian
1278 StrCmp $0 "1100" Malayalam
1279 StrCmp $0 "2110" Malay
1280 StrCmp $0 "1082" Maltese
1281 StrCmp $0 "1044" Norwegian
1282 StrCmp $0 "1045" Polish
1283 StrCmp $0 "1046" Portuguese
1284 StrCmp $0 "1048" Romanian
1285 StrCmp $0 "1049" Russian
1286 StrCmp $0 "1051" Slovak
1287 StrCmp $0 "1060" Slovenian
1288 StrCmp $0 "11274" Spanish
1289 StrCmp $0 "2074" Serbian
1290 StrCmp $0 "1089" Swahili
1291 StrCmp $0 "2077" Swedish
1292 StrCmp $0 "1097" Tamil
1293 StrCmp $0 "1098" Telugu
1294 StrCmp $0 "1054" Thai
1295 StrCmp $0 "1055" Turkish
1296 StrCmp $0 "1058" Ukrainian
1297 StrCmp $0 "1066" Vietnamese
1298
1299 Goto lang_end
1300
1301 Afrikaans: !insertmacro SelectSection ${SecLang_afr}
1302 Goto lang_end
1303 Albanian: !insertmacro SelectSection ${SecLang_sqi}
1304 Goto lang_end
1305 Arabic: !insertmacro SelectSection ${SecLang_ara}
1306 Goto lang_end
1307 ;Assamese: !insertmacro SelectSection ${SecLang_asm}
1308 ; Goto lang_end
1309 Azerbaijani: !insertmacro SelectSection ${SecLang_aze}
1310 Goto lang_end
1311 Basque: !insertmacro SelectSection ${SecLang_eus}
1312 Goto lang_end
1313 Belarusian: !insertmacro SelectSection ${SecLang_bel}
1314 Goto lang_end
1315 Bengali: !insertmacro SelectSection ${SecLang_ben}
1316 Goto lang_end
1317 Bulgarian: !insertmacro SelectSection ${SecLang_bul}
1318 Goto lang_end
1319 Catalan: !insertmacro SelectSection ${SecLang_cat}
1320 Goto lang_end
1321 Cherokee: !insertmacro SelectSection ${SecLang_chr}
1322 Goto lang_end
1323 Chinese_tra: !insertmacro SelectSection ${SecLang_chi_tra}
1324 Goto lang_end
1325 Chinese_sim: !insertmacro SelectSection ${SecLang_chi_sim}
1326 Goto lang_end
1327 Croatian: !insertmacro SelectSection ${SecLang_hrv}
1328 Goto lang_end
1329 Czech: !insertmacro SelectSection ${SecLang_ces}
1330 Goto lang_end
1331 Danish: !insertmacro SelectSection ${SecLang_dan}
1332 Goto lang_end
1333 Dutch: !insertmacro SelectSection ${SecLang_nld}
1334 Goto lang_end
1335 Estonian: !insertmacro SelectSection ${SecLang_hrv}
1336 Goto lang_end
1337 German: !insertmacro SelectSection ${SecLang_deu}
1338 Goto lang_end
1339 Greek: !insertmacro SelectSection ${SecLang_ell}
1340 !insertmacro SelectSection ${SecLang_grc}
1341 Goto lang_end
1342 Finnish: !insertmacro SelectSection ${SecLang_fin}
1343 !insertmacro SelectSection ${SecLang_frm}
1344 Goto lang_end
1345 French: !insertmacro SelectSection ${SecLang_fra}
1346 Goto lang_end
1347 Hebrew: !insertmacro SelectSection ${SecLang_heb}
1348 ;!insertmacro SelectSection ${SecLang_heb_com}
1349 Goto lang_end
1350 Hungarian: !insertmacro SelectSection ${SecLang_hin}
1351 Goto lang_end
1352 Hindi: !insertmacro SelectSection ${SecLang_hun}
1353 Goto lang_end
1354 Icelandic: !insertmacro SelectSection ${SecLang_isl}
1355 Goto lang_end
1356 Indonesian: !insertmacro SelectSection ${SecLang_ind}
1357 Goto lang_end
1358 Italian: !insertmacro SelectSection ${SecLang_ita}
1359 !insertmacro SelectSection ${SecLang_ita_old}
1360 Goto lang_end
1361 Japanese: !insertmacro SelectSection ${SecLang_jpn}
1362 Goto lang_end
1363 Kannada: !insertmacro SelectSection ${SecLang_kan}
1364 Goto lang_end
1365 Korean: !insertmacro SelectSection ${SecLang_kor}
1366 Goto lang_end
1367 Latvian: !insertmacro SelectSection ${SecLang_lav}
1368 Goto lang_end
1369 Lithuanian: !insertmacro SelectSection ${SecLang_lit}
1370 Goto lang_end
1371 Macedonian: !insertmacro SelectSection ${SecLang_mkd}
1372 Goto lang_end
1373 Malayalam: !insertmacro SelectSection ${SecLang_msa}
1374 Goto lang_end
1375 Malay: !insertmacro SelectSection ${SecLang_mal}
1376 Goto lang_end
1377 Maltese: !insertmacro SelectSection ${SecLang_mlt}
1378 Goto lang_end
1379 Norwegian: !insertmacro SelectSection ${SecLang_nor}
1380 Goto lang_end
1381 Polish: !insertmacro SelectSection ${SecLang_pol}
1382 Goto lang_end
1383 Portuguese: !insertmacro SelectSection ${SecLang_por}
1384 Goto lang_end
1385 Romanian: !insertmacro SelectSection ${SecLang_ron}
1386 Goto lang_end
1387 Russian: !insertmacro SelectSection ${SecLang_rus}
1388 Goto lang_end
1389 Slovak: !insertmacro SelectSection ${SecLang_slk}
1390 Goto lang_end
1391 Slovenian: !insertmacro SelectSection ${SecLang_slv}
1392 Goto lang_end
1393 Spanish: !insertmacro SelectSection ${SecLang_spa}
1394 !insertmacro SelectSection ${SecLang_spa_old}
1395 Goto lang_end
1396 Serbian: !insertmacro SelectSection ${SecLang_srp}
1397 Goto lang_end
1398 Swahili: !insertmacro SelectSection ${SecLang_swa}
1399 Goto lang_end
1400 Swedish: !insertmacro SelectSection ${SecLang_swe}
1401 Goto lang_end
1402 Tamil: !insertmacro SelectSection ${SecLang_tam}
1403 Goto lang_end
1404 Telugu: !insertmacro SelectSection ${SecLang_tel}
1405 Goto lang_end
1406 Thai: !insertmacro SelectSection ${SecLang_tha}
1407 Goto lang_end
1408 Turkish: !insertmacro SelectSection ${SecLang_tur}
1409 Goto lang_end
1410 Ukrainian: !insertmacro SelectSection ${SecLang_ukr}
1411 Goto lang_end
1412 Vietnamese: !insertmacro SelectSection ${SecLang_vie}
1413
1414 lang_end:
1415 FunctionEnd
1416
1417 Function un.onInit
1418 !insertmacro MUI_LANGDLL_DISPLAY
1419 !insertmacro MULTIUSER_UNINIT
1420 ;!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
1421 ;!insertmacro MUI_UNGETLANGUAGE
1422 FunctionEnd
1423
1424 Function .onInstFailed
1425 MessageBox MB_OK "Installation failed."
1426 FunctionEnd
1427
1428 !ifdef SHOW_README
1429 Function ShowReadme
1430 Exec '"wordpad" "doc\README.md"'
1431 ;BringToFront
1432 FunctionEnd
1433 !endif
1434
1435 ; Prevent running multiple instances of the installer
1436 Function PreventMultipleInstances
1437 ; TODO: Does not work.
1438 Push $R0
1439 System::Call 'kernel32::CreateMutexA(i 0, i 0, t ${PRODUCT_NAME}) ?e'
1440 Pop $R0
1441 StrCmp $R0 0 +3
1442 MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running." /SD IDOK
1443 Abort
1444 Pop $R0
1445 FunctionEnd