tesseract.nsi 40 KB

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