]> git.lyx.org Git - features.git/blob - development/Win32/packaging/installer/include/init.nsh
installer: add support for Marathi
[features.git] / development / Win32 / packaging / installer / include / init.nsh
1 /*
2 init.nsh
3
4 Initialization functions
5 */
6
7 #--------------------------------
8 # User initialization
9
10 Var ComponentPath
11 Var LyXLangName
12
13 # COMPONENT can be LaTeX, ImageMagick and Ghostscript
14 !macro EXTERNAL_INIT COMPONENT
15
16   # APP_REGKEY_SETUP = "Software\${APP_NAME}${APP_SERIES_KEY}\Setup"
17   # where ${APP_NAME}${APP_SERIES_KEY} is something like LyX16
18   ReadRegStr $ComponentPath SHELL_CONTEXT "${APP_REGKEY_SETUP}" "${COMPONENT} Path"
19   
20   # BIN_LATEX etc are defined in settings.nsh
21   ${If} ${FileExists} "$ComponentPath\${BIN_${COMPONENT}}"
22     # set variables like PathLaTeX
23     StrCpy $Path${COMPONENT} $ComponentPath
24   ${EndIf}
25
26 !macroend
27
28 Function InitUser
29
30   # Get directories of components from registry
31   
32   !insertmacro EXTERNAL_INIT LaTeX
33   
34   # Get LyX language
35   
36   ReadRegStr $LyXLangName SHELL_CONTEXT "${APP_REGKEY_SETUP}" "LyX Language"
37   
38   ${If} $LyXLangName != ""
39     StrCpy $LangName $LyXLangName
40   ${EndIf}
41   
42 FunctionEnd
43
44 #--------------------------------
45 # visible installer sections
46
47 Section "!${APP_NAME}" SecCore
48  SectionIn RO
49 SectionEnd
50
51 Section "$(SecFileAssocTitle)" SecFileAssoc
52  StrCpy $CreateFileAssociations "true"
53 SectionEnd
54
55 Section "$(SecDesktopTitle)" SecDesktop
56  StrCpy $CreateDesktopIcon "true"
57 SectionEnd
58
59 !if ${SETUPTYPE} == BUNDLE
60  Section /o "$(SecInstJabRefTitle)" SecInstJabRef
61   AddSize ${SIZE_JABREF}
62   StrCpy $InstallJabRef "true"
63  SectionEnd
64 !endif
65
66 # Expand the list of dictionaries by default as this was requested by several
67 # users. For the thesaurus this is was not requested because this section
68 # is by default empty.
69 SectionGroup /e "Dictionaries" SecDictionaries
70
71 Section /o "Afrikaans" SecDAfrikaans
72  StrCpy $DictCodes "af_ZA,$DictCodes"
73  AddSize 1440
74 SectionEnd
75
76 Section /o "Arabic" SecDArabic
77  StrCpy $DictCodes "ar_DZ,$DictCodes"
78  AddSize 2500
79 SectionEnd
80
81 Section /o "Armenian" SecDArmenian
82  StrCpy $DictCodes "hy_AM,$DictCodes"
83  AddSize 2000
84 SectionEnd
85
86 Section /o "Bahasa Indonesia" SecDIndonesian
87  StrCpy $DictCodes "id_ID,$DictCodes"
88  AddSize 217
89 SectionEnd
90
91 Section /o "Bahasa Melayu" SecDMalayan
92  StrCpy $DictCodes "ms_MY,$DictCodes"
93  AddSize 227
94 SectionEnd
95
96 Section /o "Belarusian" SecDBelarusian 
97  StrCpy $DictCodes "be_BY,$DictCodes"
98  AddSize 1730
99 SectionEnd
100
101 Section /o "Brezhoneg" SecDBreton 
102  StrCpy $DictCodes "br_FR,$DictCodes"
103  AddSize 5510
104 SectionEnd
105
106 Section /o "Bulgarian" SecDBulgarian
107  StrCpy $DictCodes "bg_BG,$DictCodes"
108  AddSize 985
109 SectionEnd
110
111 Section /o "Català" SecDCatalanian
112  StrCpy $DictCodes "ca_ES,$DictCodes"
113  AddSize 1210
114 SectionEnd
115
116 Section /o "Ce\9atina" SecDCzech
117  StrCpy $DictCodes "cs_CZ,$DictCodes"
118  AddSize 2190
119 SectionEnd
120
121 # enable this for LyX 2.1!
122 #Section /o "Coptic" SecDCoptic
123 # StrCpy $DictCodes "cop_EG,$DictCodes"
124 # AddSize 151
125 #SectionEnd
126
127 Section /o "Cymraeg" SecDWelsh 
128  StrCpy $DictCodes "cy_GB,$DictCodes"
129  AddSize 1540
130 SectionEnd
131
132 Section /o "Dansk" SecDDanish
133  StrCpy $DictCodes "da_DK,$DictCodes"
134  AddSize 2470
135 SectionEnd
136
137 Section /o "German (A)" SecDGermanAT
138  StrCpy $DictCodes "de_AT,$DictCodes"
139  AddSize 3620
140 SectionEnd
141
142 Section /o "German (CH)" SecDGermanCH
143  StrCpy $DictCodes "de_CH,$DictCodes"
144  AddSize 3620
145 SectionEnd
146
147 Section "German (D)" SecDGermanD
148  # already installed by default
149  SectionIn RO
150  #StrCpy $DictCodes "de_DE,$DictCodes"
151  AddSize 3620
152 SectionEnd
153
154 Section /o "Greek" SecDGreek
155  StrCpy $DictCodes "el_GR,$DictCodes"
156  AddSize 6550
157 SectionEnd
158
159 Section /o "Eesti" SecDEstonian
160  StrCpy $DictCodes "et_EE,$DictCodes"
161  AddSize 4400
162 SectionEnd
163
164 # enable this for LyX 2.1!
165 #Section /o "English (AU)" SecDEnglishAU
166 # StrCpy $DictCodes "en_AU,$DictCodes"
167 # AddSize 587
168 #SectionEnd
169
170 Section /o "English (CA)" SecDEnglishCA
171  StrCpy $DictCodes "en_CA,$DictCodes"
172  AddSize 690
173 SectionEnd
174
175 Section "English (GB)" SecDEnglishGB
176  # already installed by default
177  SectionIn RO
178  #StrCpy $DictCodes "en_GB,$DictCodes"
179  AddSize 757
180 SectionEnd
181
182 # enable this for LyX 2.1!
183 #Section /o "English (NZ)" SecDEnglishNZ
184 # StrCpy $DictCodes "en_NZ,$DictCodes"
185 # AddSize 551
186 #SectionEnd
187
188 Section "English (US)" SecDEnglishUS
189  # already installed by default
190  SectionIn RO
191  #StrCpy $DictCodes "en_US,$DictCodes"
192  AddSize 688
193 SectionEnd
194
195 Section "Español (ES)" SecDSpanishES
196  # already installed by default
197  SectionIn RO
198  #StrCpy $DictCodes "es_ES,$DictCodes"
199  AddSize 974
200 SectionEnd
201
202 Section "Español (MX)" SecDSpanishMX
203  # already installed by default
204  SectionIn RO
205  #StrCpy $DictCodes "es_MX,$DictCodes"
206  AddSize 924
207 SectionEnd
208
209 Section /o "Esperanto" SecDEsperanto
210  StrCpy $DictCodes "eo_EO,$DictCodes"
211  AddSize 389
212 SectionEnd
213
214 Section /o "Euskara" SecDBasque
215  StrCpy $DictCodes "eu_ES,$DictCodes"
216  AddSize 4850
217 SectionEnd
218
219 Section /o "Farsi" SecDFarsi
220  StrCpy $DictCodes "fa_IR,$DictCodes"
221  AddSize 6710
222 SectionEnd
223
224 Section "Français" SecDFrench
225  # already installed by default
226  SectionIn RO
227  #StrCpy $DictCodes "fr_FR,$DictCodes"
228  AddSize 1200
229 SectionEnd
230
231 Section /o "Gaeilge" SecDGaelic
232  StrCpy $DictCodes "ga_IR,$DictCodes"
233  AddSize 1090
234 SectionEnd
235
236 Section /o "Gàidhlig" SecDScottish
237  StrCpy $DictCodes "gd_GB,$DictCodes"
238  AddSize 1660
239 SectionEnd
240
241 Section /o "Galego" SecDGalician
242  StrCpy $DictCodes "gl_ES,$DictCodes"
243  AddSize 916
244 SectionEnd
245
246 Section /o "Hebrew" SecDHebrew
247  StrCpy $DictCodes "he_IL,$DictCodes"
248  AddSize 3120
249 SectionEnd
250
251 Section /o "Hrvatski" SecDCroatian
252  StrCpy $DictCodes "hr_HR,$DictCodes"
253  AddSize 2240
254 SectionEnd
255
256 Section /o "Magyar" SecDHungarian
257  StrCpy $DictCodes "hu_HU,$DictCodes"
258  AddSize 3380
259 SectionEnd
260
261 # enable this for LyX 2.1!
262 #Section /o "Hindi" SecDHindi
263 # StrCpy $DictCodes "hi_IN,$DictCodes"
264 # AddSize 1900
265 #SectionEnd
266
267 Section /o "Interlingua" SecDInterlingua
268  StrCpy $DictCodes "ia_IA,$DictCodes"
269  AddSize 649
270 SectionEnd
271
272 Section /o "Íslenska" SecDIcelandic
273  StrCpy $DictCodes "is_IS,$DictCodes"
274  AddSize 2320
275 SectionEnd
276
277 Section /o "Italiano" SecDItalian
278  StrCpy $DictCodes "it_IT,$DictCodes"
279  AddSize 1300
280 SectionEnd
281
282 Section /o "Kazakh" SecDKazakh
283  StrCpy $DictCodes "kk_KZ,$DictCodes"
284  AddSize 2120
285 SectionEnd
286
287 Section /o "Korean" SecDKorean
288  StrCpy $DictCodes "ko_KR,$DictCodes"
289  AddSize 16540
290 SectionEnd
291
292 Section /o "Latina" SecDLatin
293  StrCpy $DictCodes "la_LA,$DictCodes"
294  AddSize 1250
295 SectionEnd
296
297 Section /o "Lietuviu" SecDLithuanian
298  StrCpy $DictCodes "lt_LT,$DictCodes"
299  AddSize 1320
300 SectionEnd
301
302 Section /o "Latvie\9au" SecDLatvian
303  StrCpy $DictCodes "lv_LV,$DictCodes"
304  AddSize 2140
305 SectionEnd
306
307 # enable this for LyX 2.1!
308 #Section /o "Marathi" SecDMarathi
309 # StrCpy $DictCodes "mr_IN,$DictCodes"
310 # AddSize 5290
311 #SectionEnd
312
313 Section /o "Nederlands" SecDDutch
314  StrCpy $DictCodes "nl_NL,$DictCodes"
315  AddSize 1820
316 SectionEnd
317
318 Section /o "Norsk (Bokmål)" SecDNorwegianNB
319  StrCpy $DictCodes "nb_NO,$DictCodes"
320  AddSize 5000
321 SectionEnd
322
323 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
324  StrCpy $DictCodes "nn_NO,$DictCodes"
325  AddSize 2970
326 SectionEnd
327
328 # enable this for LyX 2.1!
329 #Section /o "Occitan" SecDOccitan
330 # StrCpy $DictCodes "oc_FR,$DictCodes"
331 # AddSize 31710
332 #SectionEnd
333
334 Section /o "Polski" SecDPolish
335  StrCpy $DictCodes "pl_PL,$DictCodes"
336  AddSize 4540
337 SectionEnd
338
339 Section /o "Português (BR)" SecDPortugueseBR
340  StrCpy $DictCodes "pt_BR,$DictCodes"
341  AddSize 5280
342 SectionEnd
343
344 Section /o "Português (PT)" SecDPortuguesePT
345  StrCpy $DictCodes "pt_PT,$DictCodes"
346  AddSize 1520
347 SectionEnd
348
349 Section /o "Româna" SecDRomanian
350  StrCpy $DictCodes "ro_RO,$DictCodes"
351  AddSize 1930
352 SectionEnd
353
354 Section /o "Russian" SecDRussian
355  StrCpy $DictCodes "ru_RU,$DictCodes"
356  AddSize 1920
357 SectionEnd
358
359 Section /o "Serb\9acina (Dolno)" SecDSorbianD
360  StrCpy $DictCodes "dsb_DE,$DictCodes"
361  AddSize 904
362 SectionEnd
363
364 Section /o "Serb\9acina (Horno)" SecDSorbianH
365  StrCpy $DictCodes "hsb_DE,$DictCodes"
366  AddSize 740
367 SectionEnd
368
369 Section /o "Shqipe" SecDAlbanian
370  StrCpy $DictCodes "sq_AL,$DictCodes"
371  AddSize 2400
372 SectionEnd
373
374 Section /o "Sloven\9acina" SecDSlovenian
375  StrCpy $DictCodes "sl_SI,$DictCodes"
376  AddSize 2910
377 SectionEnd
378
379 Section /o "Slovenský" SecDSlovakian
380  StrCpy $DictCodes "sk_SK,$DictCodes"
381  AddSize 4090
382 SectionEnd
383
384 Section /o "Srpski" SecDSerbian
385  StrCpy $DictCodes "sr_RS,$DictCodes"
386  AddSize 3460
387 SectionEnd
388
389 Section /o "Svenska" SecDSwedish
390  StrCpy $DictCodes "sv_SE,$DictCodes"
391  AddSize 2028
392 SectionEnd
393
394 # enable this for LyX 2.1!
395 #Section /o "Tamil" SecDTamil
396 # StrCpy $DictCodes "ta_IN,$DictCodes"
397 # AddSize 5911
398 #SectionEnd
399
400 # enable this for LyX 2.1!
401 #Section /o "Telugu" SecDTelugu
402 # StrCpy $DictCodes "te_IN,$DictCodes"
403 # AddSize 3400
404 #SectionEnd
405  
406 Section /o "Thai" SecDThai
407  StrCpy $DictCodes "th_TH,$DictCodes"
408  AddSize 351
409 SectionEnd
410
411 Section /o "Ukrainian" SecDUkrainian
412  StrCpy $DictCodes "uk_UA,$DictCodes"
413  AddSize 2620
414 SectionEnd
415
416 # enable this for LyX 2.1!
417 #Section /o "Urdu" SecDUrdu
418 # StrCpy $DictCodes "ur_PK,$DictCodes"
419 # AddSize 1401
420 #SectionEnd
421
422 Section /o "Vietnamese" SecDVietnamese
423  StrCpy $DictCodes "vi_VN,$DictCodes"
424  AddSize 40
425 SectionEnd
426
427 SectionGroupEnd
428
429
430 SectionGroup "Thesaurus" SecThesaurus
431
432 Section /o "Bulgarian" SecTBulgarian
433  StrCpy $ThesCodes "bg_BG,$ThesCodes"
434  AddSize 3020
435 SectionEnd
436
437 Section /o "Català" SecTCatalan
438  StrCpy $ThesCodes "ca_ES,$ThesCodes"
439  AddSize 731
440 SectionEnd
441
442 Section /o "Ce\9atina" SecTCzech
443  StrCpy $ThesCodes "cs_CZ,$ThesCodes"
444  AddSize 635
445 SectionEnd
446
447 Section /o "Dansk" SecTDanish
448  StrCpy $ThesCodes "da_DK,$ThesCodes"
449  AddSize 2360
450 SectionEnd
451
452 Section /o "Deutsch (D/A)" SecTGermanDA
453  StrCpy $ThesCodes "de_DE,$ThesCodes"
454  AddSize 14600
455 SectionEnd
456
457 Section /o "Deutsch (CH)" SecTGermanCH
458  StrCpy $ThesCodes "de_CH,$ThesCodes"
459  AddSize 14600
460 SectionEnd
461
462 Section /o "English (GB)" SecTEnglishGB
463  StrCpy $ThesCodes "en_GB,$ThesCodes"
464  AddSize 20600
465 SectionEnd
466
467 Section /o "English (US/AU)" SecTEnglishUSAU
468  StrCpy $ThesCodes "en_US,$ThesCodes"
469  AddSize 20600
470 SectionEnd
471
472 Section /o "Español" SecTSpanish
473  StrCpy $ThesCodes "es_ES,$ThesCodes"
474  AddSize 2860
475 SectionEnd
476
477 Section /o "Français" SecTFrench
478  StrCpy $ThesCodes "fr_FR,$ThesCodes"
479  AddSize 5060
480 SectionEnd
481
482 Section /o "Gaeilge" SecTGaelic
483  StrCpy $ThesCodes "ga_IR,$ThesCodes"
484  AddSize 30600
485 SectionEnd
486
487 Section /o "Greek" SecTGreek
488  StrCpy $ThesCodes "el_GR,$ThesCodes"
489  AddSize 903
490 SectionEnd
491
492 Section /o "Italiano" SecTItalian
493  StrCpy $ThesCodes "it_IT,$ThesCodes"
494  AddSize 2640
495 SectionEnd
496
497 Section /o "Magyar" SecTHungarian
498  StrCpy $ThesCodes "hu_HU,$ThesCodes"
499  AddSize 632
500 SectionEnd
501
502 Section /o "Norsk (Bokmål)" SecTNorwegianNB
503  StrCpy $ThesCodes "nb_NO,$ThesCodes"
504  AddSize 2540
505 SectionEnd
506
507 Section /o "Polski" SecTPolish
508  StrCpy $ThesCodes "pl_PL,$ThesCodes"
509  AddSize 5580
510 SectionEnd
511
512 Section /o "Português" SecTPortuguese
513  StrCpy $ThesCodes "pt_PT,$ThesCodes"
514  AddSize 860
515 SectionEnd
516
517 Section /o "Româna" SecTRomanian
518  StrCpy $ThesCodes "ro_RO,$ThesCodes"
519  AddSize 3640
520 SectionEnd
521
522 Section /o "Russian" SecTRussian
523  StrCpy $ThesCodes "ru_RU,$ThesCodes"
524  AddSize 2080
525 SectionEnd
526
527 Section /o "Sloven\9acina" SecTSlovenian
528  StrCpy $ThesCodes "sl_SI,$ThesCodes"
529  AddSize 1037
530 SectionEnd
531
532 Section /o "Slovenský" SecTSlovakian
533  StrCpy $ThesCodes "sk_SK,$ThesCodes"
534  AddSize 907
535 SectionEnd
536
537 Section /o "Svenska" SecTSwedish
538  StrCpy $ThesCodes "sv_SE,$ThesCodes"
539  AddSize 720
540 SectionEnd
541
542 SectionGroupEnd
543
544 # Section descriptions
545 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
546 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
547 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
548 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
549 !if ${SETUPTYPE} == BUNDLE
550  !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
551 !endif
552 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
553 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
554 !insertmacro MUI_FUNCTION_DESCRIPTION_END
555
556
557 #--------------------------------
558 # Installer initialization
559
560 !macro PRINTER_INIT
561
562   ${If} ${AtLeastWinVista}
563     StrCpy $PrinterConf "printui.exe"
564   ${Else}
565     StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
566   ${EndIf}
567
568 !macroend
569
570 # .onInit must be here after the section definition because we have to set
571 # the selection states of the dictionary sections
572 Function .onInit
573
574   ${IfNot} ${IsNT}
575   ${OrIfNot} ${AtLeastWinXP}
576     MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
577     Quit
578   ${EndIf}
579   
580   # check that the installer is not currently running
581   System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
582   Pop $R0
583   ${if} $R0 != "0"
584    MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
585    Abort
586   ${endif}
587   System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
588   Pop $R0
589   ${if} $R0 != "0"
590    MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
591    Abort
592   ${endif}
593
594   !insertmacro MULTIUSER_INIT
595   
596   # check if this LyX version is already installed
597   ${if} $MultiUser.Privileges == "Admin"
598   ${orif} $MultiUser.Privileges == "Power"
599    ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
600   ${else}
601    ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
602    # handle also the case that LyX is already installed in HKLM
603    ${if} $0 == ""
604     ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
605    ${endif}
606   ${endif}
607   ${if} $0 != ""
608    MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
609    Abort
610   ${endif}
611   
612   # check if there is an existing LyX installation of the same LyX series
613   # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
614   IntOp $4 ${APP_VERSION_REVISION} + 20
615   ${for} $5 0 $4
616    ${if} $MultiUser.Privileges == "Admin"
617    ${orif} $MultiUser.Privileges == "Power"
618     ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
619     # also check for an emergency release
620     ${if} $0 == ""
621      ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
622     ${endif}
623    ${else}
624     ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
625     # also check for an emergency release
626     ${if} $0 == ""
627      ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
628     ${endif}
629    ${endif}
630    ${if} $0 != ""
631     StrCpy $R5 $0 # store the read version number
632     StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
633     # we don't stop here because we want the latest installed version
634    ${endif} 
635   ${next}
636   ${if} $OldVersionNumber > ${APP_SERIES_KEY}
637    # store the version number and reformat it temporarily for the error message
638    StrCpy $R0 $OldVersionNumber
639    StrCpy $OldVersionNumber $R5
640    MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
641    StrCpy $OldVersionNumber $R0
642    Abort
643   ${endif}
644
645   !insertmacro PRINTER_INIT
646   
647   # this can be reset to "true" in section SecDesktop
648   StrCpy $CreateDesktopIcon "false"
649   StrCpy $CreateFileAssociations "false"
650  
651   ${IfNot} ${Silent}
652     # Show banner while installer is intializating 
653     Banner::show /NOUNLOAD "Checking system"
654   ${EndIf}
655  
656   Call SearchExternal
657   
658   !if ${SETUPTYPE} == BUNDLE
659    # don't let the installer sections appear when the programs are already installed
660    ${if} $PathBibTeXEditor != ""
661     SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
662    ${endif}
663   !endif
664   
665   # select sections of already installed spell-checker dictionaries, make them read-only
666   # and set the necessary size to 0 bytes
667   StrCpy $String $FoundDict
668   StrCpy $Search "af_ZA"
669   Call StrPoint # function from LyXUtils.nsh
670   ${if} $Pointer != "-1"
671    IntOp $0 ${SF_SELECTED} | ${SF_RO}
672    SectionSetFlags ${SecDAfrikaans} $0
673    SectionSetSize ${SecDAfrikaans} 0
674   ${endif}
675   StrCpy $Search "ar_DZ"
676   Call StrPoint
677   ${if} $Pointer != "-1"
678    IntOp $0 ${SF_SELECTED} | ${SF_RO}
679    SectionSetFlags ${SecDArabic} $0
680    SectionSetSize ${SecDArabic} 0
681   ${endif}
682   StrCpy $Search "hy_AM"
683   Call StrPoint
684   ${if} $Pointer != "-1"
685    IntOp $0 ${SF_SELECTED} | ${SF_RO}
686    SectionSetFlags ${SecDArmenian} $0
687    SectionSetSize ${SecDArmenian} 0
688   ${endif}
689   StrCpy $Search "id_ID"
690   Call StrPoint
691   ${if} $Pointer != "-1"
692    IntOp $0 ${SF_SELECTED} | ${SF_RO}
693    SectionSetFlags ${SecDIndonesian} $0
694    SectionSetSize ${SecDIndonesian} 0
695   ${endif}
696   StrCpy $Search "ms_MY"
697   Call StrPoint
698   ${if} $Pointer != "-1"
699    IntOp $0 ${SF_SELECTED} | ${SF_RO}
700    SectionSetFlags ${SecDMalayan} $0
701    SectionSetSize ${SecDMalayan} 0
702   ${endif}
703   StrCpy $Search "be_BY"
704   Call StrPoint
705   ${if} $Pointer != "-1"
706    IntOp $0 ${SF_SELECTED} | ${SF_RO}
707    SectionSetFlags ${SecDBelarusian} $0
708    SectionSetSize ${SecDBelarusian} 0
709   ${endif}
710   StrCpy $Search "br_FR"
711   Call StrPoint
712   ${if} $Pointer != "-1"
713    IntOp $0 ${SF_SELECTED} | ${SF_RO}
714    SectionSetFlags ${SecDBreton} $0
715    SectionSetSize ${SecDBreton} 0
716   ${endif}
717   StrCpy $Search "bg_BG"
718   Call StrPoint
719   ${if} $Pointer != "-1"
720    IntOp $0 ${SF_SELECTED} | ${SF_RO}
721    SectionSetFlags ${SecDBulgarian} $0
722    SectionSetSize ${SecDBulgarian} 0
723   ${endif}
724   StrCpy $Search "ca_ES"
725   Call StrPoint
726   ${if} $Pointer != "-1"
727    IntOp $0 ${SF_SELECTED} | ${SF_RO}
728    SectionSetFlags ${SecDCatalanian} $0
729    SectionSetSize ${SecDCatalanian} 0
730   ${endif}
731   StrCpy $Search "cs_CZ"
732   Call StrPoint
733   ${if} $Pointer != "-1"
734    IntOp $0 ${SF_SELECTED} | ${SF_RO}
735    SectionSetFlags ${SecDCzech} $0
736    SectionSetSize ${SecDCzech} 0
737   ${endif}
738  
739   StrCpy $Search "cop_EG"
740   Call StrPoint
741   ${if} $Pointer != "-1"
742    IntOp $0 ${SF_SELECTED} | ${SF_RO}
743   # enable this for LyX 2.1!
744   # SectionSetFlags ${SecDCoptic} $0
745   # SectionSetSize ${SecDCoptic} 0
746   ${endif}
747   StrCpy $Search "cy_GB"
748   Call StrPoint
749   ${if} $Pointer != "-1"
750    IntOp $0 ${SF_SELECTED} | ${SF_RO}
751    SectionSetFlags ${SecDWelsh} $0
752    SectionSetSize ${SecDWelsh} 0
753   ${endif}
754   StrCpy $Search "da_DK"
755   Call StrPoint
756   ${if} $Pointer != "-1"
757    IntOp $0 ${SF_SELECTED} | ${SF_RO}
758    SectionSetFlags ${SecDDanish} $0
759    SectionSetSize ${SecDDanish} 0
760   ${endif}
761   StrCpy $Search "de_AT"
762   Call StrPoint
763   ${if} $Pointer != "-1"
764    IntOp $0 ${SF_SELECTED} | ${SF_RO}
765    SectionSetFlags ${SecDGermanAT} $0
766    SectionSetSize ${SecDGermanAT} 0
767   ${endif}
768   StrCpy $Search "de_CH"
769   Call StrPoint
770   ${if} $Pointer != "-1"
771    IntOp $0 ${SF_SELECTED} | ${SF_RO}
772    SectionSetFlags ${SecDGermanCH} $0
773    SectionSetSize ${SecDGermanCH} 0
774   ${endif}
775   StrCpy $Search "de_DE"
776   Call StrPoint
777   ${if} $Pointer != "-1"
778    IntOp $0 ${SF_SELECTED} | ${SF_RO}
779    SectionSetFlags ${SecDGermanD} $0
780    SectionSetSize ${SecDGermanD} 0
781   ${endif}
782   StrCpy $Search "el_GR"
783   Call StrPoint
784   ${if} $Pointer != "-1"
785    IntOp $0 ${SF_SELECTED} | ${SF_RO}
786    SectionSetFlags ${SecDGreek} $0
787    SectionSetSize ${SecDGreek} 0
788   ${endif}
789   StrCpy $Search "et_EE"
790   Call StrPoint
791   ${if} $Pointer != "-1"
792    IntOp $0 ${SF_SELECTED} | ${SF_RO}
793    SectionSetFlags ${SecDEstonian} $0
794    SectionSetSize ${SecDEstonian} 0
795   ${endif}
796   StrCpy $Search "en_AU"
797   Call StrPoint
798   ${if} $Pointer != "-1"
799    IntOp $0 ${SF_SELECTED} | ${SF_RO}
800  # enable this for LyX 2.1!
801  #  SectionSetFlags ${SecDEnglishAU} $0
802  #  SectionSetSize ${SecDEnglishAU} 0
803   ${endif}
804   StrCpy $Search "en_CA"
805   Call StrPoint
806   ${if} $Pointer != "-1"
807    IntOp $0 ${SF_SELECTED} | ${SF_RO}
808    SectionSetFlags ${SecDEnglishCA} $0
809    SectionSetSize ${SecDEnglishCA} 0
810   ${endif}
811   StrCpy $Search "en_GB"
812   Call StrPoint
813   ${if} $Pointer != "-1"
814    IntOp $0 ${SF_SELECTED} | ${SF_RO}
815    SectionSetFlags ${SecDEnglishGB} $0
816    SectionSetSize ${SecDEnglishGB} 0
817   ${endif}
818   StrCpy $Search "en_NZ"
819   Call StrPoint
820   ${if} $Pointer != "-1"
821    IntOp $0 ${SF_SELECTED} | ${SF_RO}
822  # enable this for LyX 2.1!
823  #  SectionSetFlags ${SecDEnglishNZ} $0
824  #  SectionSetSize ${SecDEnglishNZ} 0
825   ${endif}
826   StrCpy $Search "en_US"
827   Call StrPoint
828   ${if} $Pointer != "-1"
829    IntOp $0 ${SF_SELECTED} | ${SF_RO}
830    SectionSetFlags ${SecDEnglishUS} $0
831    SectionSetSize ${SecDEnglishUS} 0
832   ${endif}
833   StrCpy $Search "es_ES"
834   Call StrPoint
835   ${if} $Pointer != "-1"
836    IntOp $0 ${SF_SELECTED} | ${SF_RO}
837    SectionSetFlags ${SecDSpanishES} $0
838    SectionSetSize ${SecDSpanishES} 0
839   ${endif}
840   StrCpy $Search "es_MX"
841   Call StrPoint
842   ${if} $Pointer != "-1"
843    IntOp $0 ${SF_SELECTED} | ${SF_RO}
844    SectionSetFlags ${SecDSpanishMX} $0
845    SectionSetSize ${SecDSpanishMX} 0
846   ${endif}
847   StrCpy $Search "eo_EO"
848   Call StrPoint
849   ${if} $Pointer != "-1"
850    IntOp $0 ${SF_SELECTED} | ${SF_RO}
851    SectionSetFlags ${SecDEsperanto} $0
852    SectionSetSize ${SecDEsperanto} 0
853   ${endif}
854   StrCpy $Search "eu_ES"
855   Call StrPoint
856   ${if} $Pointer != "-1"
857    IntOp $0 ${SF_SELECTED} | ${SF_RO}
858    SectionSetFlags ${SecDBasque} $0
859    SectionSetSize ${SecDBasque} 0
860   ${endif}
861   StrCpy $Search "fa_IR"
862   Call StrPoint
863   ${if} $Pointer != "-1"
864    IntOp $0 ${SF_SELECTED} | ${SF_RO}
865    SectionSetFlags ${SecDFarsi} $0
866    SectionSetSize ${SecDFarsi} 0
867   ${endif}
868   StrCpy $Search "fr_FR"
869   Call StrPoint
870   ${if} $Pointer != "-1"
871    IntOp $0 ${SF_SELECTED} | ${SF_RO}
872    SectionSetFlags ${SecDFrench} $0
873    SectionSetSize ${SecDFrench} 0
874   ${endif}
875   StrCpy $Search "ga_IR"
876   Call StrPoint
877   ${if} $Pointer != "-1"
878    IntOp $0 ${SF_SELECTED} | ${SF_RO}
879    SectionSetFlags ${SecDGaelic} $0
880    SectionSetSize ${SecDGaelic} 0
881   ${endif}
882   StrCpy $Search "gd_GB"
883   Call StrPoint
884   ${if} $Pointer != "-1"
885    IntOp $0 ${SF_SELECTED} | ${SF_RO}
886    SectionSetFlags ${SecDScottish} $0
887    SectionSetSize ${SecDScottish} 0
888   ${endif}
889   StrCpy $Search "gl_ES"
890   Call StrPoint
891   ${if} $Pointer != "-1"
892    IntOp $0 ${SF_SELECTED} | ${SF_RO}
893    SectionSetFlags ${SecDGalician} $0
894    SectionSetSize ${SecDGalician} 0
895   ${endif}
896   StrCpy $Search "he_IL"
897   Call StrPoint
898   ${if} $Pointer != "-1"
899    IntOp $0 ${SF_SELECTED} | ${SF_RO}
900    SectionSetFlags ${SecDHebrew} $0
901    SectionSetSize ${SecDHebrew} 0
902   ${endif}
903   StrCpy $Search "hi_IN"
904   Call StrPoint
905   ${if} $Pointer != "-1"
906    IntOp $0 ${SF_SELECTED} | ${SF_RO}
907  # enable this for LyX 2.1! 
908   # SectionSetFlags ${SecDHindi} $0
909   # SectionSetSize ${SecDHindi} 0
910   ${endif}
911   StrCpy $Search "hr_HR"
912   Call StrPoint
913   ${if} $Pointer != "-1"
914    IntOp $0 ${SF_SELECTED} | ${SF_RO}
915    SectionSetFlags ${SecDCroatian} $0
916    SectionSetSize ${SecDCroatian} 0
917   ${endif}
918   StrCpy $Search "hu_HU"
919   Call StrPoint
920   ${if} $Pointer != "-1"
921    IntOp $0 ${SF_SELECTED} | ${SF_RO}
922    SectionSetFlags ${SecDHungarian} $0
923    SectionSetSize ${SecDHungarian} 0
924   ${endif}
925   StrCpy $Search "ia_IA"
926   Call StrPoint
927   ${if} $Pointer != "-1"
928    IntOp $0 ${SF_SELECTED} | ${SF_RO}
929    SectionSetFlags ${SecDInterlingua} $0
930    SectionSetSize ${SecDInterlingua} 0
931   ${endif}
932   StrCpy $Search "is_IS"
933   Call StrPoint
934   ${if} $Pointer != "-1"
935    IntOp $0 ${SF_SELECTED} | ${SF_RO}
936    SectionSetFlags ${SecDIcelandic} $0
937    SectionSetSize ${SecDIcelandic} 0
938   ${endif}
939   StrCpy $Search "it_IT"
940   Call StrPoint
941   ${if} $Pointer != "-1"
942    IntOp $0 ${SF_SELECTED} | ${SF_RO}
943    SectionSetFlags ${SecDItalian} $0
944    SectionSetSize ${SecDItalian} 0
945   ${endif}
946   StrCpy $Search "kk_KZ"
947   Call StrPoint
948   ${if} $Pointer != "-1"
949    IntOp $0 ${SF_SELECTED} | ${SF_RO}
950    SectionSetFlags ${SecDKazakh} $0
951    SectionSetSize ${SecDKazakh} 0
952   ${endif}
953   StrCpy $Search "ko_KR"
954   Call StrPoint
955   ${if} $Pointer != "-1"
956    IntOp $0 ${SF_SELECTED} | ${SF_RO}
957    SectionSetFlags ${SecDKorean} $0
958    SectionSetSize ${SecDKorean} 0
959   ${endif}
960   StrCpy $Search "la_LA"
961   Call StrPoint
962   ${if} $Pointer != "-1"
963    IntOp $0 ${SF_SELECTED} | ${SF_RO}
964    SectionSetFlags ${SecDLatin} $0
965    SectionSetSize ${SecDLatin} 0
966   ${endif}
967   StrCpy $Search "lt_LT"
968   Call StrPoint
969   ${if} $Pointer != "-1"
970    IntOp $0 ${SF_SELECTED} | ${SF_RO}
971    SectionSetFlags ${SecDLithuanian} $0
972    SectionSetSize ${SecDLithuanian} 0
973   ${endif}
974   StrCpy $Search "lv_LV"
975   Call StrPoint
976   ${if} $Pointer != "-1"
977    IntOp $0 ${SF_SELECTED} | ${SF_RO}
978    SectionSetFlags ${SecDLatvian} $0
979    SectionSetSize ${SecDLatvian} 0
980   ${endif}
981   StrCpy $Search "nl_NL"
982   Call StrPoint
983   ${if} $Pointer != "-1"
984    IntOp $0 ${SF_SELECTED} | ${SF_RO}
985    SectionSetFlags ${SecDDutch} $0
986    SectionSetSize ${SecDDutch} 0
987   ${endif}
988   StrCpy $Search "nb_NO"
989   Call StrPoint
990   ${if} $Pointer != "-1"
991    IntOp $0 ${SF_SELECTED} | ${SF_RO}
992    SectionSetFlags ${SecDNorwegianNB} $0
993    SectionSetSize ${SecDNorwegianNB} 0
994   ${endif}
995   StrCpy $Search "nn_NO"
996   Call StrPoint
997   ${if} $Pointer != "-1"
998    IntOp $0 ${SF_SELECTED} | ${SF_RO}
999    SectionSetFlags ${SecDNorwegianNN} $0
1000    SectionSetSize ${SecDNorwegianNN} 0
1001   ${endif}
1002   StrCpy $Search "oc_FR"
1003   Call StrPoint
1004   ${if} $Pointer != "-1"
1005    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1006  # enable this for LyX 2.1!  
1007   # SectionSetFlags ${SecDOccitan} $0
1008   # SectionSetSize ${SecDOccitan} 0
1009   ${endif}
1010   StrCpy $Search "pl_PL"
1011   Call StrPoint
1012   ${if} $Pointer != "-1"
1013    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1014    SectionSetFlags ${SecDPolish} $0
1015    SectionSetSize ${SecDPolish} 0
1016   ${endif}
1017   StrCpy $Search "pt_BR"
1018   Call StrPoint
1019   ${if} $Pointer != "-1"
1020    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1021    SectionSetFlags ${SecDPortugueseBR} $0
1022    SectionSetSize ${SecDPortugueseBR} 0
1023   ${endif}
1024   StrCpy $Search "pt_PT"
1025   Call StrPoint
1026   ${if} $Pointer != "-1"
1027    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1028    SectionSetFlags ${SecDPortuguesePT} $0
1029    SectionSetSize ${SecDPortuguesePT} 0
1030   ${endif}
1031   StrCpy $Search "ro_RO"
1032   Call StrPoint
1033   ${if} $Pointer != "-1"
1034    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1035    SectionSetFlags ${SecDRomanian} $0
1036    SectionSetSize ${SecDRomanian} 0
1037   ${endif}
1038   StrCpy $Search "ru_RU"
1039   Call StrPoint
1040   ${if} $Pointer != "-1"
1041    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1042    SectionSetFlags ${SecDRussian} $0
1043    SectionSetSize ${SecDRussian} 0
1044   ${endif}
1045   StrCpy $Search "dsb_DE"
1046   Call StrPoint
1047   ${if} $Pointer != "-1"
1048    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1049    SectionSetFlags ${SecDSorbianD} $0
1050    SectionSetSize ${SecDSorbianD} 0
1051   ${endif}
1052   StrCpy $Search "hsb_DE"
1053   Call StrPoint
1054   ${if} $Pointer != "-1"
1055    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1056    SectionSetFlags ${SecDSorbianH} $0
1057    SectionSetSize ${SecDSorbianH} 0
1058   ${endif}
1059   StrCpy $Search "sq_AL"
1060   Call StrPoint
1061   ${if} $Pointer != "-1"
1062    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1063    SectionSetFlags ${SecDAlbanian} $0
1064    SectionSetSize ${SecDAlbanian} 0
1065   ${endif}
1066   StrCpy $Search "sl_SI"
1067   Call StrPoint
1068   ${if} $Pointer != "-1"
1069    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1070    SectionSetFlags ${SecDSlovenian} $0
1071    SectionSetSize ${SecDSlovenian} 0
1072   ${endif}
1073   StrCpy $Search "sk_SK"
1074   Call StrPoint
1075   ${if} $Pointer != "-1"
1076    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1077    SectionSetFlags ${SecDSlovakian} $0
1078    SectionSetSize ${SecDSlovakian} 0
1079   ${endif}
1080   StrCpy $Search "sr_RS"
1081   Call StrPoint
1082   ${if} $Pointer != "-1"
1083    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1084    SectionSetFlags ${SecDSerbian} $0
1085    SectionSetSize ${SecDSerbian} 0
1086   ${endif}
1087   StrCpy $Search "sv_SE"
1088   Call StrPoint
1089   ${if} $Pointer != "-1"
1090    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1091    SectionSetFlags ${SecDSwedish} $0
1092    SectionSetSize ${SecDSwedish} 0
1093   ${endif}
1094   StrCpy $Search "ta_IN"
1095   Call StrPoint
1096   ${if} $Pointer != "-1"
1097    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1098  # enable this for LyX 2.1!
1099   # SectionSetFlags ${SecDTamil} $0
1100   # SectionSetSize ${SecDTamil} 0
1101   ${endif}
1102   StrCpy $Search "te_IN"
1103   Call StrPoint
1104   ${if} $Pointer != "-1"
1105    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1106  # enable this for LyX 2.1!
1107   # SectionSetFlags ${SecDTelugu} $0
1108   # SectionSetSize ${SecDTelugu} 0
1109   ${endif}
1110   StrCpy $Search "th_TH"
1111   Call StrPoint
1112   ${if} $Pointer != "-1"
1113    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1114    SectionSetFlags ${SecDThai} $0
1115    SectionSetSize ${SecDThai} 0
1116   ${endif}
1117   StrCpy $Search "uk_UA"
1118   Call StrPoint
1119   ${if} $Pointer != "-1"
1120    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1121    SectionSetFlags ${SecDUkrainian} $0
1122    SectionSetSize ${SecDUkrainian} 0
1123   ${endif}
1124   StrCpy $Search "ur_PK"
1125   Call StrPoint
1126   ${if} $Pointer != "-1"
1127    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1128  # enable this for LyX 2.1!
1129   # SectionSetFlags ${SecDUrdu} $0
1130   # SectionSetSize ${SecDUrdu} 0
1131   ${endif}
1132   StrCpy $Search "vi_VN"
1133   Call StrPoint
1134   ${if} $Pointer != "-1"
1135    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1136    SectionSetFlags ${SecDVietnamese} $0
1137    SectionSetSize ${SecDVietnamese} 0
1138   ${endif}
1139   
1140   # select sections of already installed thesaurus dictionaries, make them read-only
1141   # and set the necessary size to 0 bytes
1142   StrCpy $String $FoundThes
1143   StrCpy $Search "bg_BG"
1144   Call StrPoint # function from LyXUtils.nsh
1145   ${if} $Pointer != "-1"
1146    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1147    SectionSetFlags ${SecTBulgarian} $0
1148    SectionSetSize ${SecTBulgarian} 0
1149   ${endif}
1150   StrCpy $Search "ca_ES"
1151   Call StrPoint
1152   ${if} $Pointer != "-1"
1153    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1154    SectionSetFlags ${SecTCatalan} $0
1155    SectionSetSize ${SecTCatalan} 0
1156   ${endif}
1157   StrCpy $Search "cs_CZ"
1158   Call StrPoint
1159   ${if} $Pointer != "-1"
1160    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1161    SectionSetFlags ${SecTCzech} $0
1162    SectionSetSize ${SecTCzech} 0
1163   ${endif}
1164   StrCpy $Search "da_DK"
1165   Call StrPoint
1166   ${if} $Pointer != "-1"
1167    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1168    SectionSetFlags ${SecTDanish} $0
1169    SectionSetSize ${SecTDanish} 0
1170   ${endif}
1171   StrCpy $Search "de_DE"
1172   Call StrPoint
1173   ${if} $Pointer != "-1"
1174    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1175    SectionSetFlags ${SecTGermanDA} $0
1176    SectionSetSize ${SecTGermanDA} 0
1177   ${endif} 
1178   StrCpy $Search "de_CH"
1179   Call StrPoint
1180   ${if} $Pointer != "-1"
1181    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1182    SectionSetFlags ${SecTGermanCH} $0
1183    SectionSetSize ${SecTGermanCH} 0
1184   ${endif}
1185   StrCpy $Search "en_GB"
1186   Call StrPoint
1187   ${if} $Pointer != "-1"
1188    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1189    SectionSetFlags ${SecTEnglishGB} $0
1190    SectionSetSize ${SecTEnglishGB} 0
1191   ${endif} 
1192   StrCpy $Search "en_US"
1193   Call StrPoint
1194   ${if} $Pointer != "-1"
1195    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1196    SectionSetFlags ${SecTEnglishUSAU} $0
1197    SectionSetSize ${SecTEnglishUSAU} 0
1198   ${endif}
1199   StrCpy $Search "es_ES"
1200   Call StrPoint
1201   ${if} $Pointer != "-1"
1202    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1203    SectionSetFlags ${SecTSpanish} $0
1204    SectionSetSize ${SecTSpanish} 0
1205   ${endif}
1206   StrCpy $Search "fr_FR"
1207   Call StrPoint
1208   ${if} $Pointer != "-1"
1209    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1210    SectionSetFlags ${SecTFrench} $0
1211    SectionSetSize ${SecTFrench} 0
1212   ${endif}
1213   StrCpy $Search "ga_IR"
1214   Call StrPoint
1215   ${if} $Pointer != "-1"
1216    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1217    SectionSetFlags ${SecTGaelic} $0
1218    SectionSetSize ${SecTGaelic} 0
1219   ${endif}
1220   StrCpy $Search "el_GR"
1221   Call StrPoint
1222   ${if} $Pointer != "-1"
1223    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1224    SectionSetFlags ${SecTGreek} $0
1225    SectionSetSize ${SecTGreek} 0
1226   ${endif}
1227   StrCpy $Search "it_IT"
1228   Call StrPoint
1229   ${if} $Pointer != "-1"
1230    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1231    SectionSetFlags ${SecTItalian} $0
1232    SectionSetSize ${SecTItalian} 0
1233   ${endif}
1234   StrCpy $Search "hu_HU"
1235   Call StrPoint
1236   ${if} $Pointer != "-1"
1237    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1238    SectionSetFlags ${SecTHungarian} $0
1239    SectionSetSize ${SecTHungarian} 0
1240   ${endif}
1241   StrCpy $Search "nb_NO"
1242   Call StrPoint
1243   ${if} $Pointer != "-1"
1244    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1245    SectionSetFlags ${SecTNorwegianNB} $0
1246    SectionSetSize ${SecTNorwegianNB} 0
1247   ${endif}
1248   StrCpy $Search "pl_PL"
1249   Call StrPoint
1250   ${if} $Pointer != "-1"
1251    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1252    SectionSetFlags ${SecTPolish} $0
1253    SectionSetSize ${SecTPolish} 0
1254   ${endif}
1255   StrCpy $Search "pt_PT"
1256   Call StrPoint
1257   ${if} $Pointer != "-1"
1258    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1259    SectionSetFlags ${SecTPortuguese} $0
1260    SectionSetSize ${SecTPortuguese} 0
1261   ${endif}
1262   StrCpy $Search "ro_RO"
1263   Call StrPoint
1264   ${if} $Pointer != "-1"
1265    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1266    SectionSetFlags ${SecTRomanian} $0
1267    SectionSetSize ${SecTRomanian} 0
1268   ${endif}
1269   StrCpy $Search "ru_RU"
1270   Call StrPoint
1271   ${if} $Pointer != "-1"
1272    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1273    SectionSetFlags ${SecTRussian} $0
1274    SectionSetSize ${SecTRussian} 0
1275   ${endif}
1276   StrCpy $Search "sl_SI"
1277   Call StrPoint
1278   ${if} $Pointer != "-1"
1279    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1280    SectionSetFlags ${SecTSlovenian} $0
1281    SectionSetSize ${SecTSlovenian} 0
1282   ${endif}
1283   StrCpy $Search "sk_SK"
1284   Call StrPoint
1285   ${if} $Pointer != "-1"
1286    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1287    SectionSetFlags ${SecTSlovakian} $0
1288    SectionSetSize ${SecTSlovakian} 0
1289   ${endif}
1290   StrCpy $Search "sv_SE"
1291   Call StrPoint
1292   ${if} $Pointer != "-1"
1293    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1294    SectionSetFlags ${SecTSwedish} $0
1295    SectionSetSize ${SecTSwedish} 0
1296   ${endif}*/
1297   
1298   ${IfNot} ${Silent}
1299     Banner::destroy
1300   ${EndIf}
1301
1302 FunctionEnd
1303
1304 # this function is called at first after starting the uninstaller
1305 Function un.onInit
1306
1307   !insertmacro PRINTER_INIT
1308   !insertmacro MULTIUSER_UNINIT
1309
1310   # Check that LyX is not currently running
1311   FindProcDLL::FindProc "lyx.exe"
1312   ${if} $R0 == "1"
1313    MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1314    Abort
1315   ${endif}
1316
1317   # set registry root key
1318   ${if} $MultiUser.Privileges == "Admin"
1319   ${orif} $MultiUser.Privileges == "Power"
1320     SetShellVarContext all
1321   ${else}
1322    SetShellVarContext current
1323   ${endif}
1324
1325   # Ascertain whether the user has sufficient privileges to uninstall.
1326   # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1327   ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1328   ${if} $0 != ""
1329   ${andif} $MultiUser.Privileges != "Admin"
1330   ${andif} $MultiUser.Privileges != "Power"
1331    MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1332    Abort
1333   ${endif}
1334   # warning when LyX couldn't be found in the registry
1335   ${if} $0 == "" # check in HKCU
1336    ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1337    ${if} $0 == ""
1338      MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1339    ${endif}
1340   ${endif}
1341   
1342   # Macro to investigate name of LyX's preferences folders to be able remove them
1343   !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1344
1345   # test if MiKTeX was installed together with LyX
1346   ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1347   ${if} $0 == "Yes${APP_SERIES_KEY}"
1348    SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1349    StrCpy $LaTeXInstalled "MiKTeX"
1350   ${else}
1351    SectionSetText 2 "" # hides the corresponding uninstaller section
1352   ${endif}
1353   
1354   # test if JabRef was installed together with LyX
1355   ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1356   ${if} $0 == "Yes${APP_SERIES_KEY}"
1357    SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1358    StrCpy $JabRefInstalled "Yes"
1359   ${else}
1360    SectionSetText 3 "" # hides the corresponding uninstaller section
1361   ${endif}
1362
1363   # question message if the user really wants to uninstall LyX
1364   MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes
1365   Abort
1366
1367 FunctionEnd
1368