]> git.lyx.org Git - features.git/blob - development/Win32/packaging/installer/include/init.nsh
installer: various fixed for immediate release
[features.git] / development / Win32 / packaging / installer / include / init.nsh
1 /*
2 init.nsh
3
4 Initialization functions
5 */
6
7 #--------------------------------
8 # User initialization
9
10 Var ComponentPath
11 Var LyXLangName
12
13 # COMPONENT can be LaTeX, ImageMagick and Ghostscript
14 !macro EXTERNAL_INIT COMPONENT
15
16   # APP_REGKEY_SETUP = "Software\${APP_NAME}${APP_SERIES_KEY}\Setup"
17   # where ${APP_NAME}${APP_SERIES_KEY} is something like LyX16
18   ReadRegStr $ComponentPath SHELL_CONTEXT "${APP_REGKEY_SETUP}" "${COMPONENT} Path"
19   
20   # BIN_LATEX etc are defined in settings.nsh
21   ${If} ${FileExists} "$ComponentPath\${BIN_${COMPONENT}}"
22     # set variables like PathLaTeX
23     StrCpy $Path${COMPONENT} $ComponentPath
24   ${EndIf}
25
26 !macroend
27
28 Function InitUser
29
30   # Get directories of components from registry
31   
32   !insertmacro EXTERNAL_INIT LaTeX
33   
34   # Get LyX language
35   
36   ReadRegStr $LyXLangName SHELL_CONTEXT "${APP_REGKEY_SETUP}" "LyX Language"
37   
38   ${If} $LyXLangName != ""
39     StrCpy $LangName $LyXLangName
40   ${EndIf}
41   
42 FunctionEnd
43
44 #--------------------------------
45 # visible installer sections
46
47 Section "!${APP_NAME}" SecCore
48  SectionIn RO
49 SectionEnd
50
51 Section "$(SecFileAssocTitle)" SecFileAssoc
52  StrCpy $CreateFileAssociations "true"
53 SectionEnd
54
55 Section "$(SecDesktopTitle)" SecDesktop
56  StrCpy $CreateDesktopIcon "true"
57 SectionEnd
58
59 !if ${SETUPTYPE} == BUNDLE
60  Section /o "$(SecInstJabRefTitle)" SecInstJabRef
61   AddSize ${SIZE_JABREF}
62   StrCpy $InstallJabRef "true"
63  SectionEnd
64 !endif
65
66 # Expand the list of dictionaries by default as this was requested by several
67 # users. For the thesaurus this is was not requested because this section
68 # is by default empty.
69 SectionGroup /e "Dictionaries" SecDictionaries
70
71 Section /o "Afrikaans" SecDAfrikaans
72  StrCpy $DictCodes "af_ZA,$DictCodes"
73  AddSize 1440
74 SectionEnd
75
76 Section /o "Arabic" SecDArabic
77  StrCpy $DictCodes "ar_DZ,$DictCodes"
78  AddSize 2500
79 SectionEnd
80
81 Section /o "Armenian" SecDArmenian
82  StrCpy $DictCodes "hy_AM,$DictCodes"
83  AddSize 2000
84 SectionEnd
85
86 Section /o "Bahasa Indonesia" SecDIndonesian
87  StrCpy $DictCodes "id_ID,$DictCodes"
88  AddSize 217
89 SectionEnd
90
91 Section /o "Bahasa Melayu" SecDMalayan
92  StrCpy $DictCodes "ms_MY,$DictCodes"
93  AddSize 227
94 SectionEnd
95
96 Section /o "Belarusian" SecDBelarusian 
97  StrCpy $DictCodes "be_BY,$DictCodes"
98  AddSize 1730
99 SectionEnd
100
101 Section /o "Brezhoneg" SecDBreton 
102  StrCpy $DictCodes "br_FR,$DictCodes"
103  AddSize 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    ${else}
614     ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
615    ${endif}
616    ${if} $0 != ""
617     StrCpy $R5 $0 # store the read version number
618     StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
619     # we don't stop here because we want the latest installed version
620    ${endif} 
621   ${next}
622   ${if} $OldVersionNumber > ${APP_SERIES_KEY}
623    # store the version number and reformat it temporarily for the error message
624    StrCpy $R0 $OldVersionNumber
625    StrCpy $OldVersionNumber $R5
626    MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
627    StrCpy $OldVersionNumber $R0
628    Abort
629   ${endif}
630
631   !insertmacro PRINTER_INIT
632   
633   # this can be reset to "true" in section SecDesktop
634   StrCpy $CreateDesktopIcon "false"
635   StrCpy $CreateFileAssociations "false"
636  
637   ${IfNot} ${Silent}
638     # Show banner while installer is intializating 
639     Banner::show /NOUNLOAD "Checking system"
640   ${EndIf}
641  
642   Call SearchExternal
643   
644   !if ${SETUPTYPE} == BUNDLE
645    # don't let the installer sections appear when the programs are already installed
646    ${if} $PathBibTeXEditor != ""
647     SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
648    ${endif}
649   !endif
650   
651   # select sections of already installed spell-checker dictionaries, make them read-only
652   # and set the necessary size to 0 bytes
653   StrCpy $String $FoundDict
654   StrCpy $Search "af_ZA"
655   Call StrPoint # function from LyXUtils.nsh
656   ${if} $Pointer != "-1"
657    IntOp $0 ${SF_SELECTED} | ${SF_RO}
658    SectionSetFlags ${SecDAfrikaans} $0
659    SectionSetSize ${SecDAfrikaans} 0
660   ${endif}
661   StrCpy $Search "ar_DZ"
662   Call StrPoint
663   ${if} $Pointer != "-1"
664    IntOp $0 ${SF_SELECTED} | ${SF_RO}
665    SectionSetFlags ${SecDArabic} $0
666    SectionSetSize ${SecDArabic} 0
667   ${endif}
668   StrCpy $Search "hy_AM"
669   Call StrPoint
670   ${if} $Pointer != "-1"
671    IntOp $0 ${SF_SELECTED} | ${SF_RO}
672    SectionSetFlags ${SecDArmenian} $0
673    SectionSetSize ${SecDArmenian} 0
674   ${endif}
675   StrCpy $Search "id_ID"
676   Call StrPoint
677   ${if} $Pointer != "-1"
678    IntOp $0 ${SF_SELECTED} | ${SF_RO}
679    SectionSetFlags ${SecDIndonesian} $0
680    SectionSetSize ${SecDIndonesian} 0
681   ${endif}
682   StrCpy $Search "ms_MY"
683   Call StrPoint
684   ${if} $Pointer != "-1"
685    IntOp $0 ${SF_SELECTED} | ${SF_RO}
686    SectionSetFlags ${SecDMalayan} $0
687    SectionSetSize ${SecDMalayan} 0
688   ${endif}
689   StrCpy $Search "be_BY"
690   Call StrPoint
691   ${if} $Pointer != "-1"
692    IntOp $0 ${SF_SELECTED} | ${SF_RO}
693    SectionSetFlags ${SecDBelarusian} $0
694    SectionSetSize ${SecDBelarusian} 0
695   ${endif}
696   StrCpy $Search "br_FR"
697   Call StrPoint
698   ${if} $Pointer != "-1"
699    IntOp $0 ${SF_SELECTED} | ${SF_RO}
700    SectionSetFlags ${SecDBreton} $0
701    SectionSetSize ${SecDBreton} 0
702   ${endif}
703   StrCpy $Search "bg_BG"
704   Call StrPoint
705   ${if} $Pointer != "-1"
706    IntOp $0 ${SF_SELECTED} | ${SF_RO}
707    SectionSetFlags ${SecDBulgarian} $0
708    SectionSetSize ${SecDBulgarian} 0
709   ${endif}
710   StrCpy $Search "ca_ES"
711   Call StrPoint
712   ${if} $Pointer != "-1"
713    IntOp $0 ${SF_SELECTED} | ${SF_RO}
714    SectionSetFlags ${SecDCatalanian} $0
715    SectionSetSize ${SecDCatalanian} 0
716   ${endif}
717   StrCpy $Search "cs_CZ"
718   Call StrPoint
719   ${if} $Pointer != "-1"
720    IntOp $0 ${SF_SELECTED} | ${SF_RO}
721    SectionSetFlags ${SecDCzech} $0
722    SectionSetSize ${SecDCzech} 0
723   ${endif}
724  
725   StrCpy $Search "cop_EG"
726   Call StrPoint
727   ${if} $Pointer != "-1"
728    IntOp $0 ${SF_SELECTED} | ${SF_RO}
729   # enable this for LyX 2.1!
730   # SectionSetFlags ${SecDCoptic} $0
731   # SectionSetSize ${SecDCoptic} 0
732   ${endif}
733   StrCpy $Search "cy_GB"
734   Call StrPoint
735   ${if} $Pointer != "-1"
736    IntOp $0 ${SF_SELECTED} | ${SF_RO}
737    SectionSetFlags ${SecDWelsh} $0
738    SectionSetSize ${SecDWelsh} 0
739   ${endif}
740   StrCpy $Search "da_DK"
741   Call StrPoint
742   ${if} $Pointer != "-1"
743    IntOp $0 ${SF_SELECTED} | ${SF_RO}
744    SectionSetFlags ${SecDDanish} $0
745    SectionSetSize ${SecDDanish} 0
746   ${endif}
747   StrCpy $Search "de_AT"
748   Call StrPoint
749   ${if} $Pointer != "-1"
750    IntOp $0 ${SF_SELECTED} | ${SF_RO}
751    SectionSetFlags ${SecDGermanAT} $0
752    SectionSetSize ${SecDGermanAT} 0
753   ${endif}
754   StrCpy $Search "de_CH"
755   Call StrPoint
756   ${if} $Pointer != "-1"
757    IntOp $0 ${SF_SELECTED} | ${SF_RO}
758    SectionSetFlags ${SecDGermanCH} $0
759    SectionSetSize ${SecDGermanCH} 0
760   ${endif}
761   StrCpy $Search "de_DE"
762   Call StrPoint
763   ${if} $Pointer != "-1"
764    IntOp $0 ${SF_SELECTED} | ${SF_RO}
765    SectionSetFlags ${SecDGermanD} $0
766    SectionSetSize ${SecDGermanD} 0
767   ${endif}
768   StrCpy $Search "el_GR"
769   Call StrPoint
770   ${if} $Pointer != "-1"
771    IntOp $0 ${SF_SELECTED} | ${SF_RO}
772    SectionSetFlags ${SecDGreek} $0
773    SectionSetSize ${SecDGreek} 0
774   ${endif}
775   StrCpy $Search "et_EE"
776   Call StrPoint
777   ${if} $Pointer != "-1"
778    IntOp $0 ${SF_SELECTED} | ${SF_RO}
779    SectionSetFlags ${SecDEstonian} $0
780    SectionSetSize ${SecDEstonian} 0
781   ${endif}
782   StrCpy $Search "en_AU"
783   Call StrPoint
784   ${if} $Pointer != "-1"
785    IntOp $0 ${SF_SELECTED} | ${SF_RO}
786  # enable this for LyX 2.1!
787  #  SectionSetFlags ${SecDEnglishAU} $0
788  #  SectionSetSize ${SecDEnglishAU} 0
789   ${endif}
790   StrCpy $Search "en_CA"
791   Call StrPoint
792   ${if} $Pointer != "-1"
793    IntOp $0 ${SF_SELECTED} | ${SF_RO}
794    SectionSetFlags ${SecDEnglishCA} $0
795    SectionSetSize ${SecDEnglishCA} 0
796   ${endif}
797   StrCpy $Search "en_GB"
798   Call StrPoint
799   ${if} $Pointer != "-1"
800    IntOp $0 ${SF_SELECTED} | ${SF_RO}
801    SectionSetFlags ${SecDEnglishGB} $0
802    SectionSetSize ${SecDEnglishGB} 0
803   ${endif}
804   StrCpy $Search "en_NZ"
805   Call StrPoint
806   ${if} $Pointer != "-1"
807    IntOp $0 ${SF_SELECTED} | ${SF_RO}
808  # enable this for LyX 2.1!
809  #  SectionSetFlags ${SecDEnglishNZ} $0
810  #  SectionSetSize ${SecDEnglishNZ} 0
811   ${endif}
812   StrCpy $Search "en_US"
813   Call StrPoint
814   ${if} $Pointer != "-1"
815    IntOp $0 ${SF_SELECTED} | ${SF_RO}
816    SectionSetFlags ${SecDEnglishUS} $0
817    SectionSetSize ${SecDEnglishUS} 0
818   ${endif}
819   StrCpy $Search "es_ES"
820   Call StrPoint
821   ${if} $Pointer != "-1"
822    IntOp $0 ${SF_SELECTED} | ${SF_RO}
823    SectionSetFlags ${SecDSpanishES} $0
824    SectionSetSize ${SecDSpanishES} 0
825   ${endif}
826   StrCpy $Search "es_MX"
827   Call StrPoint
828   ${if} $Pointer != "-1"
829    IntOp $0 ${SF_SELECTED} | ${SF_RO}
830    SectionSetFlags ${SecDSpanishMX} $0
831    SectionSetSize ${SecDSpanishMX} 0
832   ${endif}
833   StrCpy $Search "eo_EO"
834   Call StrPoint
835   ${if} $Pointer != "-1"
836    IntOp $0 ${SF_SELECTED} | ${SF_RO}
837    SectionSetFlags ${SecDEsperanto} $0
838    SectionSetSize ${SecDEsperanto} 0
839   ${endif}
840   StrCpy $Search "eu_ES"
841   Call StrPoint
842   ${if} $Pointer != "-1"
843    IntOp $0 ${SF_SELECTED} | ${SF_RO}
844    SectionSetFlags ${SecDBasque} $0
845    SectionSetSize ${SecDBasque} 0
846   ${endif}
847   StrCpy $Search "fa_IR"
848   Call StrPoint
849   ${if} $Pointer != "-1"
850    IntOp $0 ${SF_SELECTED} | ${SF_RO}
851    SectionSetFlags ${SecDFarsi} $0
852    SectionSetSize ${SecDFarsi} 0
853   ${endif}
854   StrCpy $Search "fr_FR"
855   Call StrPoint
856   ${if} $Pointer != "-1"
857    IntOp $0 ${SF_SELECTED} | ${SF_RO}
858    SectionSetFlags ${SecDFrench} $0
859    SectionSetSize ${SecDFrench} 0
860   ${endif}
861   StrCpy $Search "ga_IR"
862   Call StrPoint
863   ${if} $Pointer != "-1"
864    IntOp $0 ${SF_SELECTED} | ${SF_RO}
865    SectionSetFlags ${SecDGaelic} $0
866    SectionSetSize ${SecDGaelic} 0
867   ${endif}
868   StrCpy $Search "gd_GB"
869   Call StrPoint
870   ${if} $Pointer != "-1"
871    IntOp $0 ${SF_SELECTED} | ${SF_RO}
872    SectionSetFlags ${SecDScottish} $0
873    SectionSetSize ${SecDScottish} 0
874   ${endif}
875   StrCpy $Search "gl_ES"
876   Call StrPoint
877   ${if} $Pointer != "-1"
878    IntOp $0 ${SF_SELECTED} | ${SF_RO}
879    SectionSetFlags ${SecDGalician} $0
880    SectionSetSize ${SecDGalician} 0
881   ${endif}
882   StrCpy $Search "he_IL"
883   Call StrPoint
884   ${if} $Pointer != "-1"
885    IntOp $0 ${SF_SELECTED} | ${SF_RO}
886    SectionSetFlags ${SecDHebrew} $0
887    SectionSetSize ${SecDHebrew} 0
888   ${endif}
889   StrCpy $Search "hi_IN"
890   Call StrPoint
891   ${if} $Pointer != "-1"
892    IntOp $0 ${SF_SELECTED} | ${SF_RO}
893  # enable this for LyX 2.1! 
894   # SectionSetFlags ${SecDHindi} $0
895   # SectionSetSize ${SecDHindi} 0
896   ${endif}
897   StrCpy $Search "hr_HR"
898   Call StrPoint
899   ${if} $Pointer != "-1"
900    IntOp $0 ${SF_SELECTED} | ${SF_RO}
901    SectionSetFlags ${SecDCroatian} $0
902    SectionSetSize ${SecDCroatian} 0
903   ${endif}
904   StrCpy $Search "hu_HU"
905   Call StrPoint
906   ${if} $Pointer != "-1"
907    IntOp $0 ${SF_SELECTED} | ${SF_RO}
908    SectionSetFlags ${SecDHungarian} $0
909    SectionSetSize ${SecDHungarian} 0
910   ${endif}
911   StrCpy $Search "ia_IA"
912   Call StrPoint
913   ${if} $Pointer != "-1"
914    IntOp $0 ${SF_SELECTED} | ${SF_RO}
915    SectionSetFlags ${SecDInterlingua} $0
916    SectionSetSize ${SecDInterlingua} 0
917   ${endif}
918   StrCpy $Search "is_IS"
919   Call StrPoint
920   ${if} $Pointer != "-1"
921    IntOp $0 ${SF_SELECTED} | ${SF_RO}
922    SectionSetFlags ${SecDIcelandic} $0
923    SectionSetSize ${SecDIcelandic} 0
924   ${endif}
925   StrCpy $Search "it_IT"
926   Call StrPoint
927   ${if} $Pointer != "-1"
928    IntOp $0 ${SF_SELECTED} | ${SF_RO}
929    SectionSetFlags ${SecDItalian} $0
930    SectionSetSize ${SecDItalian} 0
931   ${endif}
932   StrCpy $Search "kk_KZ"
933   Call StrPoint
934   ${if} $Pointer != "-1"
935    IntOp $0 ${SF_SELECTED} | ${SF_RO}
936    SectionSetFlags ${SecDKazakh} $0
937    SectionSetSize ${SecDKazakh} 0
938   ${endif}
939   StrCpy $Search "ko_KR"
940   Call StrPoint
941   ${if} $Pointer != "-1"
942    IntOp $0 ${SF_SELECTED} | ${SF_RO}
943    SectionSetFlags ${SecDKorean} $0
944    SectionSetSize ${SecDKorean} 0
945   ${endif}
946   StrCpy $Search "la_LA"
947   Call StrPoint
948   ${if} $Pointer != "-1"
949    IntOp $0 ${SF_SELECTED} | ${SF_RO}
950    SectionSetFlags ${SecDLatin} $0
951    SectionSetSize ${SecDLatin} 0
952   ${endif}
953   StrCpy $Search "lt_LT"
954   Call StrPoint
955   ${if} $Pointer != "-1"
956    IntOp $0 ${SF_SELECTED} | ${SF_RO}
957    SectionSetFlags ${SecDLithuanian} $0
958    SectionSetSize ${SecDLithuanian} 0
959   ${endif}
960   StrCpy $Search "lv_LV"
961   Call StrPoint
962   ${if} $Pointer != "-1"
963    IntOp $0 ${SF_SELECTED} | ${SF_RO}
964    SectionSetFlags ${SecDLatvian} $0
965    SectionSetSize ${SecDLatvian} 0
966   ${endif}
967   StrCpy $Search "nl_NL"
968   Call StrPoint
969   ${if} $Pointer != "-1"
970    IntOp $0 ${SF_SELECTED} | ${SF_RO}
971    SectionSetFlags ${SecDDutch} $0
972    SectionSetSize ${SecDDutch} 0
973   ${endif}
974   StrCpy $Search "nb_NO"
975   Call StrPoint
976   ${if} $Pointer != "-1"
977    IntOp $0 ${SF_SELECTED} | ${SF_RO}
978    SectionSetFlags ${SecDNorwegianNB} $0
979    SectionSetSize ${SecDNorwegianNB} 0
980   ${endif}
981   StrCpy $Search "nn_NO"
982   Call StrPoint
983   ${if} $Pointer != "-1"
984    IntOp $0 ${SF_SELECTED} | ${SF_RO}
985    SectionSetFlags ${SecDNorwegianNN} $0
986    SectionSetSize ${SecDNorwegianNN} 0
987   ${endif}
988   StrCpy $Search "oc_FR"
989   Call StrPoint
990   ${if} $Pointer != "-1"
991    IntOp $0 ${SF_SELECTED} | ${SF_RO}
992  # enable this for LyX 2.1!  
993   # SectionSetFlags ${SecDOccitan} $0
994   # SectionSetSize ${SecDOccitan} 0
995   ${endif}
996   StrCpy $Search "pl_PL"
997   Call StrPoint
998   ${if} $Pointer != "-1"
999    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1000    SectionSetFlags ${SecDPolish} $0
1001    SectionSetSize ${SecDPolish} 0
1002   ${endif}
1003   StrCpy $Search "pt_BR"
1004   Call StrPoint
1005   ${if} $Pointer != "-1"
1006    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1007    SectionSetFlags ${SecDPortugueseBR} $0
1008    SectionSetSize ${SecDPortugueseBR} 0
1009   ${endif}
1010   StrCpy $Search "pt_PT"
1011   Call StrPoint
1012   ${if} $Pointer != "-1"
1013    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1014    SectionSetFlags ${SecDPortuguesePT} $0
1015    SectionSetSize ${SecDPortuguesePT} 0
1016   ${endif}
1017   StrCpy $Search "ro_RO"
1018   Call StrPoint
1019   ${if} $Pointer != "-1"
1020    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1021    SectionSetFlags ${SecDRomanian} $0
1022    SectionSetSize ${SecDRomanian} 0
1023   ${endif}
1024   StrCpy $Search "ru_RU"
1025   Call StrPoint
1026   ${if} $Pointer != "-1"
1027    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1028    SectionSetFlags ${SecDRussian} $0
1029    SectionSetSize ${SecDRussian} 0
1030   ${endif}
1031   StrCpy $Search "dsb_DE"
1032   Call StrPoint
1033   ${if} $Pointer != "-1"
1034    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1035    SectionSetFlags ${SecDSorbianD} $0
1036    SectionSetSize ${SecDSorbianD} 0
1037   ${endif}
1038   StrCpy $Search "hsb_DE"
1039   Call StrPoint
1040   ${if} $Pointer != "-1"
1041    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1042    SectionSetFlags ${SecDSorbianH} $0
1043    SectionSetSize ${SecDSorbianH} 0
1044   ${endif}
1045   StrCpy $Search "sq_AL"
1046   Call StrPoint
1047   ${if} $Pointer != "-1"
1048    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1049    SectionSetFlags ${SecDAlbanian} $0
1050    SectionSetSize ${SecDAlbanian} 0
1051   ${endif}
1052   StrCpy $Search "sl_SI"
1053   Call StrPoint
1054   ${if} $Pointer != "-1"
1055    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1056    SectionSetFlags ${SecDSlovenian} $0
1057    SectionSetSize ${SecDSlovenian} 0
1058   ${endif}
1059   StrCpy $Search "sk_SK"
1060   Call StrPoint
1061   ${if} $Pointer != "-1"
1062    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1063    SectionSetFlags ${SecDSlovakian} $0
1064    SectionSetSize ${SecDSlovakian} 0
1065   ${endif}
1066   StrCpy $Search "sr_RS"
1067   Call StrPoint
1068   ${if} $Pointer != "-1"
1069    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1070    SectionSetFlags ${SecDSerbian} $0
1071    SectionSetSize ${SecDSerbian} 0
1072   ${endif}
1073   StrCpy $Search "sv_SE"
1074   Call StrPoint
1075   ${if} $Pointer != "-1"
1076    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1077    SectionSetFlags ${SecDSwedish} $0
1078    SectionSetSize ${SecDSwedish} 0
1079   ${endif}
1080   StrCpy $Search "ta_IN"
1081   Call StrPoint
1082   ${if} $Pointer != "-1"
1083    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1084  # enable this for LyX 2.1!
1085   # SectionSetFlags ${SecDTamil} $0
1086   # SectionSetSize ${SecDTamil} 0
1087   ${endif}
1088   StrCpy $Search "te_IN"
1089   Call StrPoint
1090   ${if} $Pointer != "-1"
1091    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1092  # enable this for LyX 2.1!
1093   # SectionSetFlags ${SecDTelugu} $0
1094   # SectionSetSize ${SecDTelugu} 0
1095   ${endif}
1096   StrCpy $Search "th_TH"
1097   Call StrPoint
1098   ${if} $Pointer != "-1"
1099    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1100    SectionSetFlags ${SecDThai} $0
1101    SectionSetSize ${SecDThai} 0
1102   ${endif}
1103   StrCpy $Search "uk_UA"
1104   Call StrPoint
1105   ${if} $Pointer != "-1"
1106    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1107    SectionSetFlags ${SecDUkrainian} $0
1108    SectionSetSize ${SecDUkrainian} 0
1109   ${endif}
1110   StrCpy $Search "ur_PK"
1111   Call StrPoint
1112   ${if} $Pointer != "-1"
1113    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1114  # enable this for LyX 2.1!
1115   # SectionSetFlags ${SecDUrdu} $0
1116   # SectionSetSize ${SecDUrdu} 0
1117   ${endif}
1118   StrCpy $Search "vi_VN"
1119   Call StrPoint
1120   ${if} $Pointer != "-1"
1121    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1122    SectionSetFlags ${SecDVietnamese} $0
1123    SectionSetSize ${SecDVietnamese} 0
1124   ${endif}
1125   
1126   # select sections of already installed thesaurus dictionaries, make them read-only
1127   # and set the necessary size to 0 bytes
1128   StrCpy $String $FoundThes
1129   StrCpy $Search "bg_BG"
1130   Call StrPoint # function from LyXUtils.nsh
1131   ${if} $Pointer != "-1"
1132    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1133    SectionSetFlags ${SecTBulgarian} $0
1134    SectionSetSize ${SecTBulgarian} 0
1135   ${endif}
1136   StrCpy $Search "ca_ES"
1137   Call StrPoint
1138   ${if} $Pointer != "-1"
1139    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1140    SectionSetFlags ${SecTCatalan} $0
1141    SectionSetSize ${SecTCatalan} 0
1142   ${endif}
1143   StrCpy $Search "cs_CZ"
1144   Call StrPoint
1145   ${if} $Pointer != "-1"
1146    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1147    SectionSetFlags ${SecTCzech} $0
1148    SectionSetSize ${SecTCzech} 0
1149   ${endif}
1150   StrCpy $Search "da_DK"
1151   Call StrPoint
1152   ${if} $Pointer != "-1"
1153    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1154    SectionSetFlags ${SecTDanish} $0
1155    SectionSetSize ${SecTDanish} 0
1156   ${endif}
1157   StrCpy $Search "de_DE"
1158   Call StrPoint
1159   ${if} $Pointer != "-1"
1160    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1161    SectionSetFlags ${SecTGermanDA} $0
1162    SectionSetSize ${SecTGermanDA} 0
1163   ${endif} 
1164   StrCpy $Search "de_CH"
1165   Call StrPoint
1166   ${if} $Pointer != "-1"
1167    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1168    SectionSetFlags ${SecTGermanCH} $0
1169    SectionSetSize ${SecTGermanCH} 0
1170   ${endif}
1171   StrCpy $Search "en_GB"
1172   Call StrPoint
1173   ${if} $Pointer != "-1"
1174    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1175    SectionSetFlags ${SecTEnglishGB} $0
1176    SectionSetSize ${SecTEnglishGB} 0
1177   ${endif} 
1178   StrCpy $Search "en_US"
1179   Call StrPoint
1180   ${if} $Pointer != "-1"
1181    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1182    SectionSetFlags ${SecTEnglishUSAU} $0
1183    SectionSetSize ${SecTEnglishUSAU} 0
1184   ${endif}
1185   StrCpy $Search "es_ES"
1186   Call StrPoint
1187   ${if} $Pointer != "-1"
1188    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1189    SectionSetFlags ${SecTSpanish} $0
1190    SectionSetSize ${SecTSpanish} 0
1191   ${endif}
1192   StrCpy $Search "fr_FR"
1193   Call StrPoint
1194   ${if} $Pointer != "-1"
1195    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1196    SectionSetFlags ${SecTFrench} $0
1197    SectionSetSize ${SecTFrench} 0
1198   ${endif}
1199   StrCpy $Search "ga_IR"
1200   Call StrPoint
1201   ${if} $Pointer != "-1"
1202    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1203    SectionSetFlags ${SecTGaelic} $0
1204    SectionSetSize ${SecTGaelic} 0
1205   ${endif}
1206   StrCpy $Search "el_GR"
1207   Call StrPoint
1208   ${if} $Pointer != "-1"
1209    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1210    SectionSetFlags ${SecTGreek} $0
1211    SectionSetSize ${SecTGreek} 0
1212   ${endif}
1213   StrCpy $Search "it_IT"
1214   Call StrPoint
1215   ${if} $Pointer != "-1"
1216    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1217    SectionSetFlags ${SecTItalian} $0
1218    SectionSetSize ${SecTItalian} 0
1219   ${endif}
1220   StrCpy $Search "hu_HU"
1221   Call StrPoint
1222   ${if} $Pointer != "-1"
1223    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1224    SectionSetFlags ${SecTHungarian} $0
1225    SectionSetSize ${SecTHungarian} 0
1226   ${endif}
1227   StrCpy $Search "no_NO"
1228   Call StrPoint
1229   ${if} $Pointer != "-1"
1230    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1231    SectionSetFlags ${SecTNorwegian} $0
1232    SectionSetSize ${SecTNorwegian} 0
1233   ${endif}
1234   StrCpy $Search "pl_PL"
1235   Call StrPoint
1236   ${if} $Pointer != "-1"
1237    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1238    SectionSetFlags ${SecTPolish} $0
1239    SectionSetSize ${SecTPolish} 0
1240   ${endif}
1241   StrCpy $Search "pt_PT"
1242   Call StrPoint
1243   ${if} $Pointer != "-1"
1244    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1245    SectionSetFlags ${SecTPortuguese} $0
1246    SectionSetSize ${SecTPortuguese} 0
1247   ${endif}
1248   StrCpy $Search "ro_RO"
1249   Call StrPoint
1250   ${if} $Pointer != "-1"
1251    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1252    SectionSetFlags ${SecTRomanian} $0
1253    SectionSetSize ${SecTRomanian} 0
1254   ${endif}
1255   StrCpy $Search "ru_RU"
1256   Call StrPoint
1257   ${if} $Pointer != "-1"
1258    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1259    SectionSetFlags ${SecTRussian} $0
1260    SectionSetSize ${SecTRussian} 0
1261   ${endif}
1262   StrCpy $Search "sl_SI"
1263   Call StrPoint
1264   ${if} $Pointer != "-1"
1265    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1266    SectionSetFlags ${SecTSlovenian} $0
1267    SectionSetSize ${SecTSlovenian} 0
1268   ${endif}
1269   StrCpy $Search "sk_SK"
1270   Call StrPoint
1271   ${if} $Pointer != "-1"
1272    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1273    SectionSetFlags ${SecTSlovakian} $0
1274    SectionSetSize ${SecTSlovakian} 0
1275   ${endif}
1276   StrCpy $Search "sv_SE"
1277   Call StrPoint
1278   ${if} $Pointer != "-1"
1279    IntOp $0 ${SF_SELECTED} | ${SF_RO}
1280    SectionSetFlags ${SecTSwedish} $0
1281    SectionSetSize ${SecTSwedish} 0
1282   ${endif}*/
1283   
1284   ${IfNot} ${Silent}
1285     Banner::destroy
1286   ${EndIf}
1287
1288 FunctionEnd
1289
1290 # this function is called at first after starting the uninstaller
1291 Function un.onInit
1292
1293   !insertmacro PRINTER_INIT
1294   !insertmacro MULTIUSER_UNINIT
1295
1296   # Check that LyX is not currently running
1297   FindProcDLL::FindProc "lyx.exe"
1298   ${if} $R0 == "1"
1299    MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1300    Abort
1301   ${endif}
1302
1303   # set registry root key
1304   ${if} $MultiUser.Privileges == "Admin"
1305   ${orif} $MultiUser.Privileges == "Power"
1306     SetShellVarContext all
1307   ${else}
1308    SetShellVarContext current
1309   ${endif}
1310
1311   # Ascertain whether the user has sufficient privileges to uninstall.
1312   # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1313   ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1314   ${if} $0 != ""
1315   ${andif} $MultiUser.Privileges != "Admin"
1316   ${andif} $MultiUser.Privileges != "Power"
1317    MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1318    Abort
1319   ${endif}
1320   # warning when LyX couldn't be found in the registry
1321   ${if} $0 == "" # check in HKCU
1322    ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1323    ${if} $0 == ""
1324      MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1325    ${endif}
1326   ${endif}
1327   
1328   # Macro to investigate name of LyX's preferences folders to be able remove them
1329   !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1330
1331   # test if MiKTeX was installed together with LyX
1332   ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1333   ${if} $0 == "Yes${APP_SERIES_KEY}"
1334    SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1335    StrCpy $LaTeXInstalled "MiKTeX"
1336   ${else}
1337    SectionSetText 2 "" # hides the corresponding uninstaller section
1338   ${endif}
1339   
1340   # test if JabRef was installed together with LyX
1341   ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1342   ${if} $0 == "Yes${APP_SERIES_KEY}"
1343    SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1344    StrCpy $JabRefInstalled "Yes"
1345   ${else}
1346    SectionSetText 3 "" # hides the corresponding uninstaller section
1347   ${endif}
1348
1349   # question message if the user really wants to uninstall LyX
1350   MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes
1351   Abort
1352
1353 FunctionEnd
1354