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