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