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 # 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
71 Section /o "Afrikaans" SecDAfrikaans
72 StrCpy $DictCodes "af_ZA,$DictCodes"
76 Section /o "Arabic" SecDArabic
77 StrCpy $DictCodes "ar_DZ,$DictCodes"
81 Section /o "Armenian" SecDArmenian
82 StrCpy $DictCodes "hy_AM,$DictCodes"
86 Section /o "Bahasa Indonesia" SecDIndonesian
87 StrCpy $DictCodes "id_ID,$DictCodes"
91 Section /o "Bahasa Melayu" SecDMalayan
92 StrCpy $DictCodes "ms_MY,$DictCodes"
96 Section /o "Belarusian" SecDBelarusian
97 StrCpy $DictCodes "be_BY,$DictCodes"
101 Section /o "Brezhoneg" SecDBreton
102 StrCpy $DictCodes "br_FR,$DictCodes"
106 Section /o "Bulgarian" SecDBulgarian
107 StrCpy $DictCodes "bg_BG,$DictCodes"
111 Section /o "Català" SecDCatalanian
112 StrCpy $DictCodes "ca_ES,$DictCodes"
116 Section /o "Ce
\9atina" SecDCzech
117 StrCpy $DictCodes "cs_CZ,$DictCodes"
121 # enable this for LyX 2.1!
122 #Section /o "Coptic" SecDCoptic
123 # StrCpy $DictCodes "cop_EG,$DictCodes"
127 Section /o "Cymraeg" SecDWelsh
128 StrCpy $DictCodes "cy_GB,$DictCodes"
132 Section /o "Dansk" SecDDanish
133 StrCpy $DictCodes "da_DK,$DictCodes"
137 Section /o "German (A)" SecDGermanAT
138 StrCpy $DictCodes "de_AT,$DictCodes"
142 Section /o "German (CH)" SecDGermanCH
143 StrCpy $DictCodes "de_CH,$DictCodes"
147 Section "German (D)" SecDGermanD
148 # already installed by default
150 #StrCpy $DictCodes "de_DE,$DictCodes"
154 Section /o "Greek" SecDGreek
155 StrCpy $DictCodes "el_GR,$DictCodes"
159 Section /o "Eesti" SecDEstonian
160 StrCpy $DictCodes "et_EE,$DictCodes"
164 # enable this for LyX 2.1!
165 #Section /o "English (AU)" SecDEnglishAU
166 # StrCpy $DictCodes "en_AU,$DictCodes"
170 Section /o "English (CA)" SecDEnglishCA
171 StrCpy $DictCodes "en_CA,$DictCodes"
175 Section "English (GB)" SecDEnglishGB
176 # already installed by default
178 #StrCpy $DictCodes "en_GB,$DictCodes"
182 # enable this for LyX 2.1!
183 #Section /o "English (NZ)" SecDEnglishNZ
184 # StrCpy $DictCodes "en_NZ,$DictCodes"
188 Section "English (US)" SecDEnglishUS
189 # already installed by default
191 #StrCpy $DictCodes "en_US,$DictCodes"
195 Section "Español (ES)" SecDSpanishES
196 # already installed by default
198 #StrCpy $DictCodes "es_ES,$DictCodes"
202 Section "Español (MX)" SecDSpanishMX
203 # already installed by default
205 #StrCpy $DictCodes "es_MX,$DictCodes"
209 Section /o "Esperanto" SecDEsperanto
210 StrCpy $DictCodes "eo_EO,$DictCodes"
214 Section /o "Euskara" SecDBasque
215 StrCpy $DictCodes "eu_ES,$DictCodes"
219 Section /o "Farsi" SecDFarsi
220 StrCpy $DictCodes "fa_IR,$DictCodes"
224 Section "Français" SecDFrench
225 # already installed by default
227 #StrCpy $DictCodes "fr_FR,$DictCodes"
231 Section /o "Français (Canada)" SecDFrenchCanada
232 StrCpy $DictCodes "fr_CA,$DictCodes"
236 Section /o "Gaeilge" SecDGaelic
237 StrCpy $DictCodes "ga_IR,$DictCodes"
241 Section /o "Gàidhlig" SecDScottish
242 StrCpy $DictCodes "gd_GB,$DictCodes"
246 Section /o "Galego" SecDGalician
247 StrCpy $DictCodes "gl_ES,$DictCodes"
251 Section /o "Hebrew" SecDHebrew
252 StrCpy $DictCodes "he_IL,$DictCodes"
256 Section /o "Hrvatski" SecDCroatian
257 StrCpy $DictCodes "hr_HR,$DictCodes"
261 Section /o "Magyar" SecDHungarian
262 StrCpy $DictCodes "hu_HU,$DictCodes"
266 # enable this for LyX 2.1!
267 #Section /o "Hindi" SecDHindi
268 # StrCpy $DictCodes "hi_IN,$DictCodes"
272 Section /o "Interlingua" SecDInterlingua
273 StrCpy $DictCodes "ia_IA,$DictCodes"
277 Section /o "Íslenska" SecDIcelandic
278 StrCpy $DictCodes "is_IS,$DictCodes"
282 Section /o "Italiano" SecDItalian
283 StrCpy $DictCodes "it_IT,$DictCodes"
287 Section /o "Kazakh" SecDKazakh
288 StrCpy $DictCodes "kk_KZ,$DictCodes"
292 Section /o "Korean" SecDKorean
293 StrCpy $DictCodes "ko_KR,$DictCodes"
297 Section /o "Latina" SecDLatin
298 StrCpy $DictCodes "la_LA,$DictCodes"
302 Section /o "Lietuviu" SecDLithuanian
303 StrCpy $DictCodes "lt_LT,$DictCodes"
307 Section /o "Latvie
\9au" SecDLatvian
308 StrCpy $DictCodes "lv_LV,$DictCodes"
312 # enable this for LyX 2.1!
313 #Section /o "Marathi" SecDMarathi
314 # StrCpy $DictCodes "mr_IN,$DictCodes"
318 Section /o "Nederlands" SecDDutch
319 StrCpy $DictCodes "nl_NL,$DictCodes"
323 Section /o "Norsk (Bokmål)" SecDNorwegianNB
324 StrCpy $DictCodes "nb_NO,$DictCodes"
328 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
329 StrCpy $DictCodes "nn_NO,$DictCodes"
333 # enable this for LyX 2.1!
334 #Section /o "Occitan" SecDOccitan
335 # StrCpy $DictCodes "oc_FR,$DictCodes"
339 Section /o "Polski" SecDPolish
340 StrCpy $DictCodes "pl_PL,$DictCodes"
344 Section /o "Português (BR)" SecDPortugueseBR
345 StrCpy $DictCodes "pt_BR,$DictCodes"
349 Section /o "Português (PT)" SecDPortuguesePT
350 StrCpy $DictCodes "pt_PT,$DictCodes"
354 Section /o "Româna" SecDRomanian
355 StrCpy $DictCodes "ro_RO,$DictCodes"
359 Section /o "Russian" SecDRussian
360 StrCpy $DictCodes "ru_RU,$DictCodes"
364 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
365 StrCpy $DictCodes "dsb_DE,$DictCodes"
369 Section /o "Serb
\9acina (Horno)" SecDSorbianH
370 StrCpy $DictCodes "hsb_DE,$DictCodes"
374 Section /o "Shqipe" SecDAlbanian
375 StrCpy $DictCodes "sq_AL,$DictCodes"
379 Section /o "Sloven
\9acina" SecDSlovenian
380 StrCpy $DictCodes "sl_SI,$DictCodes"
384 Section /o "Slovenský" SecDSlovakian
385 StrCpy $DictCodes "sk_SK,$DictCodes"
389 Section /o "Srpski (Cirilica)" SecDSerbianC
390 StrCpy $DictCodes "sr_RS,$DictCodes"
394 Section /o "Srpski (Latinica)" SecDSerbianL
395 StrCpy $DictCodes "sr_RS-Latin,$DictCodes"
399 Section /o "Svenska" SecDSwedish
400 StrCpy $DictCodes "sv_SE,$DictCodes"
404 # enable this for LyX 2.1!
405 #Section /o "Tamil" SecDTamil
406 # StrCpy $DictCodes "ta_IN,$DictCodes"
410 # enable this for LyX 2.1!
411 #Section /o "Telugu" SecDTelugu
412 # StrCpy $DictCodes "te_IN,$DictCodes"
416 Section /o "Thai" SecDThai
417 StrCpy $DictCodes "th_TH,$DictCodes"
421 Section /o "Ukrainian" SecDUkrainian
422 StrCpy $DictCodes "uk_UA,$DictCodes"
426 # enable this for LyX 2.1!
427 #Section /o "Urdu" SecDUrdu
428 # StrCpy $DictCodes "ur_PK,$DictCodes"
432 Section /o "Vietnamese" SecDVietnamese
433 StrCpy $DictCodes "vi_VN,$DictCodes"
440 SectionGroup "Thesaurus" SecThesaurus
442 Section /o "Bulgarian" SecTBulgarian
443 StrCpy $ThesCodes "bg_BG,$ThesCodes"
447 Section /o "Català" SecTCatalan
448 StrCpy $ThesCodes "ca_ES,$ThesCodes"
452 Section /o "Ce
\9atina" SecTCzech
453 StrCpy $ThesCodes "cs_CZ,$ThesCodes"
457 Section /o "Dansk" SecTDanish
458 StrCpy $ThesCodes "da_DK,$ThesCodes"
462 Section /o "Deutsch (D/A)" SecTGermanDA
463 StrCpy $ThesCodes "de_DE,$ThesCodes"
467 Section /o "Deutsch (CH)" SecTGermanCH
468 StrCpy $ThesCodes "de_CH,$ThesCodes"
472 Section /o "English (GB)" SecTEnglishGB
473 StrCpy $ThesCodes "en_GB,$ThesCodes"
477 Section /o "English (US/AU)" SecTEnglishUSAU
478 StrCpy $ThesCodes "en_US,$ThesCodes"
482 Section /o "Español" SecTSpanish
483 StrCpy $ThesCodes "es_ES,$ThesCodes"
487 Section /o "Français" SecTFrench
488 StrCpy $ThesCodes "fr_FR,$ThesCodes"
492 Section /o "Gaeilge" SecTGaelic
493 StrCpy $ThesCodes "ga_IR,$ThesCodes"
497 Section /o "Greek" SecTGreek
498 StrCpy $ThesCodes "el_GR,$ThesCodes"
502 Section /o "Íslenska" SecTIcelandic
503 StrCpy $ThesCodes "is_IS,$ThesCodes"
507 Section /o "Italiano" SecTItalian
508 StrCpy $ThesCodes "it_IT,$ThesCodes"
512 Section /o "Magyar" SecTHungarian
513 StrCpy $ThesCodes "hu_HU,$ThesCodes"
517 Section /o "Norsk (Bokmål)" SecTNorwegianNB
518 StrCpy $ThesCodes "nb_NO,$ThesCodes"
522 Section /o "Polski" SecTPolish
523 StrCpy $ThesCodes "pl_PL,$ThesCodes"
527 Section /o "Português" SecTPortuguese
528 StrCpy $ThesCodes "pt_PT,$ThesCodes"
532 Section /o "Româna" SecTRomanian
533 StrCpy $ThesCodes "ro_RO,$ThesCodes"
537 Section /o "Russian" SecTRussian
538 StrCpy $ThesCodes "ru_RU,$ThesCodes"
542 Section /o "Sloven
\9acina" SecTSlovenian
543 StrCpy $ThesCodes "sl_SI,$ThesCodes"
547 Section /o "Slovenský" SecTSlovakian
548 StrCpy $ThesCodes "sk_SK,$ThesCodes"
552 Section /o "Svenska" SecTSwedish
553 StrCpy $ThesCodes "sv_SE,$ThesCodes"
557 Section /o "Ukrainian" SecTUkrainian
558 StrCpy $ThesCodes "uk_UA,$ThesCodes"
564 # Section descriptions
565 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
566 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
567 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
568 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
569 !if ${SETUPTYPE} == BUNDLE
570 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
572 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
573 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
574 !insertmacro MUI_FUNCTION_DESCRIPTION_END
577 #--------------------------------
578 # Installer initialization
582 ${If} ${AtLeastWinVista}
583 StrCpy $PrinterConf "printui.exe"
585 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
590 # .onInit must be here after the section definition because we have to set
591 # the selection states of the dictionary sections
595 ${OrIfNot} ${AtLeastWinXP}
596 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
600 # check that the installer is not currently running
601 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
604 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
607 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
610 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
614 !insertmacro MULTIUSER_INIT
616 # check if this LyX version is already installed
617 ${if} $MultiUser.Privileges == "Admin"
618 ${orif} $MultiUser.Privileges == "Power"
619 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
621 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
622 # handle also the case that LyX is already installed in HKLM
624 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
628 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
632 # check if there is an existing LyX installation of the same LyX series
633 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
634 IntOp $4 ${APP_VERSION_REVISION} + 20
636 ${if} $MultiUser.Privileges == "Admin"
637 ${orif} $MultiUser.Privileges == "Power"
638 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
639 # also check for an emergency release
641 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
644 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
645 # also check for an emergency release
647 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
651 StrCpy $R5 $0 # store the read version number
652 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
653 # we don't stop here because we want the latest installed version
656 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
657 # store the version number and reformat it temporarily for the error message
658 StrCpy $R0 $OldVersionNumber
659 StrCpy $OldVersionNumber $R5
660 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
661 StrCpy $OldVersionNumber $R0
665 !insertmacro PRINTER_INIT
667 # this can be reset to "true" in section SecDesktop
668 StrCpy $CreateDesktopIcon "false"
669 StrCpy $CreateFileAssociations "false"
672 # Show banner while installer is intializating
673 Banner::show /NOUNLOAD "Checking system"
678 !if ${SETUPTYPE} == BUNDLE
679 # don't let the installer sections appear when the programs are already installed
680 ${if} $PathBibTeXEditor != ""
681 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
685 # select sections of already installed spell-checker dictionaries, make them read-only
686 # and set the necessary size to 0 bytes
687 StrCpy $String $FoundDict
688 StrCpy $Search "af_ZA"
689 Call StrPoint # function from LyXUtils.nsh
690 ${if} $Pointer != "-1"
691 IntOp $0 ${SF_SELECTED} | ${SF_RO}
692 SectionSetFlags ${SecDAfrikaans} $0
693 SectionSetSize ${SecDAfrikaans} 0
695 StrCpy $Search "ar_DZ"
697 ${if} $Pointer != "-1"
698 IntOp $0 ${SF_SELECTED} | ${SF_RO}
699 SectionSetFlags ${SecDArabic} $0
700 SectionSetSize ${SecDArabic} 0
702 StrCpy $Search "hy_AM"
704 ${if} $Pointer != "-1"
705 IntOp $0 ${SF_SELECTED} | ${SF_RO}
706 SectionSetFlags ${SecDArmenian} $0
707 SectionSetSize ${SecDArmenian} 0
709 StrCpy $Search "id_ID"
711 ${if} $Pointer != "-1"
712 IntOp $0 ${SF_SELECTED} | ${SF_RO}
713 SectionSetFlags ${SecDIndonesian} $0
714 SectionSetSize ${SecDIndonesian} 0
716 StrCpy $Search "ms_MY"
718 ${if} $Pointer != "-1"
719 IntOp $0 ${SF_SELECTED} | ${SF_RO}
720 SectionSetFlags ${SecDMalayan} $0
721 SectionSetSize ${SecDMalayan} 0
723 StrCpy $Search "be_BY"
725 ${if} $Pointer != "-1"
726 IntOp $0 ${SF_SELECTED} | ${SF_RO}
727 SectionSetFlags ${SecDBelarusian} $0
728 SectionSetSize ${SecDBelarusian} 0
730 StrCpy $Search "br_FR"
732 ${if} $Pointer != "-1"
733 IntOp $0 ${SF_SELECTED} | ${SF_RO}
734 SectionSetFlags ${SecDBreton} $0
735 SectionSetSize ${SecDBreton} 0
737 StrCpy $Search "bg_BG"
739 ${if} $Pointer != "-1"
740 IntOp $0 ${SF_SELECTED} | ${SF_RO}
741 SectionSetFlags ${SecDBulgarian} $0
742 SectionSetSize ${SecDBulgarian} 0
744 StrCpy $Search "ca_ES"
746 ${if} $Pointer != "-1"
747 IntOp $0 ${SF_SELECTED} | ${SF_RO}
748 SectionSetFlags ${SecDCatalanian} $0
749 SectionSetSize ${SecDCatalanian} 0
751 StrCpy $Search "cs_CZ"
753 ${if} $Pointer != "-1"
754 IntOp $0 ${SF_SELECTED} | ${SF_RO}
755 SectionSetFlags ${SecDCzech} $0
756 SectionSetSize ${SecDCzech} 0
759 StrCpy $Search "cop_EG"
761 ${if} $Pointer != "-1"
762 IntOp $0 ${SF_SELECTED} | ${SF_RO}
763 # enable this for LyX 2.1!
764 # SectionSetFlags ${SecDCoptic} $0
765 # SectionSetSize ${SecDCoptic} 0
767 StrCpy $Search "cy_GB"
769 ${if} $Pointer != "-1"
770 IntOp $0 ${SF_SELECTED} | ${SF_RO}
771 SectionSetFlags ${SecDWelsh} $0
772 SectionSetSize ${SecDWelsh} 0
774 StrCpy $Search "da_DK"
776 ${if} $Pointer != "-1"
777 IntOp $0 ${SF_SELECTED} | ${SF_RO}
778 SectionSetFlags ${SecDDanish} $0
779 SectionSetSize ${SecDDanish} 0
781 StrCpy $Search "de_AT"
783 ${if} $Pointer != "-1"
784 IntOp $0 ${SF_SELECTED} | ${SF_RO}
785 SectionSetFlags ${SecDGermanAT} $0
786 SectionSetSize ${SecDGermanAT} 0
788 StrCpy $Search "de_CH"
790 ${if} $Pointer != "-1"
791 IntOp $0 ${SF_SELECTED} | ${SF_RO}
792 SectionSetFlags ${SecDGermanCH} $0
793 SectionSetSize ${SecDGermanCH} 0
795 StrCpy $Search "de_DE"
797 ${if} $Pointer != "-1"
798 IntOp $0 ${SF_SELECTED} | ${SF_RO}
799 SectionSetFlags ${SecDGermanD} $0
800 SectionSetSize ${SecDGermanD} 0
802 StrCpy $Search "el_GR"
804 ${if} $Pointer != "-1"
805 IntOp $0 ${SF_SELECTED} | ${SF_RO}
806 SectionSetFlags ${SecDGreek} $0
807 SectionSetSize ${SecDGreek} 0
809 StrCpy $Search "et_EE"
811 ${if} $Pointer != "-1"
812 IntOp $0 ${SF_SELECTED} | ${SF_RO}
813 SectionSetFlags ${SecDEstonian} $0
814 SectionSetSize ${SecDEstonian} 0
816 StrCpy $Search "en_AU"
818 ${if} $Pointer != "-1"
819 IntOp $0 ${SF_SELECTED} | ${SF_RO}
820 # enable this for LyX 2.1!
821 # SectionSetFlags ${SecDEnglishAU} $0
822 # SectionSetSize ${SecDEnglishAU} 0
824 StrCpy $Search "en_CA"
826 ${if} $Pointer != "-1"
827 IntOp $0 ${SF_SELECTED} | ${SF_RO}
828 SectionSetFlags ${SecDEnglishCA} $0
829 SectionSetSize ${SecDEnglishCA} 0
831 StrCpy $Search "en_GB"
833 ${if} $Pointer != "-1"
834 IntOp $0 ${SF_SELECTED} | ${SF_RO}
835 SectionSetFlags ${SecDEnglishGB} $0
836 SectionSetSize ${SecDEnglishGB} 0
838 StrCpy $Search "en_NZ"
840 ${if} $Pointer != "-1"
841 IntOp $0 ${SF_SELECTED} | ${SF_RO}
842 # enable this for LyX 2.1!
843 # SectionSetFlags ${SecDEnglishNZ} $0
844 # SectionSetSize ${SecDEnglishNZ} 0
846 StrCpy $Search "en_US"
848 ${if} $Pointer != "-1"
849 IntOp $0 ${SF_SELECTED} | ${SF_RO}
850 SectionSetFlags ${SecDEnglishUS} $0
851 SectionSetSize ${SecDEnglishUS} 0
853 StrCpy $Search "es_ES"
855 ${if} $Pointer != "-1"
856 IntOp $0 ${SF_SELECTED} | ${SF_RO}
857 SectionSetFlags ${SecDSpanishES} $0
858 SectionSetSize ${SecDSpanishES} 0
860 StrCpy $Search "es_MX"
862 ${if} $Pointer != "-1"
863 IntOp $0 ${SF_SELECTED} | ${SF_RO}
864 SectionSetFlags ${SecDSpanishMX} $0
865 SectionSetSize ${SecDSpanishMX} 0
867 StrCpy $Search "eo_EO"
869 ${if} $Pointer != "-1"
870 IntOp $0 ${SF_SELECTED} | ${SF_RO}
871 SectionSetFlags ${SecDEsperanto} $0
872 SectionSetSize ${SecDEsperanto} 0
874 StrCpy $Search "eu_ES"
876 ${if} $Pointer != "-1"
877 IntOp $0 ${SF_SELECTED} | ${SF_RO}
878 SectionSetFlags ${SecDBasque} $0
879 SectionSetSize ${SecDBasque} 0
881 StrCpy $Search "fa_IR"
883 ${if} $Pointer != "-1"
884 IntOp $0 ${SF_SELECTED} | ${SF_RO}
885 SectionSetFlags ${SecDFarsi} $0
886 SectionSetSize ${SecDFarsi} 0
888 StrCpy $Search "fr_CA"
890 ${if} $Pointer != "-1"
891 IntOp $0 ${SF_SELECTED} | ${SF_RO}
892 SectionSetFlags ${SecDFrenchCanada} $0
893 SectionSetSize ${SecDFrenchCanada} 0
895 StrCpy $Search "fr_FR"
897 ${if} $Pointer != "-1"
898 IntOp $0 ${SF_SELECTED} | ${SF_RO}
899 SectionSetFlags ${SecDFrench} $0
900 SectionSetSize ${SecDFrench} 0
902 StrCpy $Search "ga_IR"
904 ${if} $Pointer != "-1"
905 IntOp $0 ${SF_SELECTED} | ${SF_RO}
906 SectionSetFlags ${SecDGaelic} $0
907 SectionSetSize ${SecDGaelic} 0
909 StrCpy $Search "gd_GB"
911 ${if} $Pointer != "-1"
912 IntOp $0 ${SF_SELECTED} | ${SF_RO}
913 SectionSetFlags ${SecDScottish} $0
914 SectionSetSize ${SecDScottish} 0
916 StrCpy $Search "gl_ES"
918 ${if} $Pointer != "-1"
919 IntOp $0 ${SF_SELECTED} | ${SF_RO}
920 SectionSetFlags ${SecDGalician} $0
921 SectionSetSize ${SecDGalician} 0
923 StrCpy $Search "he_IL"
925 ${if} $Pointer != "-1"
926 IntOp $0 ${SF_SELECTED} | ${SF_RO}
927 SectionSetFlags ${SecDHebrew} $0
928 SectionSetSize ${SecDHebrew} 0
930 StrCpy $Search "hi_IN"
932 ${if} $Pointer != "-1"
933 IntOp $0 ${SF_SELECTED} | ${SF_RO}
934 # enable this for LyX 2.1!
935 # SectionSetFlags ${SecDHindi} $0
936 # SectionSetSize ${SecDHindi} 0
938 StrCpy $Search "hr_HR"
940 ${if} $Pointer != "-1"
941 IntOp $0 ${SF_SELECTED} | ${SF_RO}
942 SectionSetFlags ${SecDCroatian} $0
943 SectionSetSize ${SecDCroatian} 0
945 StrCpy $Search "hu_HU"
947 ${if} $Pointer != "-1"
948 IntOp $0 ${SF_SELECTED} | ${SF_RO}
949 SectionSetFlags ${SecDHungarian} $0
950 SectionSetSize ${SecDHungarian} 0
952 StrCpy $Search "ia_IA"
954 ${if} $Pointer != "-1"
955 IntOp $0 ${SF_SELECTED} | ${SF_RO}
956 SectionSetFlags ${SecDInterlingua} $0
957 SectionSetSize ${SecDInterlingua} 0
959 StrCpy $Search "is_IS"
961 ${if} $Pointer != "-1"
962 IntOp $0 ${SF_SELECTED} | ${SF_RO}
963 SectionSetFlags ${SecDIcelandic} $0
964 SectionSetSize ${SecDIcelandic} 0
966 StrCpy $Search "it_IT"
968 ${if} $Pointer != "-1"
969 IntOp $0 ${SF_SELECTED} | ${SF_RO}
970 SectionSetFlags ${SecDItalian} $0
971 SectionSetSize ${SecDItalian} 0
973 StrCpy $Search "kk_KZ"
975 ${if} $Pointer != "-1"
976 IntOp $0 ${SF_SELECTED} | ${SF_RO}
977 SectionSetFlags ${SecDKazakh} $0
978 SectionSetSize ${SecDKazakh} 0
980 StrCpy $Search "ko_KR"
982 ${if} $Pointer != "-1"
983 IntOp $0 ${SF_SELECTED} | ${SF_RO}
984 SectionSetFlags ${SecDKorean} $0
985 SectionSetSize ${SecDKorean} 0
987 StrCpy $Search "la_LA"
989 ${if} $Pointer != "-1"
990 IntOp $0 ${SF_SELECTED} | ${SF_RO}
991 SectionSetFlags ${SecDLatin} $0
992 SectionSetSize ${SecDLatin} 0
994 StrCpy $Search "lt_LT"
996 ${if} $Pointer != "-1"
997 IntOp $0 ${SF_SELECTED} | ${SF_RO}
998 SectionSetFlags ${SecDLithuanian} $0
999 SectionSetSize ${SecDLithuanian} 0
1001 StrCpy $Search "lv_LV"
1003 ${if} $Pointer != "-1"
1004 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1005 SectionSetFlags ${SecDLatvian} $0
1006 SectionSetSize ${SecDLatvian} 0
1008 StrCpy $Search "nl_NL"
1010 ${if} $Pointer != "-1"
1011 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1012 SectionSetFlags ${SecDDutch} $0
1013 SectionSetSize ${SecDDutch} 0
1015 StrCpy $Search "nb_NO"
1017 ${if} $Pointer != "-1"
1018 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1019 SectionSetFlags ${SecDNorwegianNB} $0
1020 SectionSetSize ${SecDNorwegianNB} 0
1022 StrCpy $Search "nn_NO"
1024 ${if} $Pointer != "-1"
1025 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1026 SectionSetFlags ${SecDNorwegianNN} $0
1027 SectionSetSize ${SecDNorwegianNN} 0
1029 StrCpy $Search "oc_FR"
1031 ${if} $Pointer != "-1"
1032 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1033 # enable this for LyX 2.1!
1034 # SectionSetFlags ${SecDOccitan} $0
1035 # SectionSetSize ${SecDOccitan} 0
1037 StrCpy $Search "pl_PL"
1039 ${if} $Pointer != "-1"
1040 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1041 SectionSetFlags ${SecDPolish} $0
1042 SectionSetSize ${SecDPolish} 0
1044 StrCpy $Search "pt_BR"
1046 ${if} $Pointer != "-1"
1047 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1048 SectionSetFlags ${SecDPortugueseBR} $0
1049 SectionSetSize ${SecDPortugueseBR} 0
1051 StrCpy $Search "pt_PT"
1053 ${if} $Pointer != "-1"
1054 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1055 SectionSetFlags ${SecDPortuguesePT} $0
1056 SectionSetSize ${SecDPortuguesePT} 0
1058 StrCpy $Search "ro_RO"
1060 ${if} $Pointer != "-1"
1061 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1062 SectionSetFlags ${SecDRomanian} $0
1063 SectionSetSize ${SecDRomanian} 0
1065 StrCpy $Search "ru_RU"
1067 ${if} $Pointer != "-1"
1068 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1069 SectionSetFlags ${SecDRussian} $0
1070 SectionSetSize ${SecDRussian} 0
1072 StrCpy $Search "dsb_DE"
1074 ${if} $Pointer != "-1"
1075 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1076 SectionSetFlags ${SecDSorbianD} $0
1077 SectionSetSize ${SecDSorbianD} 0
1079 StrCpy $Search "hsb_DE"
1081 ${if} $Pointer != "-1"
1082 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1083 SectionSetFlags ${SecDSorbianH} $0
1084 SectionSetSize ${SecDSorbianH} 0
1086 StrCpy $Search "sq_AL"
1088 ${if} $Pointer != "-1"
1089 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1090 SectionSetFlags ${SecDAlbanian} $0
1091 SectionSetSize ${SecDAlbanian} 0
1093 StrCpy $Search "sl_SI"
1095 ${if} $Pointer != "-1"
1096 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1097 SectionSetFlags ${SecDSlovenian} $0
1098 SectionSetSize ${SecDSlovenian} 0
1100 StrCpy $Search "sk_SK"
1102 ${if} $Pointer != "-1"
1103 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1104 SectionSetFlags ${SecDSlovakian} $0
1105 SectionSetSize ${SecDSlovakian} 0
1107 StrCpy $Search "sr_RS"
1109 ${if} $Pointer != "-1"
1110 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1111 SectionSetFlags ${SecDSerbianC} $0
1112 SectionSetSize ${SecDSerbianC} 0
1114 StrCpy $Search "sr_RS-Latin"
1116 ${if} $Pointer != "-1"
1117 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1118 SectionSetFlags ${SecDSerbianL} $0
1119 SectionSetSize ${SecDSerbianL} 0
1121 StrCpy $Search "sv_SE"
1123 ${if} $Pointer != "-1"
1124 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1125 SectionSetFlags ${SecDSwedish} $0
1126 SectionSetSize ${SecDSwedish} 0
1128 StrCpy $Search "ta_IN"
1130 ${if} $Pointer != "-1"
1131 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1132 # enable this for LyX 2.1!
1133 # SectionSetFlags ${SecDTamil} $0
1134 # SectionSetSize ${SecDTamil} 0
1136 StrCpy $Search "te_IN"
1138 ${if} $Pointer != "-1"
1139 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1140 # enable this for LyX 2.1!
1141 # SectionSetFlags ${SecDTelugu} $0
1142 # SectionSetSize ${SecDTelugu} 0
1144 StrCpy $Search "th_TH"
1146 ${if} $Pointer != "-1"
1147 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1148 SectionSetFlags ${SecDThai} $0
1149 SectionSetSize ${SecDThai} 0
1151 StrCpy $Search "uk_UA"
1153 ${if} $Pointer != "-1"
1154 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1155 SectionSetFlags ${SecDUkrainian} $0
1156 SectionSetSize ${SecDUkrainian} 0
1158 StrCpy $Search "ur_PK"
1160 ${if} $Pointer != "-1"
1161 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1162 # enable this for LyX 2.1!
1163 # SectionSetFlags ${SecDUrdu} $0
1164 # SectionSetSize ${SecDUrdu} 0
1166 StrCpy $Search "vi_VN"
1168 ${if} $Pointer != "-1"
1169 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1170 SectionSetFlags ${SecDVietnamese} $0
1171 SectionSetSize ${SecDVietnamese} 0
1174 # select sections of already installed thesaurus dictionaries, make them read-only
1175 # and set the necessary size to 0 bytes
1176 StrCpy $String $FoundThes
1177 StrCpy $Search "bg_BG"
1178 Call StrPoint # function from LyXUtils.nsh
1179 ${if} $Pointer != "-1"
1180 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1181 SectionSetFlags ${SecTBulgarian} $0
1182 SectionSetSize ${SecTBulgarian} 0
1184 StrCpy $Search "ca_ES"
1186 ${if} $Pointer != "-1"
1187 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1188 SectionSetFlags ${SecTCatalan} $0
1189 SectionSetSize ${SecTCatalan} 0
1191 StrCpy $Search "cs_CZ"
1193 ${if} $Pointer != "-1"
1194 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1195 SectionSetFlags ${SecTCzech} $0
1196 SectionSetSize ${SecTCzech} 0
1198 StrCpy $Search "da_DK"
1200 ${if} $Pointer != "-1"
1201 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1202 SectionSetFlags ${SecTDanish} $0
1203 SectionSetSize ${SecTDanish} 0
1205 StrCpy $Search "de_DE"
1207 ${if} $Pointer != "-1"
1208 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1209 SectionSetFlags ${SecTGermanDA} $0
1210 SectionSetSize ${SecTGermanDA} 0
1212 StrCpy $Search "de_CH"
1214 ${if} $Pointer != "-1"
1215 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1216 SectionSetFlags ${SecTGermanCH} $0
1217 SectionSetSize ${SecTGermanCH} 0
1219 StrCpy $Search "en_GB"
1221 ${if} $Pointer != "-1"
1222 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1223 SectionSetFlags ${SecTEnglishGB} $0
1224 SectionSetSize ${SecTEnglishGB} 0
1226 StrCpy $Search "en_US"
1228 ${if} $Pointer != "-1"
1229 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1230 SectionSetFlags ${SecTEnglishUSAU} $0
1231 SectionSetSize ${SecTEnglishUSAU} 0
1233 StrCpy $Search "es_ES"
1235 ${if} $Pointer != "-1"
1236 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1237 SectionSetFlags ${SecTSpanish} $0
1238 SectionSetSize ${SecTSpanish} 0
1240 StrCpy $Search "fr_FR"
1242 ${if} $Pointer != "-1"
1243 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1244 SectionSetFlags ${SecTFrench} $0
1245 SectionSetSize ${SecTFrench} 0
1247 StrCpy $Search "ga_IR"
1249 ${if} $Pointer != "-1"
1250 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1251 SectionSetFlags ${SecTGaelic} $0
1252 SectionSetSize ${SecTGaelic} 0
1254 StrCpy $Search "el_GR"
1256 ${if} $Pointer != "-1"
1257 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1258 SectionSetFlags ${SecTGreek} $0
1259 SectionSetSize ${SecTGreek} 0
1261 StrCpy $Search "is_IS"
1263 ${if} $Pointer != "-1"
1264 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1265 SectionSetFlags ${SecTIcelandic} $0
1266 SectionSetSize ${SecTIcelandic} 0
1268 StrCpy $Search "it_IT"
1270 ${if} $Pointer != "-1"
1271 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1272 SectionSetFlags ${SecTItalian} $0
1273 SectionSetSize ${SecTItalian} 0
1275 StrCpy $Search "hu_HU"
1277 ${if} $Pointer != "-1"
1278 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1279 SectionSetFlags ${SecTHungarian} $0
1280 SectionSetSize ${SecTHungarian} 0
1282 StrCpy $Search "nb_NO"
1284 ${if} $Pointer != "-1"
1285 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1286 SectionSetFlags ${SecTNorwegianNB} $0
1287 SectionSetSize ${SecTNorwegianNB} 0
1289 StrCpy $Search "pl_PL"
1291 ${if} $Pointer != "-1"
1292 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1293 SectionSetFlags ${SecTPolish} $0
1294 SectionSetSize ${SecTPolish} 0
1296 StrCpy $Search "pt_PT"
1298 ${if} $Pointer != "-1"
1299 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1300 SectionSetFlags ${SecTPortuguese} $0
1301 SectionSetSize ${SecTPortuguese} 0
1303 StrCpy $Search "ro_RO"
1305 ${if} $Pointer != "-1"
1306 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1307 SectionSetFlags ${SecTRomanian} $0
1308 SectionSetSize ${SecTRomanian} 0
1310 StrCpy $Search "ru_RU"
1312 ${if} $Pointer != "-1"
1313 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1314 SectionSetFlags ${SecTRussian} $0
1315 SectionSetSize ${SecTRussian} 0
1317 StrCpy $Search "sl_SI"
1319 ${if} $Pointer != "-1"
1320 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1321 SectionSetFlags ${SecTSlovenian} $0
1322 SectionSetSize ${SecTSlovenian} 0
1324 StrCpy $Search "sk_SK"
1326 ${if} $Pointer != "-1"
1327 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1328 SectionSetFlags ${SecTSlovakian} $0
1329 SectionSetSize ${SecTSlovakian} 0
1331 StrCpy $Search "sv_SE"
1333 ${if} $Pointer != "-1"
1334 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1335 SectionSetFlags ${SecTSwedish} $0
1336 SectionSetSize ${SecTSwedish} 0
1338 StrCpy $Search "uk_UA"
1340 ${if} $Pointer != "-1"
1341 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1342 SectionSetFlags ${SecTUkrainian} $0
1343 SectionSetSize ${SecTUkrainian} 0
1352 # this function is called at first after starting the uninstaller
1355 !insertmacro PRINTER_INIT
1356 !insertmacro MULTIUSER_UNINIT
1358 # Check that LyX is not currently running
1359 FindProcDLL::FindProc "lyx.exe"
1361 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1365 # set registry root key
1366 ${if} $MultiUser.Privileges == "Admin"
1367 ${orif} $MultiUser.Privileges == "Power"
1368 SetShellVarContext all
1370 SetShellVarContext current
1373 # Ascertain whether the user has sufficient privileges to uninstall.
1374 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1375 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1377 ${andif} $MultiUser.Privileges != "Admin"
1378 ${andif} $MultiUser.Privileges != "Power"
1379 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1382 # warning when LyX couldn't be found in the registry
1383 ${if} $0 == "" # check in HKCU
1384 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1386 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1390 # Macro to investigate name of LyX's preferences folders to be able remove them
1391 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1393 # test if MiKTeX was installed together with LyX
1394 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1395 ${if} $0 == "Yes${APP_SERIES_KEY}"
1396 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1397 StrCpy $LaTeXInstalled "MiKTeX"
1399 SectionSetText 2 "" # hides the corresponding uninstaller section
1402 # test if JabRef was installed together with LyX
1403 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1404 ${if} $0 == "Yes${APP_SERIES_KEY}"
1405 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1406 StrCpy $JabRefInstalled "Yes"
1408 SectionSetText 3 "" # hides the corresponding uninstaller section
1411 # question message if the user really wants to uninstall LyX
1412 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes