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
61 AddSize ${SIZE_JABREF}
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" SecDSlovenian
366 StrCpy $DictCodes "sl_SI,$DictCodes"
370 Section /o "Slovenský" SecDSlovakian
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" SecTSlovenian
519 StrCpy $ThesCodes "sl_SI$ThesCodes"
523 Section /o "Slovenský" SecTSlovakian
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"
641 !if ${SETUPTYPE} == BUNDLE
642 # don't let the installer sections appear when the programs are already installed
643 ${if} $PathBibTeXEditor != ""
644 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
648 # select sections of already installed spell-checker dictionaries, make them read-only
649 # and set the necessary size to 0 bytes
650 StrCpy $String $FoundDict
651 StrCpy $Search "af_ZA"
652 Call StrPoint # function from LyXUtils.nsh
653 ${if} $Pointer != "-1"
654 IntOp $0 ${SF_SELECTED} | ${SF_RO}
655 SectionSetFlags ${SecDAfrikaans} $0
656 SectionSetSize ${SecDAfrikaans} 0
658 StrCpy $Search "ar_DZ"
660 ${if} $Pointer != "-1"
661 IntOp $0 ${SF_SELECTED} | ${SF_RO}
662 SectionSetFlags ${SecDArabic} $0
663 SectionSetSize ${SecDArabic} 0
665 StrCpy $Search "hy_AM"
667 ${if} $Pointer != "-1"
668 IntOp $0 ${SF_SELECTED} | ${SF_RO}
669 SectionSetFlags ${SecDArmenian} $0
670 SectionSetSize ${SecDArmenian} 0
672 StrCpy $Search "id_ID"
674 ${if} $Pointer != "-1"
675 IntOp $0 ${SF_SELECTED} | ${SF_RO}
676 SectionSetFlags ${SecDIndonesian} $0
677 SectionSetSize ${SecDIndonesian} 0
679 StrCpy $Search "ms_MY"
681 ${if} $Pointer != "-1"
682 IntOp $0 ${SF_SELECTED} | ${SF_RO}
683 SectionSetFlags ${SecDMalayan} $0
684 SectionSetSize ${SecDMalayan} 0
686 StrCpy $Search "be_BY"
688 ${if} $Pointer != "-1"
689 IntOp $0 ${SF_SELECTED} | ${SF_RO}
690 SectionSetFlags ${SecDBelarusian} $0
691 SectionSetSize ${SecDBelarusian} 0
693 StrCpy $Search "br_FR"
695 ${if} $Pointer != "-1"
696 IntOp $0 ${SF_SELECTED} | ${SF_RO}
697 SectionSetFlags ${SecDBreton} $0
698 SectionSetSize ${SecDBreton} 0
700 StrCpy $Search "bg_BG"
702 ${if} $Pointer != "-1"
703 IntOp $0 ${SF_SELECTED} | ${SF_RO}
704 SectionSetFlags ${SecDBulgarian} $0
705 SectionSetSize ${SecDBulgarian} 0
707 StrCpy $Search "ca_ES"
709 ${if} $Pointer != "-1"
710 IntOp $0 ${SF_SELECTED} | ${SF_RO}
711 SectionSetFlags ${SecDCatalanian} $0
712 SectionSetSize ${SecDCatalanian} 0
714 StrCpy $Search "cs_CZ"
716 ${if} $Pointer != "-1"
717 IntOp $0 ${SF_SELECTED} | ${SF_RO}
718 SectionSetFlags ${SecDCzech} $0
719 SectionSetSize ${SecDCzech} 0
722 StrCpy $Search "cop_EG"
724 ${if} $Pointer != "-1"
725 IntOp $0 ${SF_SELECTED} | ${SF_RO}
726 # enable this for LyX 2.1!
727 # SectionSetFlags ${SecDCoptic} $0
728 # SectionSetSize ${SecDCoptic} 0
730 StrCpy $Search "cy_GB"
732 ${if} $Pointer != "-1"
733 IntOp $0 ${SF_SELECTED} | ${SF_RO}
734 SectionSetFlags ${SecDWelsh} $0
735 SectionSetSize ${SecDWelsh} 0
737 StrCpy $Search "da_DK"
739 ${if} $Pointer != "-1"
740 IntOp $0 ${SF_SELECTED} | ${SF_RO}
741 SectionSetFlags ${SecDDanish} $0
742 SectionSetSize ${SecDDanish} 0
744 StrCpy $Search "de_AT"
746 ${if} $Pointer != "-1"
747 IntOp $0 ${SF_SELECTED} | ${SF_RO}
748 SectionSetFlags ${SecDGermanAT} $0
749 SectionSetSize ${SecDGermanAT} 0
751 StrCpy $Search "de_CH"
753 ${if} $Pointer != "-1"
754 IntOp $0 ${SF_SELECTED} | ${SF_RO}
755 SectionSetFlags ${SecDGermanCH} $0
756 SectionSetSize ${SecDGermanCH} 0
758 StrCpy $Search "de_DE"
760 ${if} $Pointer != "-1"
761 IntOp $0 ${SF_SELECTED} | ${SF_RO}
762 SectionSetFlags ${SecDGermanD} $0
763 SectionSetSize ${SecDGermanD} 0
765 StrCpy $Search "el_GR"
767 ${if} $Pointer != "-1"
768 IntOp $0 ${SF_SELECTED} | ${SF_RO}
769 SectionSetFlags ${SecDGreek} $0
770 SectionSetSize ${SecDGreek} 0
772 StrCpy $Search "et_EE"
774 ${if} $Pointer != "-1"
775 IntOp $0 ${SF_SELECTED} | ${SF_RO}
776 SectionSetFlags ${SecDEstonian} $0
777 SectionSetSize ${SecDEstonian} 0
779 StrCpy $Search "en_AU"
781 ${if} $Pointer != "-1"
782 IntOp $0 ${SF_SELECTED} | ${SF_RO}
783 # enable this for LyX 2.1!
784 # SectionSetFlags ${SecDEnglishAU} $0
785 # SectionSetSize ${SecDEnglishAU} 0
787 StrCpy $Search "en_CA"
789 ${if} $Pointer != "-1"
790 IntOp $0 ${SF_SELECTED} | ${SF_RO}
791 SectionSetFlags ${SecDEnglishCA} $0
792 SectionSetSize ${SecDEnglishCA} 0
794 StrCpy $Search "en_GB"
796 ${if} $Pointer != "-1"
797 IntOp $0 ${SF_SELECTED} | ${SF_RO}
798 SectionSetFlags ${SecDEnglishGB} $0
799 SectionSetSize ${SecDEnglishGB} 0
801 StrCpy $Search "en_NZ"
803 ${if} $Pointer != "-1"
804 IntOp $0 ${SF_SELECTED} | ${SF_RO}
805 # enable this for LyX 2.1!
806 # SectionSetFlags ${SecDEnglishNZ} $0
807 # SectionSetSize ${SecDEnglishNZ} 0
809 StrCpy $Search "en_US"
811 ${if} $Pointer != "-1"
812 IntOp $0 ${SF_SELECTED} | ${SF_RO}
813 SectionSetFlags ${SecDEnglishUS} $0
814 SectionSetSize ${SecDEnglishUS} 0
816 StrCpy $Search "es_ES"
818 ${if} $Pointer != "-1"
819 IntOp $0 ${SF_SELECTED} | ${SF_RO}
820 SectionSetFlags ${SecDSpanishES} $0
821 SectionSetSize ${SecDSpanishES} 0
823 StrCpy $Search "es_MX"
825 ${if} $Pointer != "-1"
826 IntOp $0 ${SF_SELECTED} | ${SF_RO}
827 SectionSetFlags ${SecDSpanishMX} $0
828 SectionSetSize ${SecDSpanishMX} 0
830 StrCpy $Search "eo_EO"
832 ${if} $Pointer != "-1"
833 IntOp $0 ${SF_SELECTED} | ${SF_RO}
834 SectionSetFlags ${SecDEsperanto} $0
835 SectionSetSize ${SecDEsperanto} 0
837 StrCpy $Search "eu_ES"
839 ${if} $Pointer != "-1"
840 IntOp $0 ${SF_SELECTED} | ${SF_RO}
841 SectionSetFlags ${SecDBasque} $0
842 SectionSetSize ${SecDBasque} 0
844 StrCpy $Search "fa_IR"
846 ${if} $Pointer != "-1"
847 IntOp $0 ${SF_SELECTED} | ${SF_RO}
848 SectionSetFlags ${SecDFarsi} $0
849 SectionSetSize ${SecDFarsi} 0
851 StrCpy $Search "fr_FR"
853 ${if} $Pointer != "-1"
854 IntOp $0 ${SF_SELECTED} | ${SF_RO}
855 SectionSetFlags ${SecDFrench} $0
856 SectionSetSize ${SecDFrench} 0
858 StrCpy $Search "ga_IR"
860 ${if} $Pointer != "-1"
861 IntOp $0 ${SF_SELECTED} | ${SF_RO}
862 SectionSetFlags ${SecDGaelic} $0
863 SectionSetSize ${SecDGaelic} 0
865 StrCpy $Search "gd_GB"
867 ${if} $Pointer != "-1"
868 IntOp $0 ${SF_SELECTED} | ${SF_RO}
869 SectionSetFlags ${SecDScottish} $0
870 SectionSetSize ${SecDScottish} 0
872 StrCpy $Search "gl_ES"
874 ${if} $Pointer != "-1"
875 IntOp $0 ${SF_SELECTED} | ${SF_RO}
876 SectionSetFlags ${SecDGalician} $0
877 SectionSetSize ${SecDGalician} 0
879 StrCpy $Search "he_IL"
881 ${if} $Pointer != "-1"
882 IntOp $0 ${SF_SELECTED} | ${SF_RO}
883 SectionSetFlags ${SecDHebrew} $0
884 SectionSetSize ${SecDHebrew} 0
886 StrCpy $Search "hi_IN"
888 ${if} $Pointer != "-1"
889 IntOp $0 ${SF_SELECTED} | ${SF_RO}
890 # enable this for LyX 2.1!
891 # SectionSetFlags ${SecDHindi} $0
892 # SectionSetSize ${SecDHindi} 0
894 StrCpy $Search "hr_HR"
896 ${if} $Pointer != "-1"
897 IntOp $0 ${SF_SELECTED} | ${SF_RO}
898 SectionSetFlags ${SecDCroatian} $0
899 SectionSetSize ${SecDCroatian} 0
901 StrCpy $Search "hu_HU"
903 ${if} $Pointer != "-1"
904 IntOp $0 ${SF_SELECTED} | ${SF_RO}
905 SectionSetFlags ${SecDHungarian} $0
906 SectionSetSize ${SecDHungarian} 0
908 StrCpy $Search "ia_IA"
910 ${if} $Pointer != "-1"
911 IntOp $0 ${SF_SELECTED} | ${SF_RO}
912 SectionSetFlags ${SecDInterlingua} $0
913 SectionSetSize ${SecDInterlingua} 0
915 StrCpy $Search "is_IS"
917 ${if} $Pointer != "-1"
918 IntOp $0 ${SF_SELECTED} | ${SF_RO}
919 SectionSetFlags ${SecDIcelandic} $0
920 SectionSetSize ${SecDIcelandic} 0
922 StrCpy $Search "it_IT"
924 ${if} $Pointer != "-1"
925 IntOp $0 ${SF_SELECTED} | ${SF_RO}
926 SectionSetFlags ${SecDItalian} $0
927 SectionSetSize ${SecDItalian} 0
929 StrCpy $Search "kk_KZ"
931 ${if} $Pointer != "-1"
932 IntOp $0 ${SF_SELECTED} | ${SF_RO}
933 SectionSetFlags ${SecDKazakh} $0
934 SectionSetSize ${SecDKazakh} 0
936 StrCpy $Search "ko_KR"
938 ${if} $Pointer != "-1"
939 IntOp $0 ${SF_SELECTED} | ${SF_RO}
940 SectionSetFlags ${SecDKorean} $0
941 SectionSetSize ${SecDKorean} 0
943 StrCpy $Search "la_LA"
945 ${if} $Pointer != "-1"
946 IntOp $0 ${SF_SELECTED} | ${SF_RO}
947 SectionSetFlags ${SecDLatin} $0
948 SectionSetSize ${SecDLatin} 0
950 StrCpy $Search "lt_LT"
952 ${if} $Pointer != "-1"
953 IntOp $0 ${SF_SELECTED} | ${SF_RO}
954 SectionSetFlags ${SecDLithuanian} $0
955 SectionSetSize ${SecDLithuanian} 0
957 StrCpy $Search "lv_LV"
959 ${if} $Pointer != "-1"
960 IntOp $0 ${SF_SELECTED} | ${SF_RO}
961 SectionSetFlags ${SecDLatvian} $0
962 SectionSetSize ${SecDLatvian} 0
964 StrCpy $Search "nl_NL"
966 ${if} $Pointer != "-1"
967 IntOp $0 ${SF_SELECTED} | ${SF_RO}
968 SectionSetFlags ${SecDDutch} $0
969 SectionSetSize ${SecDDutch} 0
971 StrCpy $Search "nb_NO"
973 ${if} $Pointer != "-1"
974 IntOp $0 ${SF_SELECTED} | ${SF_RO}
975 SectionSetFlags ${SecDNorwegianNB} $0
976 SectionSetSize ${SecDNorwegianNB} 0
978 StrCpy $Search "nn_NO"
980 ${if} $Pointer != "-1"
981 IntOp $0 ${SF_SELECTED} | ${SF_RO}
982 SectionSetFlags ${SecDNorwegianNN} $0
983 SectionSetSize ${SecDNorwegianNN} 0
985 StrCpy $Search "oc_FR"
987 ${if} $Pointer != "-1"
988 IntOp $0 ${SF_SELECTED} | ${SF_RO}
989 # enable this for LyX 2.1!
990 # SectionSetFlags ${SecDOccitan} $0
991 # SectionSetSize ${SecDOccitan} 0
993 StrCpy $Search "pl_PL"
995 ${if} $Pointer != "-1"
996 IntOp $0 ${SF_SELECTED} | ${SF_RO}
997 SectionSetFlags ${SecDPolish} $0
998 SectionSetSize ${SecDPolish} 0
1000 StrCpy $Search "pt_BR"
1002 ${if} $Pointer != "-1"
1003 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1004 SectionSetFlags ${SecDPortugueseBR} $0
1005 SectionSetSize ${SecDPortugueseBR} 0
1007 StrCpy $Search "pt_PT"
1009 ${if} $Pointer != "-1"
1010 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1011 SectionSetFlags ${SecDPortuguesePT} $0
1012 SectionSetSize ${SecDPortuguesePT} 0
1014 StrCpy $Search "ro_RO"
1016 ${if} $Pointer != "-1"
1017 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1018 SectionSetFlags ${SecDRomanian} $0
1019 SectionSetSize ${SecDRomanian} 0
1021 StrCpy $Search "ru_RU"
1023 ${if} $Pointer != "-1"
1024 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1025 SectionSetFlags ${SecDRussian} $0
1026 SectionSetSize ${SecDRussian} 0
1028 StrCpy $Search "dsb_DE"
1030 ${if} $Pointer != "-1"
1031 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1032 SectionSetFlags ${SecDSorbianD} $0
1033 SectionSetSize ${SecDSorbianD} 0
1035 StrCpy $Search "hsb_DE"
1037 ${if} $Pointer != "-1"
1038 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1039 SectionSetFlags ${SecDSorbianH} $0
1040 SectionSetSize ${SecDSorbianH} 0
1042 StrCpy $Search "sq_AL"
1044 ${if} $Pointer != "-1"
1045 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1046 SectionSetFlags ${SecDAlbanian} $0
1047 SectionSetSize ${SecDAlbanian} 0
1049 StrCpy $Search "sl_SI"
1051 ${if} $Pointer != "-1"
1052 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1053 SectionSetFlags ${SecDSlovenian} $0
1054 SectionSetSize ${SecDSlovenian} 0
1056 StrCpy $Search "sk_SK"
1058 ${if} $Pointer != "-1"
1059 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1060 SectionSetFlags ${SecDSlovakian} $0
1061 SectionSetSize ${SecDSlovakian} 0
1063 StrCpy $Search "sr_RS"
1065 ${if} $Pointer != "-1"
1066 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1067 SectionSetFlags ${SecDSerbian} $0
1068 SectionSetSize ${SecDSerbian} 0
1070 StrCpy $Search "sv_SE"
1072 ${if} $Pointer != "-1"
1073 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1074 SectionSetFlags ${SecDSwedish} $0
1075 SectionSetSize ${SecDSwedish} 0
1077 StrCpy $Search "ta_IN"
1079 ${if} $Pointer != "-1"
1080 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1081 # enable this for LyX 2.1!
1082 # SectionSetFlags ${SecDTamil} $0
1083 # SectionSetSize ${SecDTamil} 0
1085 StrCpy $Search "te_IN"
1087 ${if} $Pointer != "-1"
1088 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1089 # enable this for LyX 2.1!
1090 # SectionSetFlags ${SecDTelugu} $0
1091 # SectionSetSize ${SecDTelugu} 0
1093 StrCpy $Search "th_TH"
1095 ${if} $Pointer != "-1"
1096 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1097 SectionSetFlags ${SecDThai} $0
1098 SectionSetSize ${SecDThai} 0
1100 StrCpy $Search "uk_UA"
1102 ${if} $Pointer != "-1"
1103 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1104 SectionSetFlags ${SecDUkrainian} $0
1105 SectionSetSize ${SecDUkrainian} 0
1107 StrCpy $Search "ur_PK"
1109 ${if} $Pointer != "-1"
1110 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1111 # enable this for LyX 2.1!
1112 # SectionSetFlags ${SecDUrdu} $0
1113 # SectionSetSize ${SecDUrdu} 0
1115 StrCpy $Search "vi_VN"
1117 ${if} $Pointer != "-1"
1118 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1119 SectionSetFlags ${SecDVietnamese} $0
1120 SectionSetSize ${SecDVietnamese} 0
1123 # select sections of already installed thesaurus dictionaries, make them read-only
1124 # and set the necessary size to 0 bytes
1125 StrCpy $String $FoundThes
1126 StrCpy $Search "bg_BG"
1127 Call StrPoint # function from LyXUtils.nsh
1128 ${if} $Pointer != "-1"
1129 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1130 SectionSetFlags ${SecTBulgarian} $0
1131 SectionSetSize ${SecTBulgarian} 0
1133 StrCpy $Search "ca_ES"
1135 ${if} $Pointer != "-1"
1136 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1137 SectionSetFlags ${SecTCatalan} $0
1138 SectionSetSize ${SecTCatalan} 0
1140 StrCpy $Search "cs_CZ"
1142 ${if} $Pointer != "-1"
1143 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1144 SectionSetFlags ${SecTCzech} $0
1145 SectionSetSize ${SecTCzech} 0
1147 StrCpy $Search "da_DK"
1149 ${if} $Pointer != "-1"
1150 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1151 SectionSetFlags ${SecTDanish} $0
1152 SectionSetSize ${SecTDanish} 0
1154 StrCpy $Search "de_DE"
1156 ${if} $Pointer != "-1"
1157 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1158 SectionSetFlags ${SecTGermanDA} $0
1159 SectionSetSize ${SecTGermanDA} 0
1161 StrCpy $Search "de_CH"
1163 ${if} $Pointer != "-1"
1164 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1165 SectionSetFlags ${SecTGermanCH} $0
1166 SectionSetSize ${SecTGermanCH} 0
1168 StrCpy $Search "en_GB"
1170 ${if} $Pointer != "-1"
1171 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1172 SectionSetFlags ${SecTEnglishGB} $0
1173 SectionSetSize ${SecTEnglishGB} 0
1175 StrCpy $Search "en_US"
1177 ${if} $Pointer != "-1"
1178 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1179 SectionSetFlags ${SecTEnglishUSAU} $0
1180 SectionSetSize ${SecTEnglishUSAU} 0
1182 StrCpy $Search "es_ES"
1184 ${if} $Pointer != "-1"
1185 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1186 SectionSetFlags ${SecTSpanish} $0
1187 SectionSetSize ${SecTSpanish} 0
1189 StrCpy $Search "fr_FR"
1191 ${if} $Pointer != "-1"
1192 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1193 SectionSetFlags ${SecTFrench} $0
1194 SectionSetSize ${SecTFrench} 0
1196 StrCpy $Search "ga_IR"
1198 ${if} $Pointer != "-1"
1199 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1200 SectionSetFlags ${SecTGaelic} $0
1201 SectionSetSize ${SecTGaelic} 0
1203 StrCpy $Search "el_GR"
1205 ${if} $Pointer != "-1"
1206 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1207 SectionSetFlags ${SecTGreek} $0
1208 SectionSetSize ${SecTGreek} 0
1210 StrCpy $Search "it_IT"
1212 ${if} $Pointer != "-1"
1213 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1214 SectionSetFlags ${SecTItalian} $0
1215 SectionSetSize ${SecTItalian} 0
1217 StrCpy $Search "hu_HU"
1219 ${if} $Pointer != "-1"
1220 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1221 SectionSetFlags ${SecTHungarian} $0
1222 SectionSetSize ${SecTHungarian} 0
1224 StrCpy $Search "no_NO"
1226 ${if} $Pointer != "-1"
1227 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1228 SectionSetFlags ${SecTNorwegian} $0
1229 SectionSetSize ${SecTNorwegian} 0
1231 StrCpy $Search "pl_PL"
1233 ${if} $Pointer != "-1"
1234 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1235 SectionSetFlags ${SecTPolish} $0
1236 SectionSetSize ${SecTPolish} 0
1238 StrCpy $Search "pt_PT"
1240 ${if} $Pointer != "-1"
1241 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1242 SectionSetFlags ${SecTPortuguese} $0
1243 SectionSetSize ${SecTPortuguese} 0
1245 StrCpy $Search "ro_RO"
1247 ${if} $Pointer != "-1"
1248 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1249 SectionSetFlags ${SecTRomanian} $0
1250 SectionSetSize ${SecTRomanian} 0
1252 StrCpy $Search "ru_RU"
1254 ${if} $Pointer != "-1"
1255 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1256 SectionSetFlags ${SecTRussian} $0
1257 SectionSetSize ${SecTRussian} 0
1259 StrCpy $Search "sl_SI"
1261 ${if} $Pointer != "-1"
1262 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1263 SectionSetFlags ${SecTSlovenian} $0
1264 SectionSetSize ${SecTSlovenian} 0
1266 StrCpy $Search "sk_SK"
1268 ${if} $Pointer != "-1"
1269 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1270 SectionSetFlags ${SecTSlovakian} $0
1271 SectionSetSize ${SecTSlovakian} 0
1273 StrCpy $Search "sv_SE"
1275 ${if} $Pointer != "-1"
1276 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1277 SectionSetFlags ${SecTSwedish} $0
1278 SectionSetSize ${SecTSwedish} 0
1287 # this function is called at first after starting the uninstaller
1290 !insertmacro PRINTER_INIT
1291 !insertmacro MULTIUSER_UNINIT
1293 # Check that LyX is not currently running
1294 FindProcDLL::FindProc "lyx.exe"
1296 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1300 # set registry root key
1301 ${if} $MultiUser.Privileges == "Admin"
1302 ${orif} $MultiUser.Privileges == "Power"
1303 SetShellVarContext all
1305 SetShellVarContext current
1308 # Ascertain whether the user has sufficient privileges to uninstall.
1309 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1310 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1312 ${andif} $MultiUser.Privileges != "Admin"
1313 ${andif} $MultiUser.Privileges != "Power"
1314 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1317 # warning when LyX couldn't be found in the registry
1318 ${if} $0 == "" # check in HKCU
1319 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1321 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1325 # Macro to investigate name of LyX's preferences folders to be able remove them
1326 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1328 # test if MiKTeX was installed together with LyX
1329 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1330 ${if} $0 == "Yes${APP_SERIES_KEY}"
1331 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1332 StrCpy $LaTeXInstalled "MiKTeX"
1334 SectionSetText 2 "" # hides the corresponding uninstaller section
1337 # test if JabRef was installed together with LyX
1338 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1339 ${if} $0 == "Yes${APP_SERIES_KEY}"
1340 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1341 StrCpy $JabRefInstalled "Yes"
1343 SectionSetText 3 "" # hides the corresponding uninstaller section
1346 # question message if the user really wants to uninstall LyX
1347 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes