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 /o "$(SecFileAssocTitle)" SecFileAssoc
52 SectionIn RO # remove this line LyX 2.1 final!
53 #StrCpy $CreateFileAssociations "true"
56 Section "$(SecDesktopTitle)" SecDesktop
57 StrCpy $CreateDesktopIcon "true"
60 !if ${SETUPTYPE} == BUNDLE
61 Section /o "$(SecInstJabRefTitle)" SecInstJabRef
62 AddSize ${SIZE_JABREF}
63 StrCpy $InstallJabRef "true"
67 # Expand the list of dictionaries by default as this was requested by several
68 # users. For the thesaurus this is was not requested because this section
69 # is by default empty.
70 SectionGroup /e "Dictionaries" SecDictionaries
72 Section /o "Afrikaans" SecDAfrikaans
73 StrCpy $DictCodes "af_ZA,$DictCodes"
77 Section /o "Arabic" SecDArabic
78 StrCpy $DictCodes "ar_DZ,$DictCodes"
82 Section /o "Armenian" SecDArmenian
83 StrCpy $DictCodes "hy_AM,$DictCodes"
87 Section /o "Bahasa Indonesia" SecDIndonesian
88 StrCpy $DictCodes "id_ID,$DictCodes"
92 Section /o "Bahasa Melayu" SecDMalayan
93 StrCpy $DictCodes "ms_MY,$DictCodes"
97 Section /o "Belarusian" SecDBelarusian
98 StrCpy $DictCodes "be_BY,$DictCodes"
102 Section /o "Brezhoneg" SecDBreton
103 StrCpy $DictCodes "br_FR,$DictCodes"
107 Section /o "Bulgarian" SecDBulgarian
108 StrCpy $DictCodes "bg_BG,$DictCodes"
112 Section /o "Català" SecDCatalanian
113 StrCpy $DictCodes "ca_ES,$DictCodes"
117 Section /o "Ce
\9atina" SecDCzech
118 StrCpy $DictCodes "cs_CZ,$DictCodes"
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 Section /o "English (AU)" SecDEnglishAU
165 StrCpy $DictCodes "en_AU,$DictCodes"
169 Section /o "English (CA)" SecDEnglishCA
170 StrCpy $DictCodes "en_CA,$DictCodes"
174 Section "English (GB)" SecDEnglishGB
175 # already installed by default
177 #StrCpy $DictCodes "en_GB,$DictCodes"
181 Section /o "English (NZ)" SecDEnglishNZ
182 StrCpy $DictCodes "en_NZ,$DictCodes"
186 Section "English (US)" SecDEnglishUS
187 # already installed by default
189 #StrCpy $DictCodes "en_US,$DictCodes"
193 Section "Español (ES)" SecDSpanishES
194 # already installed by default
196 #StrCpy $DictCodes "es_ES,$DictCodes"
200 Section "Español (MX)" SecDSpanishMX
201 # already installed by default
203 #StrCpy $DictCodes "es_MX,$DictCodes"
207 Section /o "Esperanto" SecDEsperanto
208 StrCpy $DictCodes "eo_EO,$DictCodes"
212 Section /o "Euskara" SecDBasque
213 StrCpy $DictCodes "eu_ES,$DictCodes"
217 Section /o "Farsi" SecDFarsi
218 StrCpy $DictCodes "fa_IR,$DictCodes"
222 Section "Français" SecDFrench
223 # already installed by default
225 #StrCpy $DictCodes "fr_FR,$DictCodes"
229 Section /o "Français (Canada)" SecDFrenchCanada
230 StrCpy $DictCodes "fr_CA,$DictCodes"
234 Section /o "Gaeilge" SecDGaelic
235 StrCpy $DictCodes "ga_IR,$DictCodes"
239 Section /o "Gàidhlig" SecDScottish
240 StrCpy $DictCodes "gd_GB,$DictCodes"
244 Section /o "Galego" SecDGalician
245 StrCpy $DictCodes "gl_ES,$DictCodes"
249 Section /o "Hebrew" SecDHebrew
250 StrCpy $DictCodes "he_IL,$DictCodes"
254 Section /o "Hrvatski" SecDCroatian
255 StrCpy $DictCodes "hr_HR,$DictCodes"
259 Section /o "Magyar" SecDHungarian
260 StrCpy $DictCodes "hu_HU,$DictCodes"
264 Section /o "Hindi" SecDHindi
265 StrCpy $DictCodes "hi_IN,$DictCodes"
269 Section /o "Interlingua" SecDInterlingua
270 StrCpy $DictCodes "ia_IA,$DictCodes"
274 Section /o "Íslenska" SecDIcelandic
275 StrCpy $DictCodes "is_IS,$DictCodes"
279 Section /o "Italiano" SecDItalian
280 StrCpy $DictCodes "it_IT,$DictCodes"
284 Section /o "Kazakh" SecDKazakh
285 StrCpy $DictCodes "kk_KZ,$DictCodes"
289 Section /o "Korean" SecDKorean
290 StrCpy $DictCodes "ko_KR,$DictCodes"
294 Section /o "Latina" SecDLatin
295 StrCpy $DictCodes "la_LA,$DictCodes"
299 Section /o "Lietuviu" SecDLithuanian
300 StrCpy $DictCodes "lt_LT,$DictCodes"
304 Section /o "Latvie
\9au" SecDLatvian
305 StrCpy $DictCodes "lv_LV,$DictCodes"
309 Section /o "Marathi" SecDMarathi
310 StrCpy $DictCodes "mr_IN,$DictCodes"
314 Section /o "Nederlands" SecDDutch
315 StrCpy $DictCodes "nl_NL,$DictCodes"
319 Section /o "Norsk (Bokmål)" SecDNorwegianNB
320 StrCpy $DictCodes "nb_NO,$DictCodes"
324 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
325 StrCpy $DictCodes "nn_NO,$DictCodes"
329 Section /o "Occitan" SecDOccitan
330 StrCpy $DictCodes "oc_FR,$DictCodes"
334 Section /o "Polski" SecDPolish
335 StrCpy $DictCodes "pl_PL,$DictCodes"
339 Section /o "Português (BR)" SecDPortugueseBR
340 StrCpy $DictCodes "pt_BR,$DictCodes"
344 Section /o "Português (PT)" SecDPortuguesePT
345 StrCpy $DictCodes "pt_PT,$DictCodes"
349 Section /o "Româna" SecDRomanian
350 StrCpy $DictCodes "ro_RO,$DictCodes"
354 Section /o "Russian" SecDRussian
355 StrCpy $DictCodes "ru_RU,$DictCodes"
359 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
360 StrCpy $DictCodes "dsb_DE,$DictCodes"
364 Section /o "Serb
\9acina (Horno)" SecDSorbianH
365 StrCpy $DictCodes "hsb_DE,$DictCodes"
369 Section /o "Shqipe" SecDAlbanian
370 StrCpy $DictCodes "sq_AL,$DictCodes"
374 Section /o "Sloven
\9acina" SecDSlovenian
375 StrCpy $DictCodes "sl_SI,$DictCodes"
379 Section /o "Slovenský" SecDSlovakian
380 StrCpy $DictCodes "sk_SK,$DictCodes"
384 Section /o "Srpski (Cirilica)" SecDSerbianC
385 StrCpy $DictCodes "sr_RS,$DictCodes"
389 Section /o "Srpski (Latinica)" SecDSerbianL
390 StrCpy $DictCodes "sr_RS-Latin,$DictCodes"
394 Section /o "Svenska" SecDSwedish
395 StrCpy $DictCodes "sv_SE,$DictCodes"
399 Section /o "Tamil" SecDTamil
400 StrCpy $DictCodes "ta_IN,$DictCodes"
404 Section /o "Telugu" SecDTelugu
405 StrCpy $DictCodes "te_IN,$DictCodes"
409 Section /o "Thai" SecDThai
410 StrCpy $DictCodes "th_TH,$DictCodes"
414 Section /o "Ukrainian" SecDUkrainian
415 StrCpy $DictCodes "uk_UA,$DictCodes"
419 Section /o "Urdu" SecDUrdu
420 StrCpy $DictCodes "ur_PK,$DictCodes"
424 Section /o "Vietnamese" SecDVietnamese
425 StrCpy $DictCodes "vi_VN,$DictCodes"
432 SectionGroup "Thesaurus" SecThesaurus
434 Section /o "Bulgarian" SecTBulgarian
435 StrCpy $ThesCodes "bg_BG,$ThesCodes"
439 Section /o "Català" SecTCatalan
440 StrCpy $ThesCodes "ca_ES,$ThesCodes"
444 Section /o "Ce
\9atina" SecTCzech
445 StrCpy $ThesCodes "cs_CZ,$ThesCodes"
449 Section /o "Dansk" SecTDanish
450 StrCpy $ThesCodes "da_DK,$ThesCodes"
454 Section /o "Deutsch (D/A)" SecTGermanDA
455 StrCpy $ThesCodes "de_DE,$ThesCodes"
459 Section /o "Deutsch (CH)" SecTGermanCH
460 StrCpy $ThesCodes "de_CH,$ThesCodes"
464 Section /o "English (GB)" SecTEnglishGB
465 StrCpy $ThesCodes "en_GB,$ThesCodes"
469 Section /o "English (US/AU)" SecTEnglishUSAU
470 StrCpy $ThesCodes "en_US,$ThesCodes"
474 Section /o "Español" SecTSpanish
475 StrCpy $ThesCodes "es_ES,$ThesCodes"
479 Section /o "Français" SecTFrench
480 StrCpy $ThesCodes "fr_FR,$ThesCodes"
484 Section /o "Gaeilge" SecTGaelic
485 StrCpy $ThesCodes "ga_IR,$ThesCodes"
489 Section /o "Greek" SecTGreek
490 StrCpy $ThesCodes "el_GR,$ThesCodes"
494 Section /o "Íslenska" SecTIcelandic
495 StrCpy $ThesCodes "is_IS,$ThesCodes"
499 Section /o "Italiano" SecTItalian
500 StrCpy $ThesCodes "it_IT,$ThesCodes"
504 Section /o "Magyar" SecTHungarian
505 StrCpy $ThesCodes "hu_HU,$ThesCodes"
509 Section /o "Norsk (Bokmål)" SecTNorwegianNB
510 StrCpy $ThesCodes "nb_NO,$ThesCodes"
514 Section /o "Polski" SecTPolish
515 StrCpy $ThesCodes "pl_PL,$ThesCodes"
519 Section /o "Português" SecTPortuguese
520 StrCpy $ThesCodes "pt_PT,$ThesCodes"
524 Section /o "Româna" SecTRomanian
525 StrCpy $ThesCodes "ro_RO,$ThesCodes"
529 Section /o "Russian" SecTRussian
530 StrCpy $ThesCodes "ru_RU,$ThesCodes"
534 Section /o "Sloven
\9acina" SecTSlovenian
535 StrCpy $ThesCodes "sl_SI,$ThesCodes"
539 Section /o "Slovenský" SecTSlovakian
540 StrCpy $ThesCodes "sk_SK,$ThesCodes"
544 Section /o "Svenska" SecTSwedish
545 StrCpy $ThesCodes "sv_SE,$ThesCodes"
549 Section /o "Ukrainian" SecTUkrainian
550 StrCpy $ThesCodes "uk_UA,$ThesCodes"
556 # Section descriptions
557 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
558 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
559 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
560 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
561 !if ${SETUPTYPE} == BUNDLE
562 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
564 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
565 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
566 !insertmacro MUI_FUNCTION_DESCRIPTION_END
569 #--------------------------------
570 # Installer initialization
574 ${If} ${AtLeastWinVista}
575 StrCpy $PrinterConf "printui.exe"
577 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
582 # .onInit must be here after the section definition because we have to set
583 # the selection states of the dictionary sections
587 ${OrIfNot} ${AtLeastWinXP}
588 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
592 # check that the installer is not currently running
593 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
596 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
599 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
602 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
606 # FIXME: check that LyX is not currently running
607 #System::Call 'kernel32::CreateMutexA(i 0, i 0, t "LyX.exe.Instance") i .r1 ?e'
609 #MessageBox MB_OK "$R0"
611 # MessageBox MB_OK|MB_ICONSTOP "$(LyXRunning)"
615 !insertmacro MULTIUSER_INIT
617 # check if this LyX version is already installed
618 ${if} $MultiUser.Privileges == "Admin"
619 ${orif} $MultiUser.Privileges == "Power"
620 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
622 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
623 # handle also the case that LyX is already installed in HKLM
625 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
629 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
633 # check if there is an existing LyX installation of the same LyX series
634 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
635 IntOp $4 ${APP_VERSION_REVISION} + 20
637 ${if} $MultiUser.Privileges == "Admin"
638 ${orif} $MultiUser.Privileges == "Power"
639 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
640 # also check for an emergency release
642 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
645 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
646 # also check for an emergency release
648 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
652 StrCpy $R5 $0 # store the read version number
653 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
654 # we don't stop here because we want the latest installed version
658 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
659 # store the version number and reformat it temporarily for the error message
660 StrCpy $R0 $OldVersionNumber
661 StrCpy $OldVersionNumber $R5
662 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
663 StrCpy $OldVersionNumber $R0
667 !insertmacro PRINTER_INIT
669 # this can be reset to "true" in section SecDesktop
670 StrCpy $CreateDesktopIcon "false"
671 StrCpy $CreateFileAssociations "false"
674 # Show banner while installer is intializating
675 Banner::show /NOUNLOAD "Checking system"
680 !if ${SETUPTYPE} == BUNDLE
681 # don't let the installer sections appear when the programs are already installed
682 ${if} $PathBibTeXEditor != ""
683 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
687 # select sections of already installed spell-checker dictionaries, make them read-only
688 # and set the necessary size to 0 bytes
689 StrCpy $String $FoundDict
690 StrCpy $Search "af_ZA"
691 Call StrPoint # function from LyXUtils.nsh
692 ${if} $Pointer != "-1"
693 IntOp $0 ${SF_SELECTED} | ${SF_RO}
694 SectionSetFlags ${SecDAfrikaans} $0
695 SectionSetSize ${SecDAfrikaans} 0
697 StrCpy $Search "ar_DZ"
699 ${if} $Pointer != "-1"
700 IntOp $0 ${SF_SELECTED} | ${SF_RO}
701 SectionSetFlags ${SecDArabic} $0
702 SectionSetSize ${SecDArabic} 0
704 StrCpy $Search "hy_AM"
706 ${if} $Pointer != "-1"
707 IntOp $0 ${SF_SELECTED} | ${SF_RO}
708 SectionSetFlags ${SecDArmenian} $0
709 SectionSetSize ${SecDArmenian} 0
711 StrCpy $Search "id_ID"
713 ${if} $Pointer != "-1"
714 IntOp $0 ${SF_SELECTED} | ${SF_RO}
715 SectionSetFlags ${SecDIndonesian} $0
716 SectionSetSize ${SecDIndonesian} 0
718 StrCpy $Search "ms_MY"
720 ${if} $Pointer != "-1"
721 IntOp $0 ${SF_SELECTED} | ${SF_RO}
722 SectionSetFlags ${SecDMalayan} $0
723 SectionSetSize ${SecDMalayan} 0
725 StrCpy $Search "be_BY"
727 ${if} $Pointer != "-1"
728 IntOp $0 ${SF_SELECTED} | ${SF_RO}
729 SectionSetFlags ${SecDBelarusian} $0
730 SectionSetSize ${SecDBelarusian} 0
732 StrCpy $Search "br_FR"
734 ${if} $Pointer != "-1"
735 IntOp $0 ${SF_SELECTED} | ${SF_RO}
736 SectionSetFlags ${SecDBreton} $0
737 SectionSetSize ${SecDBreton} 0
739 StrCpy $Search "bg_BG"
741 ${if} $Pointer != "-1"
742 IntOp $0 ${SF_SELECTED} | ${SF_RO}
743 SectionSetFlags ${SecDBulgarian} $0
744 SectionSetSize ${SecDBulgarian} 0
746 StrCpy $Search "ca_ES"
748 ${if} $Pointer != "-1"
749 IntOp $0 ${SF_SELECTED} | ${SF_RO}
750 SectionSetFlags ${SecDCatalanian} $0
751 SectionSetSize ${SecDCatalanian} 0
753 StrCpy $Search "cs_CZ"
755 ${if} $Pointer != "-1"
756 IntOp $0 ${SF_SELECTED} | ${SF_RO}
757 SectionSetFlags ${SecDCzech} $0
758 SectionSetSize ${SecDCzech} 0
761 StrCpy $Search "cop_EG"
763 ${if} $Pointer != "-1"
764 IntOp $0 ${SF_SELECTED} | ${SF_RO}
765 SectionSetFlags ${SecDCoptic} $0
766 SectionSetSize ${SecDCoptic} 0
768 StrCpy $Search "cy_GB"
770 ${if} $Pointer != "-1"
771 IntOp $0 ${SF_SELECTED} | ${SF_RO}
772 SectionSetFlags ${SecDWelsh} $0
773 SectionSetSize ${SecDWelsh} 0
775 StrCpy $Search "da_DK"
777 ${if} $Pointer != "-1"
778 IntOp $0 ${SF_SELECTED} | ${SF_RO}
779 SectionSetFlags ${SecDDanish} $0
780 SectionSetSize ${SecDDanish} 0
782 StrCpy $Search "de_AT"
784 ${if} $Pointer != "-1"
785 IntOp $0 ${SF_SELECTED} | ${SF_RO}
786 SectionSetFlags ${SecDGermanAT} $0
787 SectionSetSize ${SecDGermanAT} 0
789 StrCpy $Search "de_CH"
791 ${if} $Pointer != "-1"
792 IntOp $0 ${SF_SELECTED} | ${SF_RO}
793 SectionSetFlags ${SecDGermanCH} $0
794 SectionSetSize ${SecDGermanCH} 0
796 StrCpy $Search "de_DE"
798 ${if} $Pointer != "-1"
799 IntOp $0 ${SF_SELECTED} | ${SF_RO}
800 SectionSetFlags ${SecDGermanD} $0
801 SectionSetSize ${SecDGermanD} 0
803 StrCpy $Search "el_GR"
805 ${if} $Pointer != "-1"
806 IntOp $0 ${SF_SELECTED} | ${SF_RO}
807 SectionSetFlags ${SecDGreek} $0
808 SectionSetSize ${SecDGreek} 0
810 StrCpy $Search "et_EE"
812 ${if} $Pointer != "-1"
813 IntOp $0 ${SF_SELECTED} | ${SF_RO}
814 SectionSetFlags ${SecDEstonian} $0
815 SectionSetSize ${SecDEstonian} 0
817 StrCpy $Search "en_AU"
819 ${if} $Pointer != "-1"
820 IntOp $0 ${SF_SELECTED} | ${SF_RO}
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 SectionSetFlags ${SecDEnglishNZ} $0
843 SectionSetSize ${SecDEnglishNZ} 0
845 StrCpy $Search "en_US"
847 ${if} $Pointer != "-1"
848 IntOp $0 ${SF_SELECTED} | ${SF_RO}
849 SectionSetFlags ${SecDEnglishUS} $0
850 SectionSetSize ${SecDEnglishUS} 0
852 StrCpy $Search "es_ES"
854 ${if} $Pointer != "-1"
855 IntOp $0 ${SF_SELECTED} | ${SF_RO}
856 SectionSetFlags ${SecDSpanishES} $0
857 SectionSetSize ${SecDSpanishES} 0
859 StrCpy $Search "es_MX"
861 ${if} $Pointer != "-1"
862 IntOp $0 ${SF_SELECTED} | ${SF_RO}
863 SectionSetFlags ${SecDSpanishMX} $0
864 SectionSetSize ${SecDSpanishMX} 0
866 StrCpy $Search "eo_EO"
868 ${if} $Pointer != "-1"
869 IntOp $0 ${SF_SELECTED} | ${SF_RO}
870 SectionSetFlags ${SecDEsperanto} $0
871 SectionSetSize ${SecDEsperanto} 0
873 StrCpy $Search "eu_ES"
875 ${if} $Pointer != "-1"
876 IntOp $0 ${SF_SELECTED} | ${SF_RO}
877 SectionSetFlags ${SecDBasque} $0
878 SectionSetSize ${SecDBasque} 0
880 StrCpy $Search "fa_IR"
882 ${if} $Pointer != "-1"
883 IntOp $0 ${SF_SELECTED} | ${SF_RO}
884 SectionSetFlags ${SecDFarsi} $0
885 SectionSetSize ${SecDFarsi} 0
887 StrCpy $Search "fr_CA"
889 ${if} $Pointer != "-1"
890 IntOp $0 ${SF_SELECTED} | ${SF_RO}
891 SectionSetFlags ${SecDFrenchCanada} $0
892 SectionSetSize ${SecDFrenchCanada} 0
894 StrCpy $Search "fr_FR"
896 ${if} $Pointer != "-1"
897 IntOp $0 ${SF_SELECTED} | ${SF_RO}
898 SectionSetFlags ${SecDFrench} $0
899 SectionSetSize ${SecDFrench} 0
901 StrCpy $Search "ga_IR"
903 ${if} $Pointer != "-1"
904 IntOp $0 ${SF_SELECTED} | ${SF_RO}
905 SectionSetFlags ${SecDGaelic} $0
906 SectionSetSize ${SecDGaelic} 0
908 StrCpy $Search "gd_GB"
910 ${if} $Pointer != "-1"
911 IntOp $0 ${SF_SELECTED} | ${SF_RO}
912 SectionSetFlags ${SecDScottish} $0
913 SectionSetSize ${SecDScottish} 0
915 StrCpy $Search "gl_ES"
917 ${if} $Pointer != "-1"
918 IntOp $0 ${SF_SELECTED} | ${SF_RO}
919 SectionSetFlags ${SecDGalician} $0
920 SectionSetSize ${SecDGalician} 0
922 StrCpy $Search "he_IL"
924 ${if} $Pointer != "-1"
925 IntOp $0 ${SF_SELECTED} | ${SF_RO}
926 SectionSetFlags ${SecDHebrew} $0
927 SectionSetSize ${SecDHebrew} 0
929 StrCpy $Search "hi_IN"
931 ${if} $Pointer != "-1"
932 IntOp $0 ${SF_SELECTED} | ${SF_RO}
933 SectionSetFlags ${SecDHindi} $0
934 SectionSetSize ${SecDHindi} 0
936 StrCpy $Search "hr_HR"
938 ${if} $Pointer != "-1"
939 IntOp $0 ${SF_SELECTED} | ${SF_RO}
940 SectionSetFlags ${SecDCroatian} $0
941 SectionSetSize ${SecDCroatian} 0
943 StrCpy $Search "hu_HU"
945 ${if} $Pointer != "-1"
946 IntOp $0 ${SF_SELECTED} | ${SF_RO}
947 SectionSetFlags ${SecDHungarian} $0
948 SectionSetSize ${SecDHungarian} 0
950 StrCpy $Search "ia_IA"
952 ${if} $Pointer != "-1"
953 IntOp $0 ${SF_SELECTED} | ${SF_RO}
954 SectionSetFlags ${SecDInterlingua} $0
955 SectionSetSize ${SecDInterlingua} 0
957 StrCpy $Search "is_IS"
959 ${if} $Pointer != "-1"
960 IntOp $0 ${SF_SELECTED} | ${SF_RO}
961 SectionSetFlags ${SecDIcelandic} $0
962 SectionSetSize ${SecDIcelandic} 0
964 StrCpy $Search "it_IT"
966 ${if} $Pointer != "-1"
967 IntOp $0 ${SF_SELECTED} | ${SF_RO}
968 SectionSetFlags ${SecDItalian} $0
969 SectionSetSize ${SecDItalian} 0
971 StrCpy $Search "kk_KZ"
973 ${if} $Pointer != "-1"
974 IntOp $0 ${SF_SELECTED} | ${SF_RO}
975 SectionSetFlags ${SecDKazakh} $0
976 SectionSetSize ${SecDKazakh} 0
978 StrCpy $Search "ko_KR"
980 ${if} $Pointer != "-1"
981 IntOp $0 ${SF_SELECTED} | ${SF_RO}
982 SectionSetFlags ${SecDKorean} $0
983 SectionSetSize ${SecDKorean} 0
985 StrCpy $Search "la_LA"
987 ${if} $Pointer != "-1"
988 IntOp $0 ${SF_SELECTED} | ${SF_RO}
989 SectionSetFlags ${SecDLatin} $0
990 SectionSetSize ${SecDLatin} 0
992 StrCpy $Search "lt_LT"
994 ${if} $Pointer != "-1"
995 IntOp $0 ${SF_SELECTED} | ${SF_RO}
996 SectionSetFlags ${SecDLithuanian} $0
997 SectionSetSize ${SecDLithuanian} 0
999 StrCpy $Search "lv_LV"
1001 ${if} $Pointer != "-1"
1002 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1003 SectionSetFlags ${SecDLatvian} $0
1004 SectionSetSize ${SecDLatvian} 0
1006 StrCpy $Search "mr_IN"
1008 ${if} $Pointer != "-1"
1009 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1010 SectionSetFlags ${SecDMarathi} $0
1011 SectionSetSize ${SecDMarathi} 0
1013 StrCpy $Search "nl_NL"
1015 ${if} $Pointer != "-1"
1016 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1017 SectionSetFlags ${SecDDutch} $0
1018 SectionSetSize ${SecDDutch} 0
1020 StrCpy $Search "nb_NO"
1022 ${if} $Pointer != "-1"
1023 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1024 SectionSetFlags ${SecDNorwegianNB} $0
1025 SectionSetSize ${SecDNorwegianNB} 0
1027 StrCpy $Search "nn_NO"
1029 ${if} $Pointer != "-1"
1030 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1031 SectionSetFlags ${SecDNorwegianNN} $0
1032 SectionSetSize ${SecDNorwegianNN} 0
1034 StrCpy $Search "oc_FR"
1036 ${if} $Pointer != "-1"
1037 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1038 SectionSetFlags ${SecDOccitan} $0
1039 SectionSetSize ${SecDOccitan} 0
1041 StrCpy $Search "pl_PL"
1043 ${if} $Pointer != "-1"
1044 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1045 SectionSetFlags ${SecDPolish} $0
1046 SectionSetSize ${SecDPolish} 0
1048 StrCpy $Search "pt_BR"
1050 ${if} $Pointer != "-1"
1051 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1052 SectionSetFlags ${SecDPortugueseBR} $0
1053 SectionSetSize ${SecDPortugueseBR} 0
1055 StrCpy $Search "pt_PT"
1057 ${if} $Pointer != "-1"
1058 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1059 SectionSetFlags ${SecDPortuguesePT} $0
1060 SectionSetSize ${SecDPortuguesePT} 0
1062 StrCpy $Search "ro_RO"
1064 ${if} $Pointer != "-1"
1065 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1066 SectionSetFlags ${SecDRomanian} $0
1067 SectionSetSize ${SecDRomanian} 0
1069 StrCpy $Search "ru_RU"
1071 ${if} $Pointer != "-1"
1072 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1073 SectionSetFlags ${SecDRussian} $0
1074 SectionSetSize ${SecDRussian} 0
1076 StrCpy $Search "dsb_DE"
1078 ${if} $Pointer != "-1"
1079 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1080 SectionSetFlags ${SecDSorbianD} $0
1081 SectionSetSize ${SecDSorbianD} 0
1083 StrCpy $Search "hsb_DE"
1085 ${if} $Pointer != "-1"
1086 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1087 SectionSetFlags ${SecDSorbianH} $0
1088 SectionSetSize ${SecDSorbianH} 0
1090 StrCpy $Search "sq_AL"
1092 ${if} $Pointer != "-1"
1093 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1094 SectionSetFlags ${SecDAlbanian} $0
1095 SectionSetSize ${SecDAlbanian} 0
1097 StrCpy $Search "sl_SI"
1099 ${if} $Pointer != "-1"
1100 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1101 SectionSetFlags ${SecDSlovenian} $0
1102 SectionSetSize ${SecDSlovenian} 0
1104 StrCpy $Search "sk_SK"
1106 ${if} $Pointer != "-1"
1107 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1108 SectionSetFlags ${SecDSlovakian} $0
1109 SectionSetSize ${SecDSlovakian} 0
1111 StrCpy $Search "sr_RS"
1113 ${if} $Pointer != "-1"
1114 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1115 SectionSetFlags ${SecDSerbianC} $0
1116 SectionSetSize ${SecDSerbianC} 0
1118 StrCpy $Search "sr_RS-Latin"
1120 ${if} $Pointer != "-1"
1121 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1122 SectionSetFlags ${SecDSerbianL} $0
1123 SectionSetSize ${SecDSerbianL} 0
1125 StrCpy $Search "sv_SE"
1127 ${if} $Pointer != "-1"
1128 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1129 SectionSetFlags ${SecDSwedish} $0
1130 SectionSetSize ${SecDSwedish} 0
1132 StrCpy $Search "ta_IN"
1134 ${if} $Pointer != "-1"
1135 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1136 SectionSetFlags ${SecDTamil} $0
1137 SectionSetSize ${SecDTamil} 0
1139 StrCpy $Search "te_IN"
1141 ${if} $Pointer != "-1"
1142 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1143 SectionSetFlags ${SecDTelugu} $0
1144 SectionSetSize ${SecDTelugu} 0
1146 StrCpy $Search "th_TH"
1148 ${if} $Pointer != "-1"
1149 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1150 SectionSetFlags ${SecDThai} $0
1151 SectionSetSize ${SecDThai} 0
1153 StrCpy $Search "uk_UA"
1155 ${if} $Pointer != "-1"
1156 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1157 SectionSetFlags ${SecDUkrainian} $0
1158 SectionSetSize ${SecDUkrainian} 0
1160 StrCpy $Search "ur_PK"
1162 ${if} $Pointer != "-1"
1163 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1164 SectionSetFlags ${SecDUrdu} $0
1165 SectionSetSize ${SecDUrdu} 0
1167 StrCpy $Search "vi_VN"
1169 ${if} $Pointer != "-1"
1170 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1171 SectionSetFlags ${SecDVietnamese} $0
1172 SectionSetSize ${SecDVietnamese} 0
1175 # select sections of already installed thesaurus dictionaries, make them read-only
1176 # and set the necessary size to 0 bytes
1177 StrCpy $String $FoundThes
1178 StrCpy $Search "bg_BG"
1179 Call StrPoint # function from LyXUtils.nsh
1180 ${if} $Pointer != "-1"
1181 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1182 SectionSetFlags ${SecTBulgarian} $0
1183 SectionSetSize ${SecTBulgarian} 0
1185 StrCpy $Search "ca_ES"
1187 ${if} $Pointer != "-1"
1188 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1189 SectionSetFlags ${SecTCatalan} $0
1190 SectionSetSize ${SecTCatalan} 0
1192 StrCpy $Search "cs_CZ"
1194 ${if} $Pointer != "-1"
1195 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1196 SectionSetFlags ${SecTCzech} $0
1197 SectionSetSize ${SecTCzech} 0
1199 StrCpy $Search "da_DK"
1201 ${if} $Pointer != "-1"
1202 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1203 SectionSetFlags ${SecTDanish} $0
1204 SectionSetSize ${SecTDanish} 0
1206 StrCpy $Search "de_DE"
1208 ${if} $Pointer != "-1"
1209 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1210 SectionSetFlags ${SecTGermanDA} $0
1211 SectionSetSize ${SecTGermanDA} 0
1213 StrCpy $Search "de_CH"
1215 ${if} $Pointer != "-1"
1216 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1217 SectionSetFlags ${SecTGermanCH} $0
1218 SectionSetSize ${SecTGermanCH} 0
1220 StrCpy $Search "en_GB"
1222 ${if} $Pointer != "-1"
1223 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1224 SectionSetFlags ${SecTEnglishGB} $0
1225 SectionSetSize ${SecTEnglishGB} 0
1227 StrCpy $Search "en_US"
1229 ${if} $Pointer != "-1"
1230 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1231 SectionSetFlags ${SecTEnglishUSAU} $0
1232 SectionSetSize ${SecTEnglishUSAU} 0
1234 StrCpy $Search "es_ES"
1236 ${if} $Pointer != "-1"
1237 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1238 SectionSetFlags ${SecTSpanish} $0
1239 SectionSetSize ${SecTSpanish} 0
1241 StrCpy $Search "fr_FR"
1243 ${if} $Pointer != "-1"
1244 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1245 SectionSetFlags ${SecTFrench} $0
1246 SectionSetSize ${SecTFrench} 0
1248 StrCpy $Search "ga_IR"
1250 ${if} $Pointer != "-1"
1251 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1252 SectionSetFlags ${SecTGaelic} $0
1253 SectionSetSize ${SecTGaelic} 0
1255 StrCpy $Search "el_GR"
1257 ${if} $Pointer != "-1"
1258 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1259 SectionSetFlags ${SecTGreek} $0
1260 SectionSetSize ${SecTGreek} 0
1262 StrCpy $Search "is_IS"
1264 ${if} $Pointer != "-1"
1265 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1266 SectionSetFlags ${SecTIcelandic} $0
1267 SectionSetSize ${SecTIcelandic} 0
1269 StrCpy $Search "it_IT"
1271 ${if} $Pointer != "-1"
1272 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1273 SectionSetFlags ${SecTItalian} $0
1274 SectionSetSize ${SecTItalian} 0
1276 StrCpy $Search "hu_HU"
1278 ${if} $Pointer != "-1"
1279 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1280 SectionSetFlags ${SecTHungarian} $0
1281 SectionSetSize ${SecTHungarian} 0
1283 StrCpy $Search "nb_NO"
1285 ${if} $Pointer != "-1"
1286 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1287 SectionSetFlags ${SecTNorwegianNB} $0
1288 SectionSetSize ${SecTNorwegianNB} 0
1290 StrCpy $Search "pl_PL"
1292 ${if} $Pointer != "-1"
1293 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1294 SectionSetFlags ${SecTPolish} $0
1295 SectionSetSize ${SecTPolish} 0
1297 StrCpy $Search "pt_PT"
1299 ${if} $Pointer != "-1"
1300 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1301 SectionSetFlags ${SecTPortuguese} $0
1302 SectionSetSize ${SecTPortuguese} 0
1304 StrCpy $Search "ro_RO"
1306 ${if} $Pointer != "-1"
1307 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1308 SectionSetFlags ${SecTRomanian} $0
1309 SectionSetSize ${SecTRomanian} 0
1311 StrCpy $Search "ru_RU"
1313 ${if} $Pointer != "-1"
1314 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1315 SectionSetFlags ${SecTRussian} $0
1316 SectionSetSize ${SecTRussian} 0
1318 StrCpy $Search "sl_SI"
1320 ${if} $Pointer != "-1"
1321 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1322 SectionSetFlags ${SecTSlovenian} $0
1323 SectionSetSize ${SecTSlovenian} 0
1325 StrCpy $Search "sk_SK"
1327 ${if} $Pointer != "-1"
1328 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1329 SectionSetFlags ${SecTSlovakian} $0
1330 SectionSetSize ${SecTSlovakian} 0
1332 StrCpy $Search "sv_SE"
1334 ${if} $Pointer != "-1"
1335 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1336 SectionSetFlags ${SecTSwedish} $0
1337 SectionSetSize ${SecTSwedish} 0
1339 StrCpy $Search "uk_UA"
1341 ${if} $Pointer != "-1"
1342 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1343 SectionSetFlags ${SecTUkrainian} $0
1344 SectionSetSize ${SecTUkrainian} 0
1353 # this function is called at first after starting the uninstaller
1356 !insertmacro PRINTER_INIT
1357 !insertmacro MULTIUSER_UNINIT
1359 # Check that LyX is not currently running
1360 FindProcDLL::FindProc "lyx.exe"
1362 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1366 # set registry root key
1367 ${if} $MultiUser.Privileges == "Admin"
1368 ${orif} $MultiUser.Privileges == "Power"
1369 SetShellVarContext all
1371 SetShellVarContext current
1374 # Ascertain whether the user has sufficient privileges to uninstall.
1375 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1376 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1378 ${andif} $MultiUser.Privileges != "Admin"
1379 ${andif} $MultiUser.Privileges != "Power"
1380 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1383 # warning when LyX couldn't be found in the registry
1384 ${if} $0 == "" # check in HKCU
1385 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1387 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1391 # Macro to investigate name of LyX's preferences folders to be able remove them
1392 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1394 # test if MiKTeX was installed together with LyX
1395 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1396 ${if} $0 == "Yes${APP_SERIES_KEY}"
1397 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1398 StrCpy $LaTeXInstalled "MiKTeX"
1400 SectionSetText 2 "" # hides the corresponding uninstaller section
1403 # test if JabRef was installed together with LyX
1404 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1405 ${if} $0 == "Yes${APP_SERIES_KEY}"
1406 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1407 StrCpy $JabRefInstalled "Yes"
1409 SectionSetText 3 "" # hides the corresponding uninstaller section
1412 # question message if the user really wants to uninstall LyX
1413 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes