4 Initialization functions
7 #--------------------------------
13 # COMPONENT can be LaTeX, ImageMagick and Ghostscript
14 !macro EXTERNAL_INIT COMPONENT
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"
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
30 # Get directories of components from registry
32 !insertmacro EXTERNAL_INIT LaTeX
36 ReadRegStr $LyXLangName SHELL_CONTEXT "${APP_REGKEY_SETUP}" "LyX Language"
38 ${If} $LyXLangName != ""
39 StrCpy $LangName $LyXLangName
44 #--------------------------------
45 # visible installer sections
47 Section "!${APP_NAME}" SecCore
51 Section "$(SecFileAssocTitle)" SecFileAssoc
52 StrCpy $CreateFileAssociations "true"
55 Section "$(SecDesktopTitle)" SecDesktop
56 StrCpy $CreateDesktopIcon "true"
59 !if ${SETUPTYPE} == BUNDLE
60 Section /o "$(SecInstJabRefTitle)" SecInstJabRef
62 StrCpy $InstallJabRef "true"
66 SectionGroup "Dictionaries" SecDictionaries
68 Section /o "Afrikaans" SecDAfrikaans
69 StrCpy $DictCodes "af_ZA,$DictCodes"
73 Section /o "Arabic" SecDArabic
74 StrCpy $DictCodes "ar_DZ,$DictCodes"
78 Section /o "Armenian" SecDArmenian
79 StrCpy $DictCodes "hy_AM,$DictCodes"
83 Section /o "Bahasa Indonesia" SecDIndonesian
84 StrCpy $DictCodes "id_ID,$DictCodes"
88 Section /o "Bahasa Melayu" SecDMalayan
89 StrCpy $DictCodes "ms_MY,$DictCodes"
93 Section /o "Belarusian" SecDBelarusian
94 StrCpy $DictCodes "be_BY,$DictCodes"
98 Section /o "Brezhoneg" SecDBreton
99 StrCpy $DictCodes "br_FR,$DictCodes"
103 Section /o "Bulgarian" SecDBulgarian
104 StrCpy $DictCodes "bg_BG,$DictCodes"
108 Section /o "Català" SecDCatalanian
109 StrCpy $DictCodes "ca_ES,$DictCodes"
113 Section /o "Ce
\9atina" SecDCzech
114 StrCpy $DictCodes "cs_CZ,$DictCodes"
118 # enable this for LyX 2.1!
119 #Section /o "Coptic" SecDCoptic
120 # StrCpy $DictCodes "cop_EG,$DictCodes"
124 Section /o "Cymraeg" SecDWelsh
125 StrCpy $DictCodes "cy_GB,$DictCodes"
129 Section /o "Dansk" SecDDanish
130 StrCpy $DictCodes "da_DK,$DictCodes"
134 Section /o "German (A)" SecDGermanAT
135 StrCpy $DictCodes "de_AT,$DictCodes"
139 Section /o "German (CH)" SecDGermanCH
140 StrCpy $DictCodes "de_CH,$DictCodes"
144 Section "German (D)" SecDGermanD
145 # already installed by default
147 #StrCpy $DictCodes "de_DE,$DictCodes"
151 Section /o "Greek" SecDGreek
152 StrCpy $DictCodes "el_GR,$DictCodes"
156 Section /o "Eesti" SecDEstonian
157 StrCpy $DictCodes "et_EE,$DictCodes"
161 # enable this for LyX 2.1!
162 #Section /o "English (AU)" SecDEnglishAU
163 # StrCpy $DictCodes "en_AU,$DictCodes"
167 Section /o "English (CA)" SecDEnglishCA
168 StrCpy $DictCodes "en_CA,$DictCodes"
172 Section "English (GB)" SecDEnglishGB
173 # already installed by default
175 #StrCpy $DictCodes "en_GB,$DictCodes"
179 # enable this for LyX 2.1!
180 #Section /o "English (NZ)" SecDEnglishNZ
181 # StrCpy $DictCodes "en_NZ,$DictCodes"
185 Section "English (US)" SecDEnglishUS
186 # already installed by default
188 #StrCpy $DictCodes "en_US,$DictCodes"
192 Section "Español (ES)" SecDSpanishES
193 # already installed by default
195 #StrCpy $DictCodes "es_ES,$DictCodes"
199 Section "Español (MX)" SecDSpanishMX
200 # already installed by default
202 #StrCpy $DictCodes "es_MX,$DictCodes"
206 Section /o "Esperanto" SecDEsperanto
207 StrCpy $DictCodes "eo_EO,$DictCodes"
211 Section /o "Euskara" SecDBasque
212 StrCpy $DictCodes "eu_ES,$DictCodes"
216 Section /o "Farsi" SecDFarsi
217 StrCpy $DictCodes "fa_IR,$DictCodes"
221 Section "Français" SecDFrench
222 # already installed by default
224 #StrCpy $DictCodes "fr_FR,$DictCodes"
228 Section /o "Gaeilge" SecDGaelic
229 StrCpy $DictCodes "ga_IR,$DictCodes"
233 Section /o "Gàidhlig" SecDScottish
234 StrCpy $DictCodes "gd_GB,$DictCodes"
238 Section /o "Galego" SecDGalician
239 StrCpy $DictCodes "gl_ES,$DictCodes"
243 Section /o "Hebrew" SecDHebrew
244 StrCpy $DictCodes "he_IL,$DictCodes"
248 Section /o "Hrvatski" SecDCroatian
249 StrCpy $DictCodes "hr_HR,$DictCodes"
253 Section /o "Magyar" SecDHungarian
254 StrCpy $DictCodes "hu_HU,$DictCodes"
258 # enable this for LyX 2.1!
259 #Section /o "Hindi" SecDHindi
260 # StrCpy $DictCodes "hi_IN,$DictCodes"
264 Section /o "Interlingua" SecDInterlingua
265 StrCpy $DictCodes "ia_IA,$DictCodes"
269 Section /o "Íslenska" SecDIcelandic
270 StrCpy $DictCodes "is_IS,$DictCodes"
274 Section /o "Italiano" SecDItalian
275 StrCpy $DictCodes "it_IT,$DictCodes"
279 Section /o "Kazakh" SecDKazakh
280 StrCpy $DictCodes "kk_KZ,$DictCodes"
284 Section /o "Korean" SecDKorean
285 StrCpy $DictCodes "ko_KR,$DictCodes"
289 Section /o "Latina" SecDLatin
290 StrCpy $DictCodes "la_LA,$DictCodes"
294 Section /o "Lietuviu" SecDLithuanian
295 StrCpy $DictCodes "lt_LT,$DictCodes"
299 Section /o "Latvie
\9au" SecDLatvian
300 StrCpy $DictCodes "lv_LV,$DictCodes"
304 Section /o "Nederlands" SecDDutch
305 StrCpy $DictCodes "nl_NL,$DictCodes"
309 Section /o "Norsk (Bokmål)" SecDNorwegianNB
310 StrCpy $DictCodes "nb_NO,$DictCodes"
314 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
315 StrCpy $DictCodes "nn_NO,$DictCodes"
319 # enable this for LyX 2.1!
320 #Section /o "Occitan" SecDOccitan
321 # StrCpy $DictCodes "oc_FR,$DictCodes"
325 Section /o "Polski" SecDPolish
326 StrCpy $DictCodes "pl_PL,$DictCodes"
330 Section /o "Português (BR)" SecDPortugueseBR
331 StrCpy $DictCodes "pt_BR,$DictCodes"
335 Section /o "Português (PT)" SecDPortuguesePT
336 StrCpy $DictCodes "pt_PT,$DictCodes"
340 Section /o "Româna" SecDRomanian
341 StrCpy $DictCodes "ro_RO,$DictCodes"
345 Section /o "Russian" SecDRussian
346 StrCpy $DictCodes "ru_RU,$DictCodes"
350 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
351 StrCpy $DictCodes "dsb_DE,$DictCodes"
355 Section /o "Serb
\9acina (Horno)" SecDSorbianH
356 StrCpy $DictCodes "hsb_DE,$DictCodes"
360 Section /o "Shqipe" SecDAlbanian
361 StrCpy $DictCodes "sq_AL,$DictCodes"
365 Section /o "Sloven
\9acina" SecDSlowenian
366 StrCpy $DictCodes "sl_SI,$DictCodes"
370 Section /o "Slovenský" SecDSlowakian
371 StrCpy $DictCodes "sk_SK$ThesCodes"
375 Section /o "Srpski" SecDSerbian
376 StrCpy $DictCodes "sr_RS,$DictCodes"
380 Section /o "Svenska" SecDSwedish
381 StrCpy $DictCodes "sv_SE,$DictCodes"
385 # enable this for LyX 2.1!
386 #Section /o "Tamil" SecDTamil
387 # StrCpy $DictCodes "ta_IN,$DictCodes"
391 # enable this for LyX 2.1!
392 #Section /o "Telugu" SecDTelugu
393 # StrCpy $DictCodes "te_IN,$DictCodes"
397 Section /o "Thai" SecDThai
398 StrCpy $DictCodes "th_TH,$DictCodes"
402 Section /o "Ukrainian" SecDUkrainian
403 StrCpy $DictCodes "uk_UA,$DictCodes"
407 # enable this for LyX 2.1!
408 #Section /o "Urdu" SecDUrdu
409 # StrCpy $DictCodes "ur_PK,$DictCodes"
413 Section /o "Vietnamese" SecDVietnamese
414 StrCpy $DictCodes "vi_VN,$DictCodes"
421 SectionGroup "Thesaurus" SecThesaurus
423 Section /o "Bulgarian" SecTBulgarian
424 StrCpy $ThesCodes "bg_BG$ThesCodes"
428 Section /o "Català" SecTCatalan
429 StrCpy $ThesCodes "ca_ES$ThesCodes"
433 Section /o "Ce
\9atina" SecTCzech
434 StrCpy $ThesCodes "cs_CZ$ThesCodes"
438 Section /o "Dansk" SecTDanish
439 StrCpy $ThesCodes "da_DK$ThesCodes"
443 Section /o "Deutsch (D/A)" SecTGermanDA
444 StrCpy $ThesCodes "de_DE$ThesCodes"
448 Section /o "Deutsch (CH)" SecTGermanCH
449 StrCpy $ThesCodes "de_CH$ThesCodes"
453 Section /o "English (GB)" SecTEnglishGB
454 StrCpy $ThesCodes "en_GB$ThesCodes"
458 Section /o "English (US/AU)" SecTEnglishUSAU
459 StrCpy $ThesCodes "en_US$ThesCodes"
463 Section /o "Español" SecTSpanish
464 StrCpy $ThesCodes "es_ES$ThesCodes"
468 Section /o "Français" SecTFrench
469 StrCpy $ThesCodes "fr_FR$ThesCodes"
473 Section /o "Gaeilge" SecTGaelic
474 StrCpy $ThesCodes "ga_IR$ThesCodes"
478 Section /o "Greek" SecTGreek
479 StrCpy $ThesCodes "el_GR$ThesCodes"
483 Section /o "Italiano" SecTItalian
484 StrCpy $ThesCodes "it_IT$ThesCodes"
488 Section /o "Magyar" SecTHungarian
489 StrCpy $ThesCodes "hu_HU$ThesCodes"
493 Section /o "Norsk" SecTNorwegian
494 StrCpy $ThesCodes "no_NO$ThesCodes"
498 Section /o "Polski" SecTPolish
499 StrCpy $ThesCodes "pl_PL$ThesCodes"
503 Section /o "Português" SecTPortuguese
504 StrCpy $ThesCodes "pt_PT$ThesCodes"
508 Section /o "Româna" SecTRomanian
509 StrCpy $ThesCodes "ro_RO$ThesCodes"
513 Section /o "Russian" SecTRussian
514 StrCpy $ThesCodes "ru_RU$ThesCodes"
518 Section /o "Sloven
\9acina" SecTSlowenian
519 StrCpy $ThesCodes "sl_SI$ThesCodes"
523 Section /o "Slovenský" SecTSlowakian
524 StrCpy $ThesCodes "sk_SK$ThesCodes"
528 Section /o "Svenska" SecTSwedish
529 StrCpy $ThesCodes "sv_SE$ThesCodes"
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)"
543 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
544 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
545 !insertmacro MUI_FUNCTION_DESCRIPTION_END
548 #--------------------------------
549 # Installer initialization
553 ${If} ${AtLeastWinVista}
554 StrCpy $PrinterConf "printui.exe"
556 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
561 # .onInit must be here after the section definition because we have to set
562 # the selection states of the dictionary sections
566 ${OrIfNot} ${AtLeastWinXP}
567 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
571 # check that the installer is not currently running
572 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
575 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
578 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
581 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
585 !insertmacro MULTIUSER_INIT
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"
592 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
593 # handle also the case that LyX is already installed in HKLM
595 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
599 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
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
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"
611 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
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
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
628 !insertmacro PRINTER_INIT
630 # this can be reset to "true" in section SecDesktop
631 StrCpy $CreateDesktopIcon "false"
632 StrCpy $CreateFileAssociations "false"
635 # Show banner while installer is intializating
636 Banner::show /NOUNLOAD "Checking system"
642 !if ${SETUPTYPE} == BUNDLE
643 # don't let the installer sections appear when the programs are already installed
644 ${if} $PathBibTeXEditor != ""
645 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
649 # select sections of already installed spell-checker dictionaries, make them read-only
650 # and set the necessary size to 0 bytes
651 StrCpy $String $FoundDict
652 StrCpy $Search "af_ZA"
653 Call StrPoint # function from LyXUtils.nsh
654 ${if} $Pointer != "-1"
655 IntOp $0 ${SF_SELECTED} | ${SF_RO}
656 SectionSetFlags ${SecDAfrikaans} $0
657 SectionSetSize ${SecDAfrikaans} 0
659 StrCpy $Search "ar_DZ"
661 ${if} $Pointer != "-1"
662 IntOp $0 ${SF_SELECTED} | ${SF_RO}
663 SectionSetFlags ${SecDArabic} $0
664 SectionSetSize ${SecDArabic} 0
666 StrCpy $Search "hy_AM"
668 ${if} $Pointer != "-1"
669 IntOp $0 ${SF_SELECTED} | ${SF_RO}
670 SectionSetFlags ${SecDArmenian} $0
671 SectionSetSize ${SecDArmenian} 0
673 StrCpy $Search "id_ID"
675 ${if} $Pointer != "-1"
676 IntOp $0 ${SF_SELECTED} | ${SF_RO}
677 SectionSetFlags ${SecDIndonesian} $0
678 SectionSetSize ${SecDIndonesian} 0
680 StrCpy $Search "ms_MY"
682 ${if} $Pointer != "-1"
683 IntOp $0 ${SF_SELECTED} | ${SF_RO}
684 SectionSetFlags ${SecDMalayan} $0
685 SectionSetSize ${SecDMalayan} 0
687 StrCpy $Search "be_BY"
689 ${if} $Pointer != "-1"
690 IntOp $0 ${SF_SELECTED} | ${SF_RO}
691 SectionSetFlags ${SecDBelarusian} $0
692 SectionSetSize ${SecDBelarusian} 0
694 StrCpy $Search "br_FR"
696 ${if} $Pointer != "-1"
697 IntOp $0 ${SF_SELECTED} | ${SF_RO}
698 SectionSetFlags ${SecDBreton} $0
699 SectionSetSize ${SecDBreton} 0
701 StrCpy $Search "bg_BG"
703 ${if} $Pointer != "-1"
704 IntOp $0 ${SF_SELECTED} | ${SF_RO}
705 SectionSetFlags ${SecDBulgarian} $0
706 SectionSetSize ${SecDBulgarian} 0
708 StrCpy $Search "ca_ES"
710 ${if} $Pointer != "-1"
711 IntOp $0 ${SF_SELECTED} | ${SF_RO}
712 SectionSetFlags ${SecDCatalanian} $0
713 SectionSetSize ${SecDCatalanian} 0
715 StrCpy $Search "cs_CZ"
717 ${if} $Pointer != "-1"
718 IntOp $0 ${SF_SELECTED} | ${SF_RO}
719 SectionSetFlags ${SecDCzech} $0
720 SectionSetSize ${SecDCzech} 0
723 StrCpy $Search "cop_EG"
725 ${if} $Pointer != "-1"
726 IntOp $0 ${SF_SELECTED} | ${SF_RO}
727 # enable this for LyX 2.1!
728 # SectionSetFlags ${SecDCoptic} $0
729 # SectionSetSize ${SecDCoptic} 0
731 StrCpy $Search "cy_GB"
733 ${if} $Pointer != "-1"
734 IntOp $0 ${SF_SELECTED} | ${SF_RO}
735 SectionSetFlags ${SecDWelsh} $0
736 SectionSetSize ${SecDWelsh} 0
738 StrCpy $Search "da_DK"
740 ${if} $Pointer != "-1"
741 IntOp $0 ${SF_SELECTED} | ${SF_RO}
742 SectionSetFlags ${SecDDanish} $0
743 SectionSetSize ${SecDDanish} 0
745 StrCpy $Search "de_AT"
747 ${if} $Pointer != "-1"
748 IntOp $0 ${SF_SELECTED} | ${SF_RO}
749 SectionSetFlags ${SecDGermanAT} $0
750 SectionSetSize ${SecDGermanAT} 0
752 StrCpy $Search "de_CH"
754 ${if} $Pointer != "-1"
755 IntOp $0 ${SF_SELECTED} | ${SF_RO}
756 SectionSetFlags ${SecDGermanCH} $0
757 SectionSetSize ${SecDGermanCH} 0
759 StrCpy $Search "de_DE"
761 ${if} $Pointer != "-1"
762 IntOp $0 ${SF_SELECTED} | ${SF_RO}
763 SectionSetFlags ${SecDGermanD} $0
764 SectionSetSize ${SecDGermanD} 0
766 StrCpy $Search "el_GR"
768 ${if} $Pointer != "-1"
769 IntOp $0 ${SF_SELECTED} | ${SF_RO}
770 SectionSetFlags ${SecDGreek} $0
771 SectionSetSize ${SecDGreek} 0
773 StrCpy $Search "et_EE"
775 ${if} $Pointer != "-1"
776 IntOp $0 ${SF_SELECTED} | ${SF_RO}
777 SectionSetFlags ${SecDEstonian} $0
778 SectionSetSize ${SecDEstonian} 0
780 StrCpy $Search "en_AU"
782 ${if} $Pointer != "-1"
783 IntOp $0 ${SF_SELECTED} | ${SF_RO}
784 # enable this for LyX 2.1!
785 # SectionSetFlags ${SecDEnglishAU} $0
786 # SectionSetSize ${SecDEnglishAU} 0
788 StrCpy $Search "en_CA"
790 ${if} $Pointer != "-1"
791 IntOp $0 ${SF_SELECTED} | ${SF_RO}
792 SectionSetFlags ${SecDEnglishCA} $0
793 SectionSetSize ${SecDEnglishCA} 0
795 StrCpy $Search "en_GB"
797 ${if} $Pointer != "-1"
798 IntOp $0 ${SF_SELECTED} | ${SF_RO}
799 SectionSetFlags ${SecDEnglishGB} $0
800 SectionSetSize ${SecDEnglishGB} 0
802 StrCpy $Search "en_NZ"
804 ${if} $Pointer != "-1"
805 IntOp $0 ${SF_SELECTED} | ${SF_RO}
806 # enable this for LyX 2.1!
807 # SectionSetFlags ${SecDEnglishNZ} $0
808 # SectionSetSize ${SecDEnglishNZ} 0
810 StrCpy $Search "en_US"
812 ${if} $Pointer != "-1"
813 IntOp $0 ${SF_SELECTED} | ${SF_RO}
814 SectionSetFlags ${SecDEnglishUS} $0
815 SectionSetSize ${SecDEnglishUS} 0
817 StrCpy $Search "es_ES"
819 ${if} $Pointer != "-1"
820 IntOp $0 ${SF_SELECTED} | ${SF_RO}
821 SectionSetFlags ${SecDSpanishES} $0
822 SectionSetSize ${SecDSpanishES} 0
824 StrCpy $Search "es_MX"
826 ${if} $Pointer != "-1"
827 IntOp $0 ${SF_SELECTED} | ${SF_RO}
828 SectionSetFlags ${SecDSpanishMX} $0
829 SectionSetSize ${SecDSpanishMX} 0
831 StrCpy $Search "eo_EO"
833 ${if} $Pointer != "-1"
834 IntOp $0 ${SF_SELECTED} | ${SF_RO}
835 SectionSetFlags ${SecDEsperanto} $0
836 SectionSetSize ${SecDEsperanto} 0
838 StrCpy $Search "eu_ES"
840 ${if} $Pointer != "-1"
841 IntOp $0 ${SF_SELECTED} | ${SF_RO}
842 SectionSetFlags ${SecDBasque} $0
843 SectionSetSize ${SecDBasque} 0
845 StrCpy $Search "fa_IR"
847 ${if} $Pointer != "-1"
848 IntOp $0 ${SF_SELECTED} | ${SF_RO}
849 SectionSetFlags ${SecDFarsi} $0
850 SectionSetSize ${SecDFarsi} 0
852 StrCpy $Search "fr_FR"
854 ${if} $Pointer != "-1"
855 IntOp $0 ${SF_SELECTED} | ${SF_RO}
856 SectionSetFlags ${SecDFrench} $0
857 SectionSetSize ${SecDFrench} 0
859 StrCpy $Search "ga_IR"
861 ${if} $Pointer != "-1"
862 IntOp $0 ${SF_SELECTED} | ${SF_RO}
863 SectionSetFlags ${SecDGaelic} $0
864 SectionSetSize ${SecDGaelic} 0
866 StrCpy $Search "gd_GB"
868 ${if} $Pointer != "-1"
869 IntOp $0 ${SF_SELECTED} | ${SF_RO}
870 SectionSetFlags ${SecDScottish} $0
871 SectionSetSize ${SecDScottish} 0
873 StrCpy $Search "gl_ES"
875 ${if} $Pointer != "-1"
876 IntOp $0 ${SF_SELECTED} | ${SF_RO}
877 SectionSetFlags ${SecDGalician} $0
878 SectionSetSize ${SecDGalician} 0
880 StrCpy $Search "he_IL"
882 ${if} $Pointer != "-1"
883 IntOp $0 ${SF_SELECTED} | ${SF_RO}
884 SectionSetFlags ${SecDHebrew} $0
885 SectionSetSize ${SecDHebrew} 0
887 StrCpy $Search "hi_IN"
889 ${if} $Pointer != "-1"
890 IntOp $0 ${SF_SELECTED} | ${SF_RO}
891 # enable this for LyX 2.1!
892 # SectionSetFlags ${SecDHindi} $0
893 # SectionSetSize ${SecDHindi} 0
895 StrCpy $Search "hr_HR"
897 ${if} $Pointer != "-1"
898 IntOp $0 ${SF_SELECTED} | ${SF_RO}
899 SectionSetFlags ${SecDCroatian} $0
900 SectionSetSize ${SecDCroatian} 0
902 StrCpy $Search "hu_HU"
904 ${if} $Pointer != "-1"
905 IntOp $0 ${SF_SELECTED} | ${SF_RO}
906 SectionSetFlags ${SecDHungarian} $0
907 SectionSetSize ${SecDHungarian} 0
909 StrCpy $Search "ia_IA"
911 ${if} $Pointer != "-1"
912 IntOp $0 ${SF_SELECTED} | ${SF_RO}
913 SectionSetFlags ${SecDInterlingua} $0
914 SectionSetSize ${SecDInterlingua} 0
916 StrCpy $Search "is_IS"
918 ${if} $Pointer != "-1"
919 IntOp $0 ${SF_SELECTED} | ${SF_RO}
920 SectionSetFlags ${SecDIcelandic} $0
921 SectionSetSize ${SecDIcelandic} 0
923 StrCpy $Search "it_IT"
925 ${if} $Pointer != "-1"
926 IntOp $0 ${SF_SELECTED} | ${SF_RO}
927 SectionSetFlags ${SecDItalian} $0
928 SectionSetSize ${SecDItalian} 0
930 StrCpy $Search "kk_KZ"
932 ${if} $Pointer != "-1"
933 IntOp $0 ${SF_SELECTED} | ${SF_RO}
934 SectionSetFlags ${SecDKazakh} $0
935 SectionSetSize ${SecDKazakh} 0
937 StrCpy $Search "ko_KR"
939 ${if} $Pointer != "-1"
940 IntOp $0 ${SF_SELECTED} | ${SF_RO}
941 SectionSetFlags ${SecDKorean} $0
942 SectionSetSize ${SecDKorean} 0
944 StrCpy $Search "la_LA"
946 ${if} $Pointer != "-1"
947 IntOp $0 ${SF_SELECTED} | ${SF_RO}
948 SectionSetFlags ${SecDLatin} $0
949 SectionSetSize ${SecDLatin} 0
951 StrCpy $Search "lt_LT"
953 ${if} $Pointer != "-1"
954 IntOp $0 ${SF_SELECTED} | ${SF_RO}
955 SectionSetFlags ${SecDLithuanian} $0
956 SectionSetSize ${SecDLithuanian} 0
958 StrCpy $Search "lv_LV"
960 ${if} $Pointer != "-1"
961 IntOp $0 ${SF_SELECTED} | ${SF_RO}
962 SectionSetFlags ${SecDLatvian} $0
963 SectionSetSize ${SecDLatvian} 0
965 StrCpy $Search "nl_NL"
967 ${if} $Pointer != "-1"
968 IntOp $0 ${SF_SELECTED} | ${SF_RO}
969 SectionSetFlags ${SecDDutch} $0
970 SectionSetSize ${SecDDutch} 0
972 StrCpy $Search "nb_NO"
974 ${if} $Pointer != "-1"
975 IntOp $0 ${SF_SELECTED} | ${SF_RO}
976 SectionSetFlags ${SecDNorwegianNB} $0
977 SectionSetSize ${SecDNorwegianNB} 0
979 StrCpy $Search "nn_NO"
981 ${if} $Pointer != "-1"
982 IntOp $0 ${SF_SELECTED} | ${SF_RO}
983 SectionSetFlags ${SecDNorwegianNN} $0
984 SectionSetSize ${SecDNorwegianNN} 0
986 StrCpy $Search "oc_FR"
988 ${if} $Pointer != "-1"
989 IntOp $0 ${SF_SELECTED} | ${SF_RO}
990 # enable this for LyX 2.1!
991 # SectionSetFlags ${SecDOccitan} $0
992 # SectionSetSize ${SecDOccitan} 0
994 StrCpy $Search "pl_PL"
996 ${if} $Pointer != "-1"
997 IntOp $0 ${SF_SELECTED} | ${SF_RO}
998 SectionSetFlags ${SecDPolish} $0
999 SectionSetSize ${SecDPolish} 0
1001 StrCpy $Search "pt_BR"
1003 ${if} $Pointer != "-1"
1004 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1005 SectionSetFlags ${SecDPortugueseBR} $0
1006 SectionSetSize ${SecDPortugueseBR} 0
1008 StrCpy $Search "pt_PT"
1010 ${if} $Pointer != "-1"
1011 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1012 SectionSetFlags ${SecDPortuguesePT} $0
1013 SectionSetSize ${SecDPortuguesePT} 0
1015 StrCpy $Search "ro_RO"
1017 ${if} $Pointer != "-1"
1018 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1019 SectionSetFlags ${SecDRomanian} $0
1020 SectionSetSize ${SecDRomanian} 0
1022 StrCpy $Search "ru_RU"
1024 ${if} $Pointer != "-1"
1025 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1026 SectionSetFlags ${SecDRussian} $0
1027 SectionSetSize ${SecDRussian} 0
1029 StrCpy $Search "dsb_DE"
1031 ${if} $Pointer != "-1"
1032 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1033 SectionSetFlags ${SecDSorbianD} $0
1034 SectionSetSize ${SecDSorbianD} 0
1036 StrCpy $Search "hsb_DE"
1038 ${if} $Pointer != "-1"
1039 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1040 SectionSetFlags ${SecDSorbianH} $0
1041 SectionSetSize ${SecDSorbianH} 0
1043 StrCpy $Search "sq_AL"
1045 ${if} $Pointer != "-1"
1046 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1047 SectionSetFlags ${SecDAlbanian} $0
1048 SectionSetSize ${SecDAlbanian} 0
1050 StrCpy $Search "sl_SI"
1052 ${if} $Pointer != "-1"
1053 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1054 SectionSetFlags ${SecDSlowenian} $0
1055 SectionSetSize ${SecDSlowenian} 0
1057 StrCpy $Search "sk_SK"
1059 ${if} $Pointer != "-1"
1060 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1061 SectionSetFlags ${SecDSlowakian} $0
1062 SectionSetSize ${SecDSlowakian} 0
1064 StrCpy $Search "sr_RS"
1066 ${if} $Pointer != "-1"
1067 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1068 SectionSetFlags ${SecDSerbian} $0
1069 SectionSetSize ${SecDSerbian} 0
1071 StrCpy $Search "sv_SE"
1073 ${if} $Pointer != "-1"
1074 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1075 SectionSetFlags ${SecDSwedish} $0
1076 SectionSetSize ${SecDSwedish} 0
1078 StrCpy $Search "ta_IN"
1080 ${if} $Pointer != "-1"
1081 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1082 # enable this for LyX 2.1!
1083 # SectionSetFlags ${SecDTamil} $0
1084 # SectionSetSize ${SecDTamil} 0
1086 StrCpy $Search "te_IN"
1088 ${if} $Pointer != "-1"
1089 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1090 # enable this for LyX 2.1!
1091 # SectionSetFlags ${SecDTelugu} $0
1092 # SectionSetSize ${SecDTelugu} 0
1094 StrCpy $Search "th_TH"
1096 ${if} $Pointer != "-1"
1097 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1098 SectionSetFlags ${SecDThai} $0
1099 SectionSetSize ${SecDThai} 0
1101 StrCpy $Search "uk_UA"
1103 ${if} $Pointer != "-1"
1104 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1105 SectionSetFlags ${SecDUkrainian} $0
1106 SectionSetSize ${SecDUkrainian} 0
1108 StrCpy $Search "ur_PK"
1110 ${if} $Pointer != "-1"
1111 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1112 # enable this for LyX 2.1!
1113 # SectionSetFlags ${SecDUrdu} $0
1114 # SectionSetSize ${SecDUrdu} 0
1116 StrCpy $Search "vi_VN"
1118 ${if} $Pointer != "-1"
1119 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1120 SectionSetFlags ${SecDVietnamese} $0
1121 SectionSetSize ${SecDVietnamese} 0
1124 # select sections of already installed thesaurus dictionaries, make them read-only
1125 # and set the necessary size to 0 bytes
1126 StrCpy $String $FoundThes
1127 StrCpy $Search "bg_BG"
1128 Call StrPoint # function from LyXUtils.nsh
1129 ${if} $Pointer != "-1"
1130 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1131 SectionSetFlags ${SecTBulgarian} $0
1132 SectionSetSize ${SecTBulgarian} 0
1134 StrCpy $Search "ca_ES"
1136 ${if} $Pointer != "-1"
1137 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1138 SectionSetFlags ${SecTCatalan} $0
1139 SectionSetSize ${SecTCatalan} 0
1141 StrCpy $Search "cs_CZ"
1143 ${if} $Pointer != "-1"
1144 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1145 SectionSetFlags ${SecTCzech} $0
1146 SectionSetSize ${SecTCzech} 0
1148 StrCpy $Search "da_DK"
1150 ${if} $Pointer != "-1"
1151 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1152 SectionSetFlags ${SecTDanish} $0
1153 SectionSetSize ${SecTDanish} 0
1155 StrCpy $Search "de_DE"
1157 ${if} $Pointer != "-1"
1158 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1159 SectionSetFlags ${SecTGermanDA} $0
1160 SectionSetSize ${SecTGermanDA} 0
1162 StrCpy $Search "de_CH"
1164 ${if} $Pointer != "-1"
1165 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1166 SectionSetFlags ${SecTGermanCH} $0
1167 SectionSetSize ${SecTGermanCH} 0
1169 StrCpy $Search "en_GB"
1171 ${if} $Pointer != "-1"
1172 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1173 SectionSetFlags ${SecTEnglishGB} $0
1174 SectionSetSize ${SecTEnglishGB} 0
1176 StrCpy $Search "en_US"
1178 ${if} $Pointer != "-1"
1179 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1180 SectionSetFlags ${SecTEnglishUSAU} $0
1181 SectionSetSize ${SecTEnglishUSAU} 0
1183 StrCpy $Search "es_ES"
1185 ${if} $Pointer != "-1"
1186 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1187 SectionSetFlags ${SecTSpanish} $0
1188 SectionSetSize ${SecTSpanish} 0
1190 StrCpy $Search "fr_FR"
1192 ${if} $Pointer != "-1"
1193 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1194 SectionSetFlags ${SecTFrench} $0
1195 SectionSetSize ${SecTFrench} 0
1197 StrCpy $Search "ga_IR"
1199 ${if} $Pointer != "-1"
1200 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1201 SectionSetFlags ${SecTGaelic} $0
1202 SectionSetSize ${SecTGaelic} 0
1204 StrCpy $Search "el_GR"
1206 ${if} $Pointer != "-1"
1207 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1208 SectionSetFlags ${SecTGreek} $0
1209 SectionSetSize ${SecTGreek} 0
1211 StrCpy $Search "it_IT"
1213 ${if} $Pointer != "-1"
1214 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1215 SectionSetFlags ${SecTItalian} $0
1216 SectionSetSize ${SecTItalian} 0
1218 StrCpy $Search "hu_HU"
1220 ${if} $Pointer != "-1"
1221 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1222 SectionSetFlags ${SecTHungarian} $0
1223 SectionSetSize ${SecTHungarian} 0
1225 StrCpy $Search "no_NO"
1227 ${if} $Pointer != "-1"
1228 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1229 SectionSetFlags ${SecTNorwegian} $0
1230 SectionSetSize ${SecTNorwegian} 0
1232 StrCpy $Search "pl_PL"
1234 ${if} $Pointer != "-1"
1235 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1236 SectionSetFlags ${SecTPolish} $0
1237 SectionSetSize ${SecTPolish} 0
1239 StrCpy $Search "pt_PT"
1241 ${if} $Pointer != "-1"
1242 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1243 SectionSetFlags ${SecTPortuguese} $0
1244 SectionSetSize ${SecTPortuguese} 0
1246 StrCpy $Search "ro_RO"
1248 ${if} $Pointer != "-1"
1249 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1250 SectionSetFlags ${SecTRomanian} $0
1251 SectionSetSize ${SecTRomanian} 0
1253 StrCpy $Search "ru_RU"
1255 ${if} $Pointer != "-1"
1256 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1257 SectionSetFlags ${SecTRussian} $0
1258 SectionSetSize ${SecTRussian} 0
1260 StrCpy $Search "sl_SI"
1262 ${if} $Pointer != "-1"
1263 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1264 SectionSetFlags ${SecTSlowenian} $0
1265 SectionSetSize ${SecTSlowenian} 0
1267 StrCpy $Search "sk_SK"
1269 ${if} $Pointer != "-1"
1270 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1271 SectionSetFlags ${SecTSlowakian} $0
1272 SectionSetSize ${SecTSlowakian} 0
1274 StrCpy $Search "sv_SE"
1276 ${if} $Pointer != "-1"
1277 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1278 SectionSetFlags ${SecTSwedish} $0
1279 SectionSetSize ${SecTSwedish} 0
1288 # this function is called at first after starting the uninstaller
1291 !insertmacro PRINTER_INIT
1292 !insertmacro MULTIUSER_UNINIT
1294 # Check that LyX is not currently running
1295 FindProcDLL::FindProc "lyx.exe"
1297 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1301 # set registry root key
1302 ${if} $MultiUser.Privileges == "Admin"
1303 ${orif} $MultiUser.Privileges == "Power"
1304 SetShellVarContext all
1306 SetShellVarContext current
1309 # Ascertain whether the user has sufficient privileges to uninstall.
1310 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1311 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1313 ${andif} $MultiUser.Privileges != "Admin"
1314 ${andif} $MultiUser.Privileges != "Power"
1315 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1318 # warning when LyX couldn't be found in the registry
1319 ${if} $0 == "" # check in HKCU
1320 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1322 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1326 # Macro to investigate name of LyX's preferences folders to be able remove them
1327 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1329 # test if MiKTeX was installed together with LyX
1330 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1331 ${if} $0 == "Yes${APP_SERIES_KEY}"
1332 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1333 StrCpy $LaTeXInstalled "MiKTeX"
1335 SectionSetText 2 "" # hides the corresponding uninstaller section
1338 # test if JabRef was installed together with LyX
1339 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1340 ${if} $0 == "Yes${APP_SERIES_KEY}"
1341 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1342 StrCpy $JabRefInstalled "Yes"
1344 SectionSetText 3 "" # hides the corresponding uninstaller section
1347 # question message if the user really wants to uninstall LyX
1348 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes