]> git.lyx.org Git - lyx.git/blob - development/Win32/packaging/installer/include/init.nsh
installer: support emergency releases of LyX
[lyx.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 11000
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 15200
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 Section /o "Nederlands" SecDDutch
308  StrCpy $DictCodes "nl_NL,$DictCodes"
309  AddSize 1820
310 SectionEnd
311
312 Section /o "Norsk (Bokmål)" SecDNorwegianNB
313  StrCpy $DictCodes "nb_NO,$DictCodes"
314  AddSize 4890
315 SectionEnd
316
317 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
318  StrCpy $DictCodes "nn_NO,$DictCodes"
319  AddSize 2890
320 SectionEnd
321
322 # enable this for LyX 2.1!
323 #Section /o "Occitan" SecDOccitan
324 # StrCpy $DictCodes "oc_FR,$DictCodes"
325 # AddSize 31710
326 #SectionEnd
327
328 Section /o "Polski" SecDPolish
329  StrCpy $DictCodes "pl_PL,$DictCodes"
330  AddSize 4540
331 SectionEnd
332
333 Section /o "Português (BR)" SecDPortugueseBR
334  StrCpy $DictCodes "pt_BR,$DictCodes"
335  AddSize 5280
336 SectionEnd
337
338 Section /o "Português (PT)" SecDPortuguesePT
339  StrCpy $DictCodes "pt_PT,$DictCodes"
340  AddSize 1460
341 SectionEnd
342
343 Section /o "Româna" SecDRomanian
344  StrCpy $DictCodes "ro_RO,$DictCodes"
345  AddSize 1930
346 SectionEnd
347
348 Section /o "Russian" SecDRussian
349  StrCpy $DictCodes "ru_RU,$DictCodes"
350  AddSize 1920
351 SectionEnd
352
353 Section /o "Serb\9acina (Dolno)" SecDSorbianD
354  StrCpy $DictCodes "dsb_DE,$DictCodes"
355  AddSize 904
356 SectionEnd
357
358 Section /o "Serb\9acina (Horno)" SecDSorbianH
359  StrCpy $DictCodes "hsb_DE,$DictCodes"
360  AddSize 740
361 SectionEnd
362
363 Section /o "Shqipe" SecDAlbanian
364  StrCpy $DictCodes "sq_AL,$DictCodes"
365  AddSize 2400
366 SectionEnd
367
368 Section /o "Sloven\9acina" SecDSlovenian
369  StrCpy $DictCodes "sl_SI,$DictCodes"
370  AddSize 2910
371 SectionEnd
372
373 Section /o "Slovenský" SecDSlovakian
374  StrCpy $DictCodes "sk_SK,$DictCodes"
375  AddSize 4090
376 SectionEnd
377
378 Section /o "Srpski" SecDSerbian
379  StrCpy $DictCodes "sr_RS,$DictCodes"
380  AddSize 3460
381 SectionEnd
382
383 Section /o "Svenska" SecDSwedish
384  StrCpy $DictCodes "sv_SE,$DictCodes"
385  AddSize 2028
386 SectionEnd
387
388 # enable this for LyX 2.1!
389 #Section /o "Tamil" SecDTamil
390 # StrCpy $DictCodes "ta_IN,$DictCodes"
391 # AddSize 5911
392 #SectionEnd
393
394 # enable this for LyX 2.1!
395 #Section /o "Telugu" SecDTelugu
396 # StrCpy $DictCodes "te_IN,$DictCodes"
397 # AddSize 3400
398 #SectionEnd
399  
400 Section /o "Thai" SecDThai
401  StrCpy $DictCodes "th_TH,$DictCodes"
402  AddSize 351
403 SectionEnd
404
405 Section /o "Ukrainian" SecDUkrainian
406  StrCpy $DictCodes "uk_UA,$DictCodes"
407  AddSize 2620
408 SectionEnd
409
410 # enable this for LyX 2.1!
411 #Section /o "Urdu" SecDUrdu
412 # StrCpy $DictCodes "ur_PK,$DictCodes"
413 # AddSize 1401
414 #SectionEnd
415
416 Section /o "Vietnamese" SecDVietnamese
417  StrCpy $DictCodes "vi_VN,$DictCodes"
418  AddSize 40
419 SectionEnd
420
421 SectionGroupEnd
422
423
424 SectionGroup "Thesaurus" SecThesaurus
425
426 Section /o "Bulgarian" SecTBulgarian
427  StrCpy $ThesCodes "bg_BG,$ThesCodes"
428  AddSize 3020
429 SectionEnd
430
431 Section /o "Català" SecTCatalan
432  StrCpy $ThesCodes "ca_ES,$ThesCodes"
433  AddSize 731
434 SectionEnd
435
436 Section /o "Ce\9atina" SecTCzech
437  StrCpy $ThesCodes "cs_CZ,$ThesCodes"
438  AddSize 635
439 SectionEnd
440
441 Section /o "Dansk" SecTDanish
442  StrCpy $ThesCodes "da_DK,$ThesCodes"
443  AddSize 2360
444 SectionEnd
445
446 Section /o "Deutsch (D/A)" SecTGermanDA
447  StrCpy $ThesCodes "de_DE,$ThesCodes"
448  AddSize 14600
449 SectionEnd
450
451 Section /o "Deutsch (CH)" SecTGermanCH
452  StrCpy $ThesCodes "de_CH,$ThesCodes"
453  AddSize 14600
454 SectionEnd
455
456 Section /o "English (GB)" SecTEnglishGB
457  StrCpy $ThesCodes "en_GB,$ThesCodes"
458  AddSize 20600
459 SectionEnd
460
461 Section /o "English (US/AU)" SecTEnglishUSAU
462  StrCpy $ThesCodes "en_US,$ThesCodes"
463  AddSize 20600
464 SectionEnd
465
466 Section /o "Español" SecTSpanish
467  StrCpy $ThesCodes "es_ES,$ThesCodes"
468  AddSize 2860
469 SectionEnd
470
471 Section /o "Français" SecTFrench
472  StrCpy $ThesCodes "fr_FR,$ThesCodes"
473  AddSize 5060
474 SectionEnd
475
476 Section /o "Gaeilge" SecTGaelic
477  StrCpy $ThesCodes "ga_IR,$ThesCodes"
478  AddSize 30600
479 SectionEnd
480
481 Section /o "Greek" SecTGreek
482  StrCpy $ThesCodes "el_GR,$ThesCodes"
483  AddSize 903
484 SectionEnd
485
486 Section /o "Italiano" SecTItalian
487  StrCpy $ThesCodes "it_IT,$ThesCodes"
488  AddSize 2640
489 SectionEnd
490
491 Section /o "Magyar" SecTHungarian
492  StrCpy $ThesCodes "hu_HU,$ThesCodes"
493  AddSize 632
494 SectionEnd
495
496 Section /o "Norsk" SecTNorwegian
497  StrCpy $ThesCodes "no_NO,$ThesCodes"
498  AddSize 2470
499 SectionEnd
500
501 Section /o "Polski" SecTPolish
502  StrCpy $ThesCodes "pl_PL,$ThesCodes"
503  AddSize 5580
504 SectionEnd
505
506 Section /o "Português" SecTPortuguese
507  StrCpy $ThesCodes "pt_PT,$ThesCodes"
508  AddSize 855
509 SectionEnd
510
511 Section /o "Româna" SecTRomanian
512  StrCpy $ThesCodes "ro_RO,$ThesCodes"
513  AddSize 3640
514 SectionEnd
515
516 Section /o "Russian" SecTRussian
517  StrCpy $ThesCodes "ru_RU,$ThesCodes"
518  AddSize 2080
519 SectionEnd
520
521 Section /o "Sloven\9acina" SecTSlovenian
522  StrCpy $ThesCodes "sl_SI,$ThesCodes"
523  AddSize 1037
524 SectionEnd
525
526 Section /o "Slovenský" SecTSlovakian
527  StrCpy $ThesCodes "sk_SK,$ThesCodes"
528  AddSize 907
529 SectionEnd
530
531 Section /o "Svenska" SecTSwedish
532  StrCpy $ThesCodes "sv_SE,$ThesCodes"
533  AddSize 720
534 SectionEnd
535
536 SectionGroupEnd
537
538 # Section descriptions
539 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
540 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
541 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
542 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
543 !if ${SETUPTYPE} == BUNDLE
544  !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
545 !endif
546 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
547 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
548 !insertmacro MUI_FUNCTION_DESCRIPTION_END
549
550
551 #--------------------------------
552 # Installer initialization
553
554 !macro PRINTER_INIT
555
556   ${If} ${AtLeastWinVista}
557     StrCpy $PrinterConf "printui.exe"
558   ${Else}
559     StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
560   ${EndIf}
561
562 !macroend
563
564 # .onInit must be here after the section definition because we have to set
565 # the selection states of the dictionary sections
566 Function .onInit
567
568   ${IfNot} ${IsNT}
569   ${OrIfNot} ${AtLeastWinXP}
570     MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
571     Quit
572   ${EndIf}
573   
574   # check that the installer is not currently running
575   System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
576   Pop $R0
577   ${if} $R0 != "0"
578    MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
579    Abort
580   ${endif}
581   System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
582   Pop $R0
583   ${if} $R0 != "0"
584    MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
585    Abort
586   ${endif}
587
588   !insertmacro MULTIUSER_INIT
589   
590   # check if this LyX version is already installed
591   ${if} $MultiUser.Privileges == "Admin"
592   ${orif} $MultiUser.Privileges == "Power"
593    ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
594   ${else}
595    ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
596    # handle also the case that LyX is already installed in HKLM
597    ${if} $0 == ""
598     ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
599    ${endif}
600   ${endif}
601   ${if} $0 != ""
602    MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
603    Abort
604   ${endif}
605   
606   # check if there is an existing LyX installation of the same LyX series
607   # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
608   IntOp $4 ${APP_VERSION_REVISION} + 20
609   ${for} $5 0 $4
610    ${if} $MultiUser.Privileges == "Admin"
611    ${orif} $MultiUser.Privileges == "Power"
612     ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
613     # also check for an emergency release
614     ${if} $0 == ""
615      ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
616     ${endif}
617    ${else}
618     ReadRegStr $0 HKCU "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 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
622     ${endif}
623    ${endif}
624    ${if} $0 != ""
625     StrCpy $R5 $0 # store the read version number
626     StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
627     # we don't stop here because we want the latest installed version
628    ${endif} 
629   ${next}
630   ${if} $OldVersionNumber > ${APP_SERIES_KEY}
631    # store the version number and reformat it temporarily for the error message
632    StrCpy $R0 $OldVersionNumber
633    StrCpy $OldVersionNumber $R5
634    MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
635    StrCpy $OldVersionNumber $R0
636    Abort
637   ${endif}
638
639   !insertmacro PRINTER_INIT
640   
641   # this can be reset to "true" in section SecDesktop
642   StrCpy $CreateDesktopIcon "false"
643   StrCpy $CreateFileAssociations "false"
644  
645   ${IfNot} ${Silent}
646     # Show banner while installer is intializating 
647     Banner::show /NOUNLOAD "Checking system"
648   ${EndIf}
649  
650   Call SearchExternal
651   
652   !if ${SETUPTYPE} == BUNDLE
653    # don't let the installer sections appear when the programs are already installed
654    ${if} $PathBibTeXEditor != ""
655     SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
656    ${endif}
657   !endif
658   
659   # select sections of already installed spell-checker dictionaries, make them read-only
660   # and set the necessary size to 0 bytes
661   StrCpy $String $FoundDict
662   StrCpy $Search "af_ZA"
663   Call StrPoint # function from LyXUtils.nsh
664   ${if} $Pointer != "-1"
665    IntOp $0 ${SF_SELECTED} | ${SF_RO}
666    SectionSetFlags ${SecDAfrikaans} $0
667    SectionSetSize ${SecDAfrikaans} 0
668   ${endif}
669   StrCpy $Search "ar_DZ"
670   Call StrPoint
671   ${if} $Pointer != "-1"
672    IntOp $0 ${SF_SELECTED} | ${SF_RO}
673    SectionSetFlags ${SecDArabic} $0
674    SectionSetSize ${SecDArabic} 0
675   ${endif}
676   StrCpy $Search "hy_AM"
677   Call StrPoint
678   ${if} $Pointer != "-1"
679    IntOp $0 ${SF_SELECTED} | ${SF_RO}
680    SectionSetFlags ${SecDArmenian} $0
681    SectionSetSize ${SecDArmenian} 0
682   ${endif}
683   StrCpy $Search "id_ID"
684   Call StrPoint
685   ${if} $Pointer != "-1"
686    IntOp $0 ${SF_SELECTED} | ${SF_RO}
687    SectionSetFlags ${SecDIndonesian} $0
688    SectionSetSize ${SecDIndonesian} 0
689   ${endif}
690   StrCpy $Search "ms_MY"
691   Call StrPoint
692   ${if} $Pointer != "-1"
693    IntOp $0 ${SF_SELECTED} | ${SF_RO}
694    SectionSetFlags ${SecDMalayan} $0
695    SectionSetSize ${SecDMalayan} 0
696   ${endif}
697   StrCpy $Search "be_BY"
698   Call StrPoint
699   ${if} $Pointer != "-1"
700    IntOp $0 ${SF_SELECTED} | ${SF_RO}
701    SectionSetFlags ${SecDBelarusian} $0
702    SectionSetSize ${SecDBelarusian} 0
703   ${endif}
704   StrCpy $Search "br_FR"
705   Call StrPoint
706   ${if} $Pointer != "-1"
707    IntOp $0 ${SF_SELECTED} | ${SF_RO}
708    SectionSetFlags ${SecDBreton} $0
709    SectionSetSize ${SecDBreton} 0
710   ${endif}
711   StrCpy $Search "bg_BG"
712   Call StrPoint
713   ${if} $Pointer != "-1"
714    IntOp $0 ${SF_SELECTED} | ${SF_RO}
715    SectionSetFlags ${SecDBulgarian} $0
716    SectionSetSize ${SecDBulgarian} 0
717   ${endif}
718   StrCpy $Search "ca_ES"
719   Call StrPoint
720   ${if} $Pointer != "-1"
721    IntOp $0 ${SF_SELECTED} | ${SF_RO}
722    SectionSetFlags ${SecDCatalanian} $0
723    SectionSetSize ${SecDCatalanian} 0
724   ${endif}
725   StrCpy $Search "cs_CZ"
726   Call StrPoint
727   ${if} $Pointer != "-1"
728    IntOp $0 ${SF_SELECTED} | ${SF_RO}
729    SectionSetFlags ${SecDCzech} $0
730    SectionSetSize ${SecDCzech} 0
731   ${endif}
732  
733   StrCpy $Search "cop_EG"
734   Call StrPoint
735   ${if} $Pointer != "-1"
736    IntOp $0 ${SF_SELECTED} | ${SF_RO}
737   # enable this for LyX 2.1!
738   # SectionSetFlags ${SecDCoptic} $0
739   # SectionSetSize ${SecDCoptic} 0
740   ${endif}
741   StrCpy $Search "cy_GB"
742   Call StrPoint
743   ${if} $Pointer != "-1"
744    IntOp $0 ${SF_SELECTED} | ${SF_RO}
745    SectionSetFlags ${SecDWelsh} $0
746    SectionSetSize ${SecDWelsh} 0
747   ${endif}
748   StrCpy $Search "da_DK"
749   Call StrPoint
750   ${if} $Pointer != "-1"
751    IntOp $0 ${SF_SELECTED} | ${SF_RO}
752    SectionSetFlags ${SecDDanish} $0
753    SectionSetSize ${SecDDanish} 0
754   ${endif}
755   StrCpy $Search "de_AT"
756   Call StrPoint
757   ${if} $Pointer != "-1"
758    IntOp $0 ${SF_SELECTED} | ${SF_RO}
759    SectionSetFlags ${SecDGermanAT} $0
760    SectionSetSize ${SecDGermanAT} 0
761   ${endif}
762   StrCpy $Search "de_CH"
763   Call StrPoint
764   ${if} $Pointer != "-1"
765    IntOp $0 ${SF_SELECTED} | ${SF_RO}
766    SectionSetFlags ${SecDGermanCH} $0
767    SectionSetSize ${SecDGermanCH} 0
768   ${endif}
769   StrCpy $Search "de_DE"
770   Call StrPoint
771   ${if} $Pointer != "-1"
772    IntOp $0 ${SF_SELECTED} | ${SF_RO}
773    SectionSetFlags ${SecDGermanD} $0
774    SectionSetSize ${SecDGermanD} 0
775   ${endif}
776   StrCpy $Search "el_GR"
777   Call StrPoint
778   ${if} $Pointer != "-1"
779    IntOp $0 ${SF_SELECTED} | ${SF_RO}
780    SectionSetFlags ${SecDGreek} $0
781    SectionSetSize ${SecDGreek} 0
782   ${endif}
783   StrCpy $Search "et_EE"
784   Call StrPoint
785   ${if} $Pointer != "-1"
786    IntOp $0 ${SF_SELECTED} | ${SF_RO}
787    SectionSetFlags ${SecDEstonian} $0
788    SectionSetSize ${SecDEstonian} 0
789   ${endif}
790   StrCpy $Search "en_AU"
791   Call StrPoint
792   ${if} $Pointer != "-1"
793    IntOp $0 ${SF_SELECTED} | ${SF_RO}
794  # enable this for LyX 2.1!
795  #  SectionSetFlags ${SecDEnglishAU} $0
796  #  SectionSetSize ${SecDEnglishAU} 0
797   ${endif}
798   StrCpy $Search "en_CA"
799   Call StrPoint
800   ${if} $Pointer != "-1"
801    IntOp $0 ${SF_SELECTED} | ${SF_RO}
802    SectionSetFlags ${SecDEnglishCA} $0
803    SectionSetSize ${SecDEnglishCA} 0
804   ${endif}
805   StrCpy $Search "en_GB"
806   Call StrPoint
807   ${if} $Pointer != "-1"
808    IntOp $0 ${SF_SELECTED} | ${SF_RO}
809    SectionSetFlags ${SecDEnglishGB} $0
810    SectionSetSize ${SecDEnglishGB} 0
811   ${endif}
812   StrCpy $Search "en_NZ"
813   Call StrPoint
814   ${if} $Pointer != "-1"
815    IntOp $0 ${SF_SELECTED} | ${SF_RO}
816  # enable this for LyX 2.1!
817  #  SectionSetFlags ${SecDEnglishNZ} $0
818  #  SectionSetSize ${SecDEnglishNZ} 0
819   ${endif}
820   StrCpy $Search "en_US"
821   Call StrPoint
822   ${if} $Pointer != "-1"
823    IntOp $0 ${SF_SELECTED} | ${SF_RO}
824    SectionSetFlags ${SecDEnglishUS} $0
825    SectionSetSize ${SecDEnglishUS} 0
826   ${endif}
827   StrCpy $Search "es_ES"
828   Call StrPoint
829   ${if} $Pointer != "-1"
830    IntOp $0 ${SF_SELECTED} | ${SF_RO}
831    SectionSetFlags ${SecDSpanishES} $0
832    SectionSetSize ${SecDSpanishES} 0
833   ${endif}
834   StrCpy $Search "es_MX"
835   Call StrPoint
836   ${if} $Pointer != "-1"
837    IntOp $0 ${SF_SELECTED} | ${SF_RO}
838    SectionSetFlags ${SecDSpanishMX} $0
839    SectionSetSize ${SecDSpanishMX} 0
840   ${endif}
841   StrCpy $Search "eo_EO"
842   Call StrPoint
843   ${if} $Pointer != "-1"
844    IntOp $0 ${SF_SELECTED} | ${SF_RO}
845    SectionSetFlags ${SecDEsperanto} $0
846    SectionSetSize ${SecDEsperanto} 0
847   ${endif}
848   StrCpy $Search "eu_ES"
849   Call StrPoint
850   ${if} $Pointer != "-1"
851    IntOp $0 ${SF_SELECTED} | ${SF_RO}
852    SectionSetFlags ${SecDBasque} $0
853    SectionSetSize ${SecDBasque} 0
854   ${endif}
855   StrCpy $Search "fa_IR"
856   Call StrPoint
857   ${if} $Pointer != "-1"
858    IntOp $0 ${SF_SELECTED} | ${SF_RO}
859    SectionSetFlags ${SecDFarsi} $0
860    SectionSetSize ${SecDFarsi} 0
861   ${endif}
862   StrCpy $Search "fr_FR"
863   Call StrPoint
864   ${if} $Pointer != "-1"
865    IntOp $0 ${SF_SELECTED} | ${SF_RO}
866    SectionSetFlags ${SecDFrench} $0
867    SectionSetSize ${SecDFrench} 0
868   ${endif}
869   StrCpy $Search "ga_IR"
870   Call StrPoint
871   ${if} $Pointer != "-1"
872    IntOp $0 ${SF_SELECTED} | ${SF_RO}
873    SectionSetFlags ${SecDGaelic} $0
874    SectionSetSize ${SecDGaelic} 0
875   ${endif}
876   StrCpy $Search "gd_GB"
877   Call StrPoint
878   ${if} $Pointer != "-1"
879    IntOp $0 ${SF_SELECTED} | ${SF_RO}
880    SectionSetFlags ${SecDScottish} $0
881    SectionSetSize ${SecDScottish} 0
882   ${endif}
883   StrCpy $Search "gl_ES"
884   Call StrPoint
885   ${if} $Pointer != "-1"
886    IntOp $0 ${SF_SELECTED} | ${SF_RO}
887    SectionSetFlags ${SecDGalician} $0
888    SectionSetSize ${SecDGalician} 0
889   ${endif}
890   StrCpy $Search "he_IL"
891   Call StrPoint
892   ${if} $Pointer != "-1"
893    IntOp $0 ${SF_SELECTED} | ${SF_RO}
894    SectionSetFlags ${SecDHebrew} $0
895    SectionSetSize ${SecDHebrew} 0
896   ${endif}
897   StrCpy $Search "hi_IN"
898   Call StrPoint
899   ${if} $Pointer != "-1"
900    IntOp $0 ${SF_SELECTED} | ${SF_RO}
901  # enable this for LyX 2.1! 
902   # SectionSetFlags ${SecDHindi} $0
903   # SectionSetSize ${SecDHindi} 0
904   ${endif}
905   StrCpy $Search "hr_HR"
906   Call StrPoint
907   ${if} $Pointer != "-1"
908    IntOp $0 ${SF_SELECTED} | ${SF_RO}
909    SectionSetFlags ${SecDCroatian} $0
910    SectionSetSize ${SecDCroatian} 0
911   ${endif}
912   StrCpy $Search "hu_HU"
913   Call StrPoint
914   ${if} $Pointer != "-1"
915    IntOp $0 ${SF_SELECTED} | ${SF_RO}
916    SectionSetFlags ${SecDHungarian} $0
917    SectionSetSize ${SecDHungarian} 0
918   ${endif}
919   StrCpy $Search "ia_IA"
920   Call StrPoint
921   ${if} $Pointer != "-1"
922    IntOp $0 ${SF_SELECTED} | ${SF_RO}
923    SectionSetFlags ${SecDInterlingua} $0
924    SectionSetSize ${SecDInterlingua} 0
925   ${endif}
926   StrCpy $Search "is_IS"
927   Call StrPoint
928   ${if} $Pointer != "-1"
929    IntOp $0 ${SF_SELECTED} | ${SF_RO}
930    SectionSetFlags ${SecDIcelandic} $0
931    SectionSetSize ${SecDIcelandic} 0
932   ${endif}
933   StrCpy $Search "it_IT"
934   Call StrPoint
935   ${if} $Pointer != "-1"
936    IntOp $0 ${SF_SELECTED} | ${SF_RO}
937    SectionSetFlags ${SecDItalian} $0
938    SectionSetSize ${SecDItalian} 0
939   ${endif}
940   StrCpy $Search "kk_KZ"
941   Call StrPoint
942   ${if} $Pointer != "-1"
943    IntOp $0 ${SF_SELECTED} | ${SF_RO}
944    SectionSetFlags ${SecDKazakh} $0
945    SectionSetSize ${SecDKazakh} 0
946   ${endif}
947   StrCpy $Search "ko_KR"
948   Call StrPoint
949   ${if} $Pointer != "-1"
950    IntOp $0 ${SF_SELECTED} | ${SF_RO}
951    SectionSetFlags ${SecDKorean} $0
952    SectionSetSize ${SecDKorean} 0
953   ${endif}
954   StrCpy $Search "la_LA"
955   Call StrPoint
956   ${if} $Pointer != "-1"
957    IntOp $0 ${SF_SELECTED} | ${SF_RO}
958    SectionSetFlags ${SecDLatin} $0
959    SectionSetSize ${SecDLatin} 0
960   ${endif}
961   StrCpy $Search "lt_LT"
962   Call StrPoint
963   ${if} $Pointer != "-1"
964    IntOp $0 ${SF_SELECTED} | ${SF_RO}
965    SectionSetFlags ${SecDLithuanian} $0
966    SectionSetSize ${SecDLithuanian} 0
967   ${endif}
968   StrCpy $Search "lv_LV"
969   Call StrPoint
970   ${if} $Pointer != "-1"
971    IntOp $0 ${SF_SELECTED} | ${SF_RO}
972    SectionSetFlags ${SecDLatvian} $0
973    SectionSetSize ${SecDLatvian} 0
974   ${endif}
975   StrCpy $Search "nl_NL"
976   Call StrPoint
977   ${if} $Pointer != "-1"
978    IntOp $0 ${SF_SELECTED} | ${SF_RO}
979    SectionSetFlags ${SecDDutch} $0
980    SectionSetSize ${SecDDutch} 0
981   ${endif}
982   StrCpy $Search "nb_NO"
983   Call StrPoint
984   ${if} $Pointer != "-1"
985    IntOp $0 ${SF_SELECTED} | ${SF_RO}
986    SectionSetFlags ${SecDNorwegianNB} $0
987    SectionSetSize ${SecDNorwegianNB} 0
988   ${endif}
989   StrCpy $Search "nn_NO"
990   Call StrPoint
991   ${if} $Pointer != "-1"
992    IntOp $0 ${SF_SELECTED} | ${SF_RO}
993    SectionSetFlags ${SecDNorwegianNN} $0
994    SectionSetSize ${SecDNorwegianNN} 0
995   ${endif}
996   StrCpy $Search "oc_FR"
997   Call StrPoint
998   ${if} $Pointer != "-1"
999    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1000  # enable this for LyX 2.1!  
1001   # SectionSetFlags ${SecDOccitan} $0
1002   # SectionSetSize ${SecDOccitan} 0
1003   ${endif}
1004   StrCpy $Search "pl_PL"
1005   Call StrPoint
1006   ${if} $Pointer != "-1"
1007    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1008    SectionSetFlags ${SecDPolish} $0
1009    SectionSetSize ${SecDPolish} 0
1010   ${endif}
1011   StrCpy $Search "pt_BR"
1012   Call StrPoint
1013   ${if} $Pointer != "-1"
1014    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1015    SectionSetFlags ${SecDPortugueseBR} $0
1016    SectionSetSize ${SecDPortugueseBR} 0
1017   ${endif}
1018   StrCpy $Search "pt_PT"
1019   Call StrPoint
1020   ${if} $Pointer != "-1"
1021    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1022    SectionSetFlags ${SecDPortuguesePT} $0
1023    SectionSetSize ${SecDPortuguesePT} 0
1024   ${endif}
1025   StrCpy $Search "ro_RO"
1026   Call StrPoint
1027   ${if} $Pointer != "-1"
1028    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1029    SectionSetFlags ${SecDRomanian} $0
1030    SectionSetSize ${SecDRomanian} 0
1031   ${endif}
1032   StrCpy $Search "ru_RU"
1033   Call StrPoint
1034   ${if} $Pointer != "-1"
1035    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1036    SectionSetFlags ${SecDRussian} $0
1037    SectionSetSize ${SecDRussian} 0
1038   ${endif}
1039   StrCpy $Search "dsb_DE"
1040   Call StrPoint
1041   ${if} $Pointer != "-1"
1042    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1043    SectionSetFlags ${SecDSorbianD} $0
1044    SectionSetSize ${SecDSorbianD} 0
1045   ${endif}
1046   StrCpy $Search "hsb_DE"
1047   Call StrPoint
1048   ${if} $Pointer != "-1"
1049    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1050    SectionSetFlags ${SecDSorbianH} $0
1051    SectionSetSize ${SecDSorbianH} 0
1052   ${endif}
1053   StrCpy $Search "sq_AL"
1054   Call StrPoint
1055   ${if} $Pointer != "-1"
1056    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1057    SectionSetFlags ${SecDAlbanian} $0
1058    SectionSetSize ${SecDAlbanian} 0
1059   ${endif}
1060   StrCpy $Search "sl_SI"
1061   Call StrPoint
1062   ${if} $Pointer != "-1"
1063    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1064    SectionSetFlags ${SecDSlovenian} $0
1065    SectionSetSize ${SecDSlovenian} 0
1066   ${endif}
1067   StrCpy $Search "sk_SK"
1068   Call StrPoint
1069   ${if} $Pointer != "-1"
1070    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1071    SectionSetFlags ${SecDSlovakian} $0
1072    SectionSetSize ${SecDSlovakian} 0
1073   ${endif}
1074   StrCpy $Search "sr_RS"
1075   Call StrPoint
1076   ${if} $Pointer != "-1"
1077    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1078    SectionSetFlags ${SecDSerbian} $0
1079    SectionSetSize ${SecDSerbian} 0
1080   ${endif}
1081   StrCpy $Search "sv_SE"
1082   Call StrPoint
1083   ${if} $Pointer != "-1"
1084    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1085    SectionSetFlags ${SecDSwedish} $0
1086    SectionSetSize ${SecDSwedish} 0
1087   ${endif}
1088   StrCpy $Search "ta_IN"
1089   Call StrPoint
1090   ${if} $Pointer != "-1"
1091    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1092  # enable this for LyX 2.1!
1093   # SectionSetFlags ${SecDTamil} $0
1094   # SectionSetSize ${SecDTamil} 0
1095   ${endif}
1096   StrCpy $Search "te_IN"
1097   Call StrPoint
1098   ${if} $Pointer != "-1"
1099    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1100  # enable this for LyX 2.1!
1101   # SectionSetFlags ${SecDTelugu} $0
1102   # SectionSetSize ${SecDTelugu} 0
1103   ${endif}
1104   StrCpy $Search "th_TH"
1105   Call StrPoint
1106   ${if} $Pointer != "-1"
1107    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1108    SectionSetFlags ${SecDThai} $0
1109    SectionSetSize ${SecDThai} 0
1110   ${endif}
1111   StrCpy $Search "uk_UA"
1112   Call StrPoint
1113   ${if} $Pointer != "-1"
1114    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1115    SectionSetFlags ${SecDUkrainian} $0
1116    SectionSetSize ${SecDUkrainian} 0
1117   ${endif}
1118   StrCpy $Search "ur_PK"
1119   Call StrPoint
1120   ${if} $Pointer != "-1"
1121    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1122  # enable this for LyX 2.1!
1123   # SectionSetFlags ${SecDUrdu} $0
1124   # SectionSetSize ${SecDUrdu} 0
1125   ${endif}
1126   StrCpy $Search "vi_VN"
1127   Call StrPoint
1128   ${if} $Pointer != "-1"
1129    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1130    SectionSetFlags ${SecDVietnamese} $0
1131    SectionSetSize ${SecDVietnamese} 0
1132   ${endif}
1133   
1134   # select sections of already installed thesaurus dictionaries, make them read-only
1135   # and set the necessary size to 0 bytes
1136   StrCpy $String $FoundThes
1137   StrCpy $Search "bg_BG"
1138   Call StrPoint # function from LyXUtils.nsh
1139   ${if} $Pointer != "-1"
1140    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1141    SectionSetFlags ${SecTBulgarian} $0
1142    SectionSetSize ${SecTBulgarian} 0
1143   ${endif}
1144   StrCpy $Search "ca_ES"
1145   Call StrPoint
1146   ${if} $Pointer != "-1"
1147    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1148    SectionSetFlags ${SecTCatalan} $0
1149    SectionSetSize ${SecTCatalan} 0
1150   ${endif}
1151   StrCpy $Search "cs_CZ"
1152   Call StrPoint
1153   ${if} $Pointer != "-1"
1154    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1155    SectionSetFlags ${SecTCzech} $0
1156    SectionSetSize ${SecTCzech} 0
1157   ${endif}
1158   StrCpy $Search "da_DK"
1159   Call StrPoint
1160   ${if} $Pointer != "-1"
1161    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1162    SectionSetFlags ${SecTDanish} $0
1163    SectionSetSize ${SecTDanish} 0
1164   ${endif}
1165   StrCpy $Search "de_DE"
1166   Call StrPoint
1167   ${if} $Pointer != "-1"
1168    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1169    SectionSetFlags ${SecTGermanDA} $0
1170    SectionSetSize ${SecTGermanDA} 0
1171   ${endif} 
1172   StrCpy $Search "de_CH"
1173   Call StrPoint
1174   ${if} $Pointer != "-1"
1175    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1176    SectionSetFlags ${SecTGermanCH} $0
1177    SectionSetSize ${SecTGermanCH} 0
1178   ${endif}
1179   StrCpy $Search "en_GB"
1180   Call StrPoint
1181   ${if} $Pointer != "-1"
1182    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1183    SectionSetFlags ${SecTEnglishGB} $0
1184    SectionSetSize ${SecTEnglishGB} 0
1185   ${endif} 
1186   StrCpy $Search "en_US"
1187   Call StrPoint
1188   ${if} $Pointer != "-1"
1189    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1190    SectionSetFlags ${SecTEnglishUSAU} $0
1191    SectionSetSize ${SecTEnglishUSAU} 0
1192   ${endif}
1193   StrCpy $Search "es_ES"
1194   Call StrPoint
1195   ${if} $Pointer != "-1"
1196    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1197    SectionSetFlags ${SecTSpanish} $0
1198    SectionSetSize ${SecTSpanish} 0
1199   ${endif}
1200   StrCpy $Search "fr_FR"
1201   Call StrPoint
1202   ${if} $Pointer != "-1"
1203    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1204    SectionSetFlags ${SecTFrench} $0
1205    SectionSetSize ${SecTFrench} 0
1206   ${endif}
1207   StrCpy $Search "ga_IR"
1208   Call StrPoint
1209   ${if} $Pointer != "-1"
1210    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1211    SectionSetFlags ${SecTGaelic} $0
1212    SectionSetSize ${SecTGaelic} 0
1213   ${endif}
1214   StrCpy $Search "el_GR"
1215   Call StrPoint
1216   ${if} $Pointer != "-1"
1217    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1218    SectionSetFlags ${SecTGreek} $0
1219    SectionSetSize ${SecTGreek} 0
1220   ${endif}
1221   StrCpy $Search "it_IT"
1222   Call StrPoint
1223   ${if} $Pointer != "-1"
1224    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1225    SectionSetFlags ${SecTItalian} $0
1226    SectionSetSize ${SecTItalian} 0
1227   ${endif}
1228   StrCpy $Search "hu_HU"
1229   Call StrPoint
1230   ${if} $Pointer != "-1"
1231    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1232    SectionSetFlags ${SecTHungarian} $0
1233    SectionSetSize ${SecTHungarian} 0
1234   ${endif}
1235   StrCpy $Search "no_NO"
1236   Call StrPoint
1237   ${if} $Pointer != "-1"
1238    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1239    SectionSetFlags ${SecTNorwegian} $0
1240    SectionSetSize ${SecTNorwegian} 0
1241   ${endif}
1242   StrCpy $Search "pl_PL"
1243   Call StrPoint
1244   ${if} $Pointer != "-1"
1245    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1246    SectionSetFlags ${SecTPolish} $0
1247    SectionSetSize ${SecTPolish} 0
1248   ${endif}
1249   StrCpy $Search "pt_PT"
1250   Call StrPoint
1251   ${if} $Pointer != "-1"
1252    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1253    SectionSetFlags ${SecTPortuguese} $0
1254    SectionSetSize ${SecTPortuguese} 0
1255   ${endif}
1256   StrCpy $Search "ro_RO"
1257   Call StrPoint
1258   ${if} $Pointer != "-1"
1259    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1260    SectionSetFlags ${SecTRomanian} $0
1261    SectionSetSize ${SecTRomanian} 0
1262   ${endif}
1263   StrCpy $Search "ru_RU"
1264   Call StrPoint
1265   ${if} $Pointer != "-1"
1266    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1267    SectionSetFlags ${SecTRussian} $0
1268    SectionSetSize ${SecTRussian} 0
1269   ${endif}
1270   StrCpy $Search "sl_SI"
1271   Call StrPoint
1272   ${if} $Pointer != "-1"
1273    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1274    SectionSetFlags ${SecTSlovenian} $0
1275    SectionSetSize ${SecTSlovenian} 0
1276   ${endif}
1277   StrCpy $Search "sk_SK"
1278   Call StrPoint
1279   ${if} $Pointer != "-1"
1280    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1281    SectionSetFlags ${SecTSlovakian} $0
1282    SectionSetSize ${SecTSlovakian} 0
1283   ${endif}
1284   StrCpy $Search "sv_SE"
1285   Call StrPoint
1286   ${if} $Pointer != "-1"
1287    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1288    SectionSetFlags ${SecTSwedish} $0
1289    SectionSetSize ${SecTSwedish} 0
1290   ${endif}*/
1291   
1292   ${IfNot} ${Silent}
1293     Banner::destroy
1294   ${EndIf}
1295
1296 FunctionEnd
1297
1298 # this function is called at first after starting the uninstaller
1299 Function un.onInit
1300
1301   !insertmacro PRINTER_INIT
1302   !insertmacro MULTIUSER_UNINIT
1303
1304   # Check that LyX is not currently running
1305   FindProcDLL::FindProc "lyx.exe"
1306   ${if} $R0 == "1"
1307    MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1308    Abort
1309   ${endif}
1310
1311   # set registry root key
1312   ${if} $MultiUser.Privileges == "Admin"
1313   ${orif} $MultiUser.Privileges == "Power"
1314     SetShellVarContext all
1315   ${else}
1316    SetShellVarContext current
1317   ${endif}
1318
1319   # Ascertain whether the user has sufficient privileges to uninstall.
1320   # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1321   ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1322   ${if} $0 != ""
1323   ${andif} $MultiUser.Privileges != "Admin"
1324   ${andif} $MultiUser.Privileges != "Power"
1325    MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1326    Abort
1327   ${endif}
1328   # warning when LyX couldn't be found in the registry
1329   ${if} $0 == "" # check in HKCU
1330    ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1331    ${if} $0 == ""
1332      MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1333    ${endif}
1334   ${endif}
1335   
1336   # Macro to investigate name of LyX's preferences folders to be able remove them
1337   !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1338
1339   # test if MiKTeX was installed together with LyX
1340   ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1341   ${if} $0 == "Yes${APP_SERIES_KEY}"
1342    SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1343    StrCpy $LaTeXInstalled "MiKTeX"
1344   ${else}
1345    SectionSetText 2 "" # hides the corresponding uninstaller section
1346   ${endif}
1347   
1348   # test if JabRef was installed together with LyX
1349   ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1350   ${if} $0 == "Yes${APP_SERIES_KEY}"
1351    SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1352    StrCpy $JabRefInstalled "Yes"
1353   ${else}
1354    SectionSetText 3 "" # hides the corresponding uninstaller section
1355   ${endif}
1356
1357   # question message if the user really wants to uninstall LyX
1358   MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes
1359   Abort
1360
1361 FunctionEnd
1362