5 Initialization function
9 #--------------------------------
15 # COMPONENT can be LaTeX, ImageMagick and Ghostscript
16 !macro EXTERNAL_INIT COMPONENT
18 # APP_REGKEY_SETUP = "Software\${APP_NAME}${APP_SERIES_KEY}\Setup"
19 # where ${APP_NAME}${APP_SERIES_KEY} is something like LyX16
20 ReadRegStr $ComponentPath SHELL_CONTEXT "${APP_REGKEY_SETUP}" "${COMPONENT} Path"
22 # BIN_LATEX etc are defined in settings.nsh
23 ${If} ${FileExists} "$ComponentPath\${BIN_${COMPONENT}}"
24 # set variables like PathLaTeX
25 StrCpy $Path${COMPONENT} $ComponentPath
32 # Get directories of components from registry
34 !insertmacro EXTERNAL_INIT LaTeX
38 ReadRegStr $LyXLangName SHELL_CONTEXT "${APP_REGKEY_SETUP}" "LyX Language"
40 ${If} $LyXLangName != ""
41 StrCpy $LangName $LyXLangName
46 #--------------------------------
47 # visible installer sections
49 Section "!${APP_NAME}" SecCore
52 Section "$(SecFileAssocTitle)" SecFileAssoc
53 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_FUNCTION_DESCRIPTION_END
546 #--------------------------------
547 # Installer initialization
551 ${If} ${AtLeastWinVista}
552 StrCpy $PrinterConf "printui.exe"
554 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
559 # .onInit must be here after the section definition because we have to set
560 # the selection states of the dictionary sections
564 ${OrIfNot} ${AtLeastWinXP}
565 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
569 # check that the installer is not currently running
570 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
573 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
576 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
579 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
583 !insertmacro MULTIUSER_INIT
585 # check if this LyX version is already installed
586 ${if} $MultiUser.Privileges == "Admin"
587 ${orif} $MultiUser.Privileges == "Power"
588 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
590 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
591 # handle also the case that LyX is already installed in HKLM
593 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
597 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
601 # check if there is an existing LyX installation of the same LyX series
602 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
603 IntOp $4 ${APP_VERSION_REVISION} + 20
605 ${if} $MultiUser.Privileges == "Admin"
606 ${orif} $MultiUser.Privileges == "Power"
607 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
609 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
612 StrCpy $R5 $0 # store the read version number
613 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
614 # we don't stop here because we want the latest installed version
617 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
618 # store the version number and reformat it temporarily for the error message
619 StrCpy $R0 $OldVersionNumber
620 StrCpy $OldVersionNumber $R5
621 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
622 StrCpy $OldVersionNumber $R0
626 !insertmacro PRINTER_INIT
628 # this can be reset to "true" in section SecDesktop
629 StrCpy $CreateDesktopIcon "false"
630 StrCpy $CreateFileAssociations "false"
633 # Show banner while installer is intializating
634 Banner::show /NOUNLOAD "Checking system"
640 !if ${SETUPTYPE} == BUNDLE
641 # don't let the installer sections appear when the programs are already installed
642 ${if} $PathBibTeXEditor != ""
643 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
647 # select sections of already installed spell-checker dictionaries, make them read-only
648 # and set the necessary size to 0 bytes
649 StrCpy $String $FoundDict
650 StrCpy $Search "af_ZA"
651 Call StrPoint # function from LyXUtils.nsh
652 ${if} $Pointer != "-1"
653 IntOp $0 ${SF_SELECTED} | ${SF_RO}
654 SectionSetFlags ${SecDAfrikaans} $0
655 SectionSetSize ${SecDAfrikaans} 0
657 StrCpy $Search "ar_DZ"
659 ${if} $Pointer != "-1"
660 IntOp $0 ${SF_SELECTED} | ${SF_RO}
661 SectionSetFlags ${SecDArabic} $0
662 SectionSetSize ${SecDArabic} 0
664 StrCpy $Search "hy_AM"
666 ${if} $Pointer != "-1"
667 IntOp $0 ${SF_SELECTED} | ${SF_RO}
668 SectionSetFlags ${SecDArmenian} $0
669 SectionSetSize ${SecDArmenian} 0
671 StrCpy $Search "id_ID"
673 ${if} $Pointer != "-1"
674 IntOp $0 ${SF_SELECTED} | ${SF_RO}
675 SectionSetFlags ${SecDIndonesian} $0
676 SectionSetSize ${SecDIndonesian} 0
678 StrCpy $Search "ms_MY"
680 ${if} $Pointer != "-1"
681 IntOp $0 ${SF_SELECTED} | ${SF_RO}
682 SectionSetFlags ${SecDMalayan} $0
683 SectionSetSize ${SecDMalayan} 0
685 StrCpy $Search "be_BY"
687 ${if} $Pointer != "-1"
688 IntOp $0 ${SF_SELECTED} | ${SF_RO}
689 SectionSetFlags ${SecDBelarusian} $0
690 SectionSetSize ${SecDBelarusian} 0
692 StrCpy $Search "br_FR"
694 ${if} $Pointer != "-1"
695 IntOp $0 ${SF_SELECTED} | ${SF_RO}
696 SectionSetFlags ${SecDBreton} $0
697 SectionSetSize ${SecDBreton} 0
699 StrCpy $Search "bg_BG"
701 ${if} $Pointer != "-1"
702 IntOp $0 ${SF_SELECTED} | ${SF_RO}
703 SectionSetFlags ${SecDBulgarian} $0
704 SectionSetSize ${SecDBulgarian} 0
706 StrCpy $Search "ca_ES"
708 ${if} $Pointer != "-1"
709 IntOp $0 ${SF_SELECTED} | ${SF_RO}
710 SectionSetFlags ${SecDCatalanian} $0
711 SectionSetSize ${SecDCatalanian} 0
713 StrCpy $Search "cs_CZ"
715 ${if} $Pointer != "-1"
716 IntOp $0 ${SF_SELECTED} | ${SF_RO}
717 SectionSetFlags ${SecDCzech} $0
718 SectionSetSize ${SecDCzech} 0
721 StrCpy $Search "cop_EG"
723 ${if} $Pointer != "-1"
724 IntOp $0 ${SF_SELECTED} | ${SF_RO}
725 # enable this for LyX 2.1!
726 # SectionSetFlags ${SecDCoptic} $0
727 # SectionSetSize ${SecDCoptic} 0
729 StrCpy $Search "cy_GB"
731 ${if} $Pointer != "-1"
732 IntOp $0 ${SF_SELECTED} | ${SF_RO}
733 SectionSetFlags ${SecDWelsh} $0
734 SectionSetSize ${SecDWelsh} 0
736 StrCpy $Search "da_DK"
738 ${if} $Pointer != "-1"
739 IntOp $0 ${SF_SELECTED} | ${SF_RO}
740 SectionSetFlags ${SecDDanish} $0
741 SectionSetSize ${SecDDanish} 0
743 StrCpy $Search "de_AT"
745 ${if} $Pointer != "-1"
746 IntOp $0 ${SF_SELECTED} | ${SF_RO}
747 SectionSetFlags ${SecDGermanAT} $0
748 SectionSetSize ${SecDGermanAT} 0
750 StrCpy $Search "de_CH"
752 ${if} $Pointer != "-1"
753 IntOp $0 ${SF_SELECTED} | ${SF_RO}
754 SectionSetFlags ${SecDGermanCH} $0
755 SectionSetSize ${SecDGermanCH} 0
757 StrCpy $Search "de_DE"
759 ${if} $Pointer != "-1"
760 IntOp $0 ${SF_SELECTED} | ${SF_RO}
761 SectionSetFlags ${SecDGermanD} $0
762 SectionSetSize ${SecDGermanD} 0
764 StrCpy $Search "el_GR"
766 ${if} $Pointer != "-1"
767 IntOp $0 ${SF_SELECTED} | ${SF_RO}
768 SectionSetFlags ${SecDGreek} $0
769 SectionSetSize ${SecDGreek} 0
771 StrCpy $Search "et_EE"
773 ${if} $Pointer != "-1"
774 IntOp $0 ${SF_SELECTED} | ${SF_RO}
775 SectionSetFlags ${SecDEstonian} $0
776 SectionSetSize ${SecDEstonian} 0
778 StrCpy $Search "en_AU"
780 ${if} $Pointer != "-1"
781 IntOp $0 ${SF_SELECTED} | ${SF_RO}
782 # enable this for LyX 2.1!
783 # SectionSetFlags ${SecDEnglishAU} $0
784 # SectionSetSize ${SecDEnglishAU} 0
786 StrCpy $Search "en_CA"
788 ${if} $Pointer != "-1"
789 IntOp $0 ${SF_SELECTED} | ${SF_RO}
790 SectionSetFlags ${SecDEnglishCA} $0
791 SectionSetSize ${SecDEnglishCA} 0
793 StrCpy $Search "en_GB"
795 ${if} $Pointer != "-1"
796 IntOp $0 ${SF_SELECTED} | ${SF_RO}
797 SectionSetFlags ${SecDEnglishGB} $0
798 SectionSetSize ${SecDEnglishGB} 0
800 StrCpy $Search "en_NZ"
802 ${if} $Pointer != "-1"
803 IntOp $0 ${SF_SELECTED} | ${SF_RO}
804 # enable this for LyX 2.1!
805 # SectionSetFlags ${SecDEnglishNZ} $0
806 # SectionSetSize ${SecDEnglishNZ} 0
808 StrCpy $Search "en_US"
810 ${if} $Pointer != "-1"
811 IntOp $0 ${SF_SELECTED} | ${SF_RO}
812 SectionSetFlags ${SecDEnglishUS} $0
813 SectionSetSize ${SecDEnglishUS} 0
815 StrCpy $Search "es_ES"
817 ${if} $Pointer != "-1"
818 IntOp $0 ${SF_SELECTED} | ${SF_RO}
819 SectionSetFlags ${SecDSpanishES} $0
820 SectionSetSize ${SecDSpanishES} 0
822 StrCpy $Search "es_MX"
824 ${if} $Pointer != "-1"
825 IntOp $0 ${SF_SELECTED} | ${SF_RO}
826 SectionSetFlags ${SecDSpanishMX} $0
827 SectionSetSize ${SecDSpanishMX} 0
829 StrCpy $Search "eo_EO"
831 ${if} $Pointer != "-1"
832 IntOp $0 ${SF_SELECTED} | ${SF_RO}
833 SectionSetFlags ${SecDEsperanto} $0
834 SectionSetSize ${SecDEsperanto} 0
836 StrCpy $Search "eu_ES"
838 ${if} $Pointer != "-1"
839 IntOp $0 ${SF_SELECTED} | ${SF_RO}
840 SectionSetFlags ${SecDBasque} $0
841 SectionSetSize ${SecDBasque} 0
843 StrCpy $Search "fa_IR"
845 ${if} $Pointer != "-1"
846 IntOp $0 ${SF_SELECTED} | ${SF_RO}
847 SectionSetFlags ${SecDFarsi} $0
848 SectionSetSize ${SecDFarsi} 0
850 StrCpy $Search "fr_FR"
852 ${if} $Pointer != "-1"
853 IntOp $0 ${SF_SELECTED} | ${SF_RO}
854 SectionSetFlags ${SecDFrench} $0
855 SectionSetSize ${SecDFrench} 0
857 StrCpy $Search "ga_IR"
859 ${if} $Pointer != "-1"
860 IntOp $0 ${SF_SELECTED} | ${SF_RO}
861 SectionSetFlags ${SecDGaelic} $0
862 SectionSetSize ${SecDGaelic} 0
864 StrCpy $Search "gd_GB"
866 ${if} $Pointer != "-1"
867 IntOp $0 ${SF_SELECTED} | ${SF_RO}
868 SectionSetFlags ${SecDScottish} $0
869 SectionSetSize ${SecDScottish} 0
871 StrCpy $Search "gl_ES"
873 ${if} $Pointer != "-1"
874 IntOp $0 ${SF_SELECTED} | ${SF_RO}
875 SectionSetFlags ${SecDGalician} $0
876 SectionSetSize ${SecDGalician} 0
878 StrCpy $Search "he_IL"
880 ${if} $Pointer != "-1"
881 IntOp $0 ${SF_SELECTED} | ${SF_RO}
882 SectionSetFlags ${SecDHebrew} $0
883 SectionSetSize ${SecDHebrew} 0
885 StrCpy $Search "hi_IN"
887 ${if} $Pointer != "-1"
888 IntOp $0 ${SF_SELECTED} | ${SF_RO}
889 # enable this for LyX 2.1!
890 # SectionSetFlags ${SecDHindi} $0
891 # SectionSetSize ${SecDHindi} 0
893 StrCpy $Search "hr_HR"
895 ${if} $Pointer != "-1"
896 IntOp $0 ${SF_SELECTED} | ${SF_RO}
897 SectionSetFlags ${SecDCroatian} $0
898 SectionSetSize ${SecDCroatian} 0
900 StrCpy $Search "hu_HU"
902 ${if} $Pointer != "-1"
903 IntOp $0 ${SF_SELECTED} | ${SF_RO}
904 SectionSetFlags ${SecDHungarian} $0
905 SectionSetSize ${SecDHungarian} 0
907 StrCpy $Search "ia_IA"
909 ${if} $Pointer != "-1"
910 IntOp $0 ${SF_SELECTED} | ${SF_RO}
911 SectionSetFlags ${SecDInterlingua} $0
912 SectionSetSize ${SecDInterlingua} 0
914 StrCpy $Search "is_IS"
916 ${if} $Pointer != "-1"
917 IntOp $0 ${SF_SELECTED} | ${SF_RO}
918 SectionSetFlags ${SecDIcelandic} $0
919 SectionSetSize ${SecDIcelandic} 0
921 StrCpy $Search "it_IT"
923 ${if} $Pointer != "-1"
924 IntOp $0 ${SF_SELECTED} | ${SF_RO}
925 SectionSetFlags ${SecDItalian} $0
926 SectionSetSize ${SecDItalian} 0
928 StrCpy $Search "kk_KZ"
930 ${if} $Pointer != "-1"
931 IntOp $0 ${SF_SELECTED} | ${SF_RO}
932 SectionSetFlags ${SecDKazakh} $0
933 SectionSetSize ${SecDKazakh} 0
935 StrCpy $Search "ko_KR"
937 ${if} $Pointer != "-1"
938 IntOp $0 ${SF_SELECTED} | ${SF_RO}
939 SectionSetFlags ${SecDKorean} $0
940 SectionSetSize ${SecDKorean} 0
942 StrCpy $Search "la_LA"
944 ${if} $Pointer != "-1"
945 IntOp $0 ${SF_SELECTED} | ${SF_RO}
946 SectionSetFlags ${SecDLatin} $0
947 SectionSetSize ${SecDLatin} 0
949 StrCpy $Search "lt_LT"
951 ${if} $Pointer != "-1"
952 IntOp $0 ${SF_SELECTED} | ${SF_RO}
953 SectionSetFlags ${SecDLithuanian} $0
954 SectionSetSize ${SecDLithuanian} 0
956 StrCpy $Search "lv_LV"
958 ${if} $Pointer != "-1"
959 IntOp $0 ${SF_SELECTED} | ${SF_RO}
960 SectionSetFlags ${SecDLatvian} $0
961 SectionSetSize ${SecDLatvian} 0
963 StrCpy $Search "nl_NL"
965 ${if} $Pointer != "-1"
966 IntOp $0 ${SF_SELECTED} | ${SF_RO}
967 SectionSetFlags ${SecDDutch} $0
968 SectionSetSize ${SecDDutch} 0
970 StrCpy $Search "nb_NO"
972 ${if} $Pointer != "-1"
973 IntOp $0 ${SF_SELECTED} | ${SF_RO}
974 SectionSetFlags ${SecDNorwegianNB} $0
975 SectionSetSize ${SecDNorwegianNB} 0
977 StrCpy $Search "nn_NO"
979 ${if} $Pointer != "-1"
980 IntOp $0 ${SF_SELECTED} | ${SF_RO}
981 SectionSetFlags ${SecDNorwegianNN} $0
982 SectionSetSize ${SecDNorwegianNN} 0
984 StrCpy $Search "oc_FR"
986 ${if} $Pointer != "-1"
987 IntOp $0 ${SF_SELECTED} | ${SF_RO}
988 # enable this for LyX 2.1!
989 # SectionSetFlags ${SecDOccitan} $0
990 # SectionSetSize ${SecDOccitan} 0
992 StrCpy $Search "pl_PL"
994 ${if} $Pointer != "-1"
995 IntOp $0 ${SF_SELECTED} | ${SF_RO}
996 SectionSetFlags ${SecDPolish} $0
997 SectionSetSize ${SecDPolish} 0
999 StrCpy $Search "pt_BR"
1001 ${if} $Pointer != "-1"
1002 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1003 SectionSetFlags ${SecDPortugueseBR} $0
1004 SectionSetSize ${SecDPortugueseBR} 0
1006 StrCpy $Search "pt_PT"
1008 ${if} $Pointer != "-1"
1009 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1010 SectionSetFlags ${SecDPortuguesePT} $0
1011 SectionSetSize ${SecDPortuguesePT} 0
1013 StrCpy $Search "ro_RO"
1015 ${if} $Pointer != "-1"
1016 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1017 SectionSetFlags ${SecDRomanian} $0
1018 SectionSetSize ${SecDRomanian} 0
1020 StrCpy $Search "ru_RU"
1022 ${if} $Pointer != "-1"
1023 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1024 SectionSetFlags ${SecDRussian} $0
1025 SectionSetSize ${SecDRussian} 0
1027 StrCpy $Search "dsb_DE"
1029 ${if} $Pointer != "-1"
1030 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1031 SectionSetFlags ${SecDSorbianD} $0
1032 SectionSetSize ${SecDSorbianD} 0
1034 StrCpy $Search "hsb_DE"
1036 ${if} $Pointer != "-1"
1037 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1038 SectionSetFlags ${SecDSorbianH} $0
1039 SectionSetSize ${SecDSorbianH} 0
1041 StrCpy $Search "sq_AL"
1043 ${if} $Pointer != "-1"
1044 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1045 SectionSetFlags ${SecDAlbanian} $0
1046 SectionSetSize ${SecDAlbanian} 0
1048 StrCpy $Search "sl_SI"
1050 ${if} $Pointer != "-1"
1051 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1052 SectionSetFlags ${SecDSlowenian} $0
1053 SectionSetSize ${SecDSlowenian} 0
1055 StrCpy $Search "sk_SK"
1057 ${if} $Pointer != "-1"
1058 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1059 SectionSetFlags ${SecDSlowakian} $0
1060 SectionSetSize ${SecDSlowakian} 0
1062 StrCpy $Search "sr_RS"
1064 ${if} $Pointer != "-1"
1065 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1066 SectionSetFlags ${SecDSerbian} $0
1067 SectionSetSize ${SecDSerbian} 0
1069 StrCpy $Search "sv_SE"
1071 ${if} $Pointer != "-1"
1072 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1073 SectionSetFlags ${SecDSwedish} $0
1074 SectionSetSize ${SecDSwedish} 0
1076 StrCpy $Search "ta_IN"
1078 ${if} $Pointer != "-1"
1079 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1080 # enable this for LyX 2.1!
1081 # SectionSetFlags ${SecDTamil} $0
1082 # SectionSetSize ${SecDTamil} 0
1084 StrCpy $Search "te_IN"
1086 ${if} $Pointer != "-1"
1087 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1088 # enable this for LyX 2.1!
1089 # SectionSetFlags ${SecDTelugu} $0
1090 # SectionSetSize ${SecDTelugu} 0
1092 StrCpy $Search "th_TH"
1094 ${if} $Pointer != "-1"
1095 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1096 SectionSetFlags ${SecDThai} $0
1097 SectionSetSize ${SecDThai} 0
1099 StrCpy $Search "uk_UA"
1101 ${if} $Pointer != "-1"
1102 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1103 SectionSetFlags ${SecDUkrainian} $0
1104 SectionSetSize ${SecDUkrainian} 0
1106 StrCpy $Search "ur_PK"
1108 ${if} $Pointer != "-1"
1109 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1110 # enable this for LyX 2.1!
1111 # SectionSetFlags ${SecDUrdu} $0
1112 # SectionSetSize ${SecDUrdu} 0
1114 StrCpy $Search "vi_VN"
1116 ${if} $Pointer != "-1"
1117 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1118 SectionSetFlags ${SecDVietnamese} $0
1119 SectionSetSize ${SecDVietnamese} 0
1122 # select sections of already installed thesaurus dictionaries, make them read-only
1123 # and set the necessary size to 0 bytes
1124 StrCpy $String $FoundThes
1125 StrCpy $Search "bg_BG"
1126 Call StrPoint # function from LyXUtils.nsh
1127 ${if} $Pointer != "-1"
1128 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1129 SectionSetFlags ${SecTBulgarian} $0
1130 SectionSetSize ${SecTBulgarian} 0
1132 StrCpy $Search "ca_ES"
1134 ${if} $Pointer != "-1"
1135 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1136 SectionSetFlags ${SecTCatalan} $0
1137 SectionSetSize ${SecTCatalan} 0
1139 StrCpy $Search "cs_CZ"
1141 ${if} $Pointer != "-1"
1142 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1143 SectionSetFlags ${SecTCzech} $0
1144 SectionSetSize ${SecTCzech} 0
1146 StrCpy $Search "da_DK"
1148 ${if} $Pointer != "-1"
1149 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1150 SectionSetFlags ${SecTDanish} $0
1151 SectionSetSize ${SecTDanish} 0
1153 StrCpy $Search "de_DE"
1155 ${if} $Pointer != "-1"
1156 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1157 SectionSetFlags ${SecTGermanDA} $0
1158 SectionSetSize ${SecTGermanDA} 0
1160 StrCpy $Search "de_CH"
1162 ${if} $Pointer != "-1"
1163 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1164 SectionSetFlags ${SecTGermanCH} $0
1165 SectionSetSize ${SecTGermanCH} 0
1167 StrCpy $Search "en_GB"
1169 ${if} $Pointer != "-1"
1170 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1171 SectionSetFlags ${SecTEnglishGB} $0
1172 SectionSetSize ${SecTEnglishGB} 0
1174 StrCpy $Search "en_US"
1176 ${if} $Pointer != "-1"
1177 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1178 SectionSetFlags ${SecTEnglishUSAU} $0
1179 SectionSetSize ${SecTEnglishUSAU} 0
1181 StrCpy $Search "es_ES"
1183 ${if} $Pointer != "-1"
1184 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1185 SectionSetFlags ${SecTSpanish} $0
1186 SectionSetSize ${SecTSpanish} 0
1188 StrCpy $Search "fr_FR"
1190 ${if} $Pointer != "-1"
1191 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1192 SectionSetFlags ${SecTFrench} $0
1193 SectionSetSize ${SecTFrench} 0
1195 StrCpy $Search "ga_IR"
1197 ${if} $Pointer != "-1"
1198 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1199 SectionSetFlags ${SecTGaelic} $0
1200 SectionSetSize ${SecTGaelic} 0
1202 StrCpy $Search "el_GR"
1204 ${if} $Pointer != "-1"
1205 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1206 SectionSetFlags ${SecTGreek} $0
1207 SectionSetSize ${SecTGreek} 0
1209 StrCpy $Search "it_IT"
1211 ${if} $Pointer != "-1"
1212 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1213 SectionSetFlags ${SecTItalian} $0
1214 SectionSetSize ${SecTItalian} 0
1216 StrCpy $Search "hu_HU"
1218 ${if} $Pointer != "-1"
1219 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1220 SectionSetFlags ${SecTHungarian} $0
1221 SectionSetSize ${SecTHungarian} 0
1223 StrCpy $Search "no_NO"
1225 ${if} $Pointer != "-1"
1226 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1227 SectionSetFlags ${SecTNorwegian} $0
1228 SectionSetSize ${SecTNorwegian} 0
1230 StrCpy $Search "pl_PL"
1232 ${if} $Pointer != "-1"
1233 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1234 SectionSetFlags ${SecTPolish} $0
1235 SectionSetSize ${SecTPolish} 0
1237 StrCpy $Search "pt_PT"
1239 ${if} $Pointer != "-1"
1240 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1241 SectionSetFlags ${SecTPortuguese} $0
1242 SectionSetSize ${SecTPortuguese} 0
1244 StrCpy $Search "ro_RO"
1246 ${if} $Pointer != "-1"
1247 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1248 SectionSetFlags ${SecTRomanian} $0
1249 SectionSetSize ${SecTRomanian} 0
1251 StrCpy $Search "ru_RU"
1253 ${if} $Pointer != "-1"
1254 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1255 SectionSetFlags ${SecTRussian} $0
1256 SectionSetSize ${SecTRussian} 0
1258 StrCpy $Search "sl_SI"
1260 ${if} $Pointer != "-1"
1261 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1262 SectionSetFlags ${SecTSlowenian} $0
1263 SectionSetSize ${SecTSlowenian} 0
1265 StrCpy $Search "sk_SK"
1267 ${if} $Pointer != "-1"
1268 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1269 SectionSetFlags ${SecTSlowakian} $0
1270 SectionSetSize ${SecTSlowakian} 0
1272 StrCpy $Search "sv_SE"
1274 ${if} $Pointer != "-1"
1275 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1276 SectionSetFlags ${SecTSwedish} $0
1277 SectionSetSize ${SecTSwedish} 0
1286 # this function is called at first after starting the uninstaller
1289 !insertmacro PRINTER_INIT
1290 !insertmacro MULTIUSER_UNINIT
1292 # Check that LyX is not currently running
1293 FindProcDLL::FindProc "lyx.exe"
1295 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1299 # set registry root key
1300 ${if} $MultiUser.Privileges == "Admin"
1301 ${orif} $MultiUser.Privileges == "Power"
1302 SetShellVarContext all
1304 SetShellVarContext current
1307 # Ascertain whether the user has sufficient privileges to uninstall.
1308 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1309 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1311 ${andif} $MultiUser.Privileges != "Admin"
1312 ${andif} $MultiUser.Privileges != "Power"
1313 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1316 # abort when LyX couldn't be found in the registry
1317 ${if} $0 == "" # check in HKCU
1318 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1320 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1324 # Macro to investigate name of LyX's preferences folders to be able remove them
1325 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1327 # test if MiKTeX was installed together with LyX
1328 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1329 ${if} $0 == "Yes${APP_SERIES_KEY}"
1330 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1331 StrCpy $LaTeXInstalled "MiKTeX"
1332 DeleteRegValue SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1334 SectionSetText 2 "" # hides the corresponding uninstaller section
1337 # test if JabRef was installed together with LyX
1338 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1339 ${if} $0 == "Yes${APP_SERIES_KEY}"
1340 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1341 StrCpy $JabRefInstalled "Yes"
1342 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
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