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 # FIXME: check that LyX is not currently running
615 #System::Call 'kernel32::CreateMutexA(i 0, i 0, t "LyX.exe.Instance") i .r1 ?e'
617 #MessageBox MB_OK "$R0"
619 # MessageBox MB_OK|MB_ICONSTOP "$(LyXRunning)"
623 !insertmacro MULTIUSER_INIT
625 # check if this LyX version is already installed
626 ${if} $MultiUser.Privileges == "Admin"
627 ${orif} $MultiUser.Privileges == "Power"
628 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
630 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
631 # handle also the case that LyX is already installed in HKLM
633 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
637 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
641 # check if there is an existing LyX installation of the same LyX series
642 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
643 IntOp $4 ${APP_VERSION_REVISION} + 20
645 ${if} $MultiUser.Privileges == "Admin"
646 ${orif} $MultiUser.Privileges == "Power"
647 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
648 # also check for an emergency release
650 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
653 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
654 # also check for an emergency release
656 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
660 StrCpy $R5 $0 # store the read version number
661 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
662 # we don't stop here because we want the latest installed version
666 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
667 # store the version number and reformat it temporarily for the error message
668 StrCpy $R0 $OldVersionNumber
669 StrCpy $OldVersionNumber $R5
670 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
671 StrCpy $OldVersionNumber $R0
675 !insertmacro PRINTER_INIT
677 # this can be reset to "true" in section SecDesktop
678 StrCpy $CreateDesktopIcon "false"
679 StrCpy $CreateFileAssociations "false"
682 # Show banner while installer is intializating
683 Banner::show /NOUNLOAD "Checking system"
688 !if ${SETUPTYPE} == BUNDLE
689 # don't let the installer sections appear when the programs are already installed
690 ${if} $PathBibTeXEditor != ""
691 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
695 # select sections of already installed spell-checker dictionaries, make them read-only
696 # and set the necessary size to 0 bytes
697 StrCpy $String $FoundDict
698 StrCpy $Search "af_ZA"
699 Call StrPoint # function from LyXUtils.nsh
700 ${if} $Pointer != "-1"
701 IntOp $0 ${SF_SELECTED} | ${SF_RO}
702 SectionSetFlags ${SecDAfrikaans} $0
703 SectionSetSize ${SecDAfrikaans} 0
705 StrCpy $Search "ar_DZ"
707 ${if} $Pointer != "-1"
708 IntOp $0 ${SF_SELECTED} | ${SF_RO}
709 SectionSetFlags ${SecDArabic} $0
710 SectionSetSize ${SecDArabic} 0
712 StrCpy $Search "hy_AM"
714 ${if} $Pointer != "-1"
715 IntOp $0 ${SF_SELECTED} | ${SF_RO}
716 SectionSetFlags ${SecDArmenian} $0
717 SectionSetSize ${SecDArmenian} 0
719 StrCpy $Search "id_ID"
721 ${if} $Pointer != "-1"
722 IntOp $0 ${SF_SELECTED} | ${SF_RO}
723 SectionSetFlags ${SecDIndonesian} $0
724 SectionSetSize ${SecDIndonesian} 0
726 StrCpy $Search "ms_MY"
728 ${if} $Pointer != "-1"
729 IntOp $0 ${SF_SELECTED} | ${SF_RO}
730 SectionSetFlags ${SecDMalayan} $0
731 SectionSetSize ${SecDMalayan} 0
733 StrCpy $Search "be_BY"
735 ${if} $Pointer != "-1"
736 IntOp $0 ${SF_SELECTED} | ${SF_RO}
737 SectionSetFlags ${SecDBelarusian} $0
738 SectionSetSize ${SecDBelarusian} 0
740 StrCpy $Search "br_FR"
742 ${if} $Pointer != "-1"
743 IntOp $0 ${SF_SELECTED} | ${SF_RO}
744 SectionSetFlags ${SecDBreton} $0
745 SectionSetSize ${SecDBreton} 0
747 StrCpy $Search "bg_BG"
749 ${if} $Pointer != "-1"
750 IntOp $0 ${SF_SELECTED} | ${SF_RO}
751 SectionSetFlags ${SecDBulgarian} $0
752 SectionSetSize ${SecDBulgarian} 0
754 StrCpy $Search "ca_ES"
756 ${if} $Pointer != "-1"
757 IntOp $0 ${SF_SELECTED} | ${SF_RO}
758 SectionSetFlags ${SecDCatalanian} $0
759 SectionSetSize ${SecDCatalanian} 0
761 StrCpy $Search "cs_CZ"
763 ${if} $Pointer != "-1"
764 IntOp $0 ${SF_SELECTED} | ${SF_RO}
765 SectionSetFlags ${SecDCzech} $0
766 SectionSetSize ${SecDCzech} 0
769 StrCpy $Search "cop_EG"
771 ${if} $Pointer != "-1"
772 IntOp $0 ${SF_SELECTED} | ${SF_RO}
773 # enable this for LyX 2.1!
774 # SectionSetFlags ${SecDCoptic} $0
775 # SectionSetSize ${SecDCoptic} 0
777 StrCpy $Search "cy_GB"
779 ${if} $Pointer != "-1"
780 IntOp $0 ${SF_SELECTED} | ${SF_RO}
781 SectionSetFlags ${SecDWelsh} $0
782 SectionSetSize ${SecDWelsh} 0
784 StrCpy $Search "da_DK"
786 ${if} $Pointer != "-1"
787 IntOp $0 ${SF_SELECTED} | ${SF_RO}
788 SectionSetFlags ${SecDDanish} $0
789 SectionSetSize ${SecDDanish} 0
791 StrCpy $Search "de_AT"
793 ${if} $Pointer != "-1"
794 IntOp $0 ${SF_SELECTED} | ${SF_RO}
795 SectionSetFlags ${SecDGermanAT} $0
796 SectionSetSize ${SecDGermanAT} 0
798 StrCpy $Search "de_CH"
800 ${if} $Pointer != "-1"
801 IntOp $0 ${SF_SELECTED} | ${SF_RO}
802 SectionSetFlags ${SecDGermanCH} $0
803 SectionSetSize ${SecDGermanCH} 0
805 StrCpy $Search "de_DE"
807 ${if} $Pointer != "-1"
808 IntOp $0 ${SF_SELECTED} | ${SF_RO}
809 SectionSetFlags ${SecDGermanD} $0
810 SectionSetSize ${SecDGermanD} 0
812 StrCpy $Search "el_GR"
814 ${if} $Pointer != "-1"
815 IntOp $0 ${SF_SELECTED} | ${SF_RO}
816 SectionSetFlags ${SecDGreek} $0
817 SectionSetSize ${SecDGreek} 0
819 StrCpy $Search "et_EE"
821 ${if} $Pointer != "-1"
822 IntOp $0 ${SF_SELECTED} | ${SF_RO}
823 SectionSetFlags ${SecDEstonian} $0
824 SectionSetSize ${SecDEstonian} 0
826 StrCpy $Search "en_AU"
828 ${if} $Pointer != "-1"
829 IntOp $0 ${SF_SELECTED} | ${SF_RO}
830 # enable this for LyX 2.1!
831 # SectionSetFlags ${SecDEnglishAU} $0
832 # SectionSetSize ${SecDEnglishAU} 0
834 StrCpy $Search "en_CA"
836 ${if} $Pointer != "-1"
837 IntOp $0 ${SF_SELECTED} | ${SF_RO}
838 SectionSetFlags ${SecDEnglishCA} $0
839 SectionSetSize ${SecDEnglishCA} 0
841 StrCpy $Search "en_GB"
843 ${if} $Pointer != "-1"
844 IntOp $0 ${SF_SELECTED} | ${SF_RO}
845 SectionSetFlags ${SecDEnglishGB} $0
846 SectionSetSize ${SecDEnglishGB} 0
848 StrCpy $Search "en_NZ"
850 ${if} $Pointer != "-1"
851 IntOp $0 ${SF_SELECTED} | ${SF_RO}
852 # enable this for LyX 2.1!
853 # SectionSetFlags ${SecDEnglishNZ} $0
854 # SectionSetSize ${SecDEnglishNZ} 0
856 StrCpy $Search "en_US"
858 ${if} $Pointer != "-1"
859 IntOp $0 ${SF_SELECTED} | ${SF_RO}
860 SectionSetFlags ${SecDEnglishUS} $0
861 SectionSetSize ${SecDEnglishUS} 0
863 StrCpy $Search "es_ES"
865 ${if} $Pointer != "-1"
866 IntOp $0 ${SF_SELECTED} | ${SF_RO}
867 SectionSetFlags ${SecDSpanishES} $0
868 SectionSetSize ${SecDSpanishES} 0
870 StrCpy $Search "es_MX"
872 ${if} $Pointer != "-1"
873 IntOp $0 ${SF_SELECTED} | ${SF_RO}
874 SectionSetFlags ${SecDSpanishMX} $0
875 SectionSetSize ${SecDSpanishMX} 0
877 StrCpy $Search "eo_EO"
879 ${if} $Pointer != "-1"
880 IntOp $0 ${SF_SELECTED} | ${SF_RO}
881 SectionSetFlags ${SecDEsperanto} $0
882 SectionSetSize ${SecDEsperanto} 0
884 StrCpy $Search "eu_ES"
886 ${if} $Pointer != "-1"
887 IntOp $0 ${SF_SELECTED} | ${SF_RO}
888 SectionSetFlags ${SecDBasque} $0
889 SectionSetSize ${SecDBasque} 0
891 StrCpy $Search "fa_IR"
893 ${if} $Pointer != "-1"
894 IntOp $0 ${SF_SELECTED} | ${SF_RO}
895 SectionSetFlags ${SecDFarsi} $0
896 SectionSetSize ${SecDFarsi} 0
898 StrCpy $Search "fr_CA"
900 ${if} $Pointer != "-1"
901 IntOp $0 ${SF_SELECTED} | ${SF_RO}
902 SectionSetFlags ${SecDFrenchCanada} $0
903 SectionSetSize ${SecDFrenchCanada} 0
905 StrCpy $Search "fr_FR"
907 ${if} $Pointer != "-1"
908 IntOp $0 ${SF_SELECTED} | ${SF_RO}
909 SectionSetFlags ${SecDFrench} $0
910 SectionSetSize ${SecDFrench} 0
912 StrCpy $Search "ga_IR"
914 ${if} $Pointer != "-1"
915 IntOp $0 ${SF_SELECTED} | ${SF_RO}
916 SectionSetFlags ${SecDGaelic} $0
917 SectionSetSize ${SecDGaelic} 0
919 StrCpy $Search "gd_GB"
921 ${if} $Pointer != "-1"
922 IntOp $0 ${SF_SELECTED} | ${SF_RO}
923 SectionSetFlags ${SecDScottish} $0
924 SectionSetSize ${SecDScottish} 0
926 StrCpy $Search "gl_ES"
928 ${if} $Pointer != "-1"
929 IntOp $0 ${SF_SELECTED} | ${SF_RO}
930 SectionSetFlags ${SecDGalician} $0
931 SectionSetSize ${SecDGalician} 0
933 StrCpy $Search "he_IL"
935 ${if} $Pointer != "-1"
936 IntOp $0 ${SF_SELECTED} | ${SF_RO}
937 SectionSetFlags ${SecDHebrew} $0
938 SectionSetSize ${SecDHebrew} 0
940 StrCpy $Search "hi_IN"
942 ${if} $Pointer != "-1"
943 IntOp $0 ${SF_SELECTED} | ${SF_RO}
944 # enable this for LyX 2.1!
945 # SectionSetFlags ${SecDHindi} $0
946 # SectionSetSize ${SecDHindi} 0
948 StrCpy $Search "hr_HR"
950 ${if} $Pointer != "-1"
951 IntOp $0 ${SF_SELECTED} | ${SF_RO}
952 SectionSetFlags ${SecDCroatian} $0
953 SectionSetSize ${SecDCroatian} 0
955 StrCpy $Search "hu_HU"
957 ${if} $Pointer != "-1"
958 IntOp $0 ${SF_SELECTED} | ${SF_RO}
959 SectionSetFlags ${SecDHungarian} $0
960 SectionSetSize ${SecDHungarian} 0
962 StrCpy $Search "ia_IA"
964 ${if} $Pointer != "-1"
965 IntOp $0 ${SF_SELECTED} | ${SF_RO}
966 SectionSetFlags ${SecDInterlingua} $0
967 SectionSetSize ${SecDInterlingua} 0
969 StrCpy $Search "is_IS"
971 ${if} $Pointer != "-1"
972 IntOp $0 ${SF_SELECTED} | ${SF_RO}
973 SectionSetFlags ${SecDIcelandic} $0
974 SectionSetSize ${SecDIcelandic} 0
976 StrCpy $Search "it_IT"
978 ${if} $Pointer != "-1"
979 IntOp $0 ${SF_SELECTED} | ${SF_RO}
980 SectionSetFlags ${SecDItalian} $0
981 SectionSetSize ${SecDItalian} 0
983 StrCpy $Search "kk_KZ"
985 ${if} $Pointer != "-1"
986 IntOp $0 ${SF_SELECTED} | ${SF_RO}
987 SectionSetFlags ${SecDKazakh} $0
988 SectionSetSize ${SecDKazakh} 0
990 StrCpy $Search "ko_KR"
992 ${if} $Pointer != "-1"
993 IntOp $0 ${SF_SELECTED} | ${SF_RO}
994 SectionSetFlags ${SecDKorean} $0
995 SectionSetSize ${SecDKorean} 0
997 StrCpy $Search "la_LA"
999 ${if} $Pointer != "-1"
1000 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1001 SectionSetFlags ${SecDLatin} $0
1002 SectionSetSize ${SecDLatin} 0
1004 StrCpy $Search "lt_LT"
1006 ${if} $Pointer != "-1"
1007 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1008 SectionSetFlags ${SecDLithuanian} $0
1009 SectionSetSize ${SecDLithuanian} 0
1011 StrCpy $Search "lv_LV"
1013 ${if} $Pointer != "-1"
1014 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1015 SectionSetFlags ${SecDLatvian} $0
1016 SectionSetSize ${SecDLatvian} 0
1018 StrCpy $Search "nl_NL"
1020 ${if} $Pointer != "-1"
1021 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1022 SectionSetFlags ${SecDDutch} $0
1023 SectionSetSize ${SecDDutch} 0
1025 StrCpy $Search "nb_NO"
1027 ${if} $Pointer != "-1"
1028 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1029 SectionSetFlags ${SecDNorwegianNB} $0
1030 SectionSetSize ${SecDNorwegianNB} 0
1032 StrCpy $Search "nn_NO"
1034 ${if} $Pointer != "-1"
1035 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1036 SectionSetFlags ${SecDNorwegianNN} $0
1037 SectionSetSize ${SecDNorwegianNN} 0
1039 StrCpy $Search "oc_FR"
1041 ${if} $Pointer != "-1"
1042 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1043 # enable this for LyX 2.1!
1044 # SectionSetFlags ${SecDOccitan} $0
1045 # SectionSetSize ${SecDOccitan} 0
1047 StrCpy $Search "pl_PL"
1049 ${if} $Pointer != "-1"
1050 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1051 SectionSetFlags ${SecDPolish} $0
1052 SectionSetSize ${SecDPolish} 0
1054 StrCpy $Search "pt_BR"
1056 ${if} $Pointer != "-1"
1057 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1058 SectionSetFlags ${SecDPortugueseBR} $0
1059 SectionSetSize ${SecDPortugueseBR} 0
1061 StrCpy $Search "pt_PT"
1063 ${if} $Pointer != "-1"
1064 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1065 SectionSetFlags ${SecDPortuguesePT} $0
1066 SectionSetSize ${SecDPortuguesePT} 0
1068 StrCpy $Search "ro_RO"
1070 ${if} $Pointer != "-1"
1071 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1072 SectionSetFlags ${SecDRomanian} $0
1073 SectionSetSize ${SecDRomanian} 0
1075 StrCpy $Search "ru_RU"
1077 ${if} $Pointer != "-1"
1078 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1079 SectionSetFlags ${SecDRussian} $0
1080 SectionSetSize ${SecDRussian} 0
1082 StrCpy $Search "dsb_DE"
1084 ${if} $Pointer != "-1"
1085 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1086 SectionSetFlags ${SecDSorbianD} $0
1087 SectionSetSize ${SecDSorbianD} 0
1089 StrCpy $Search "hsb_DE"
1091 ${if} $Pointer != "-1"
1092 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1093 SectionSetFlags ${SecDSorbianH} $0
1094 SectionSetSize ${SecDSorbianH} 0
1096 StrCpy $Search "sq_AL"
1098 ${if} $Pointer != "-1"
1099 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1100 SectionSetFlags ${SecDAlbanian} $0
1101 SectionSetSize ${SecDAlbanian} 0
1103 StrCpy $Search "sl_SI"
1105 ${if} $Pointer != "-1"
1106 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1107 SectionSetFlags ${SecDSlovenian} $0
1108 SectionSetSize ${SecDSlovenian} 0
1110 StrCpy $Search "sk_SK"
1112 ${if} $Pointer != "-1"
1113 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1114 SectionSetFlags ${SecDSlovakian} $0
1115 SectionSetSize ${SecDSlovakian} 0
1117 StrCpy $Search "sr_RS"
1119 ${if} $Pointer != "-1"
1120 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1121 SectionSetFlags ${SecDSerbianC} $0
1122 SectionSetSize ${SecDSerbianC} 0
1124 StrCpy $Search "sr_RS-Latin"
1126 ${if} $Pointer != "-1"
1127 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1128 SectionSetFlags ${SecDSerbianL} $0
1129 SectionSetSize ${SecDSerbianL} 0
1131 StrCpy $Search "sv_SE"
1133 ${if} $Pointer != "-1"
1134 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1135 SectionSetFlags ${SecDSwedish} $0
1136 SectionSetSize ${SecDSwedish} 0
1138 StrCpy $Search "ta_IN"
1140 ${if} $Pointer != "-1"
1141 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1142 # enable this for LyX 2.1!
1143 # SectionSetFlags ${SecDTamil} $0
1144 # SectionSetSize ${SecDTamil} 0
1146 StrCpy $Search "te_IN"
1148 ${if} $Pointer != "-1"
1149 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1150 # enable this for LyX 2.1!
1151 # SectionSetFlags ${SecDTelugu} $0
1152 # SectionSetSize ${SecDTelugu} 0
1154 StrCpy $Search "th_TH"
1156 ${if} $Pointer != "-1"
1157 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1158 SectionSetFlags ${SecDThai} $0
1159 SectionSetSize ${SecDThai} 0
1161 StrCpy $Search "uk_UA"
1163 ${if} $Pointer != "-1"
1164 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1165 SectionSetFlags ${SecDUkrainian} $0
1166 SectionSetSize ${SecDUkrainian} 0
1168 StrCpy $Search "ur_PK"
1170 ${if} $Pointer != "-1"
1171 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1172 # enable this for LyX 2.1!
1173 # SectionSetFlags ${SecDUrdu} $0
1174 # SectionSetSize ${SecDUrdu} 0
1176 StrCpy $Search "vi_VN"
1178 ${if} $Pointer != "-1"
1179 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1180 SectionSetFlags ${SecDVietnamese} $0
1181 SectionSetSize ${SecDVietnamese} 0
1184 # select sections of already installed thesaurus dictionaries, make them read-only
1185 # and set the necessary size to 0 bytes
1186 StrCpy $String $FoundThes
1187 StrCpy $Search "bg_BG"
1188 Call StrPoint # function from LyXUtils.nsh
1189 ${if} $Pointer != "-1"
1190 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1191 SectionSetFlags ${SecTBulgarian} $0
1192 SectionSetSize ${SecTBulgarian} 0
1194 StrCpy $Search "ca_ES"
1196 ${if} $Pointer != "-1"
1197 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1198 SectionSetFlags ${SecTCatalan} $0
1199 SectionSetSize ${SecTCatalan} 0
1201 StrCpy $Search "cs_CZ"
1203 ${if} $Pointer != "-1"
1204 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1205 SectionSetFlags ${SecTCzech} $0
1206 SectionSetSize ${SecTCzech} 0
1208 StrCpy $Search "da_DK"
1210 ${if} $Pointer != "-1"
1211 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1212 SectionSetFlags ${SecTDanish} $0
1213 SectionSetSize ${SecTDanish} 0
1215 StrCpy $Search "de_DE"
1217 ${if} $Pointer != "-1"
1218 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1219 SectionSetFlags ${SecTGermanDA} $0
1220 SectionSetSize ${SecTGermanDA} 0
1222 StrCpy $Search "de_CH"
1224 ${if} $Pointer != "-1"
1225 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1226 SectionSetFlags ${SecTGermanCH} $0
1227 SectionSetSize ${SecTGermanCH} 0
1229 StrCpy $Search "en_GB"
1231 ${if} $Pointer != "-1"
1232 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1233 SectionSetFlags ${SecTEnglishGB} $0
1234 SectionSetSize ${SecTEnglishGB} 0
1236 StrCpy $Search "en_US"
1238 ${if} $Pointer != "-1"
1239 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1240 SectionSetFlags ${SecTEnglishUSAU} $0
1241 SectionSetSize ${SecTEnglishUSAU} 0
1243 StrCpy $Search "es_ES"
1245 ${if} $Pointer != "-1"
1246 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1247 SectionSetFlags ${SecTSpanish} $0
1248 SectionSetSize ${SecTSpanish} 0
1250 StrCpy $Search "fr_FR"
1252 ${if} $Pointer != "-1"
1253 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1254 SectionSetFlags ${SecTFrench} $0
1255 SectionSetSize ${SecTFrench} 0
1257 StrCpy $Search "ga_IR"
1259 ${if} $Pointer != "-1"
1260 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1261 SectionSetFlags ${SecTGaelic} $0
1262 SectionSetSize ${SecTGaelic} 0
1264 StrCpy $Search "el_GR"
1266 ${if} $Pointer != "-1"
1267 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1268 SectionSetFlags ${SecTGreek} $0
1269 SectionSetSize ${SecTGreek} 0
1271 StrCpy $Search "is_IS"
1273 ${if} $Pointer != "-1"
1274 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1275 SectionSetFlags ${SecTIcelandic} $0
1276 SectionSetSize ${SecTIcelandic} 0
1278 StrCpy $Search "it_IT"
1280 ${if} $Pointer != "-1"
1281 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1282 SectionSetFlags ${SecTItalian} $0
1283 SectionSetSize ${SecTItalian} 0
1285 StrCpy $Search "hu_HU"
1287 ${if} $Pointer != "-1"
1288 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1289 SectionSetFlags ${SecTHungarian} $0
1290 SectionSetSize ${SecTHungarian} 0
1292 StrCpy $Search "nb_NO"
1294 ${if} $Pointer != "-1"
1295 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1296 SectionSetFlags ${SecTNorwegianNB} $0
1297 SectionSetSize ${SecTNorwegianNB} 0
1299 StrCpy $Search "pl_PL"
1301 ${if} $Pointer != "-1"
1302 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1303 SectionSetFlags ${SecTPolish} $0
1304 SectionSetSize ${SecTPolish} 0
1306 StrCpy $Search "pt_PT"
1308 ${if} $Pointer != "-1"
1309 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1310 SectionSetFlags ${SecTPortuguese} $0
1311 SectionSetSize ${SecTPortuguese} 0
1313 StrCpy $Search "ro_RO"
1315 ${if} $Pointer != "-1"
1316 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1317 SectionSetFlags ${SecTRomanian} $0
1318 SectionSetSize ${SecTRomanian} 0
1320 StrCpy $Search "ru_RU"
1322 ${if} $Pointer != "-1"
1323 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1324 SectionSetFlags ${SecTRussian} $0
1325 SectionSetSize ${SecTRussian} 0
1327 StrCpy $Search "sl_SI"
1329 ${if} $Pointer != "-1"
1330 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1331 SectionSetFlags ${SecTSlovenian} $0
1332 SectionSetSize ${SecTSlovenian} 0
1334 StrCpy $Search "sk_SK"
1336 ${if} $Pointer != "-1"
1337 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1338 SectionSetFlags ${SecTSlovakian} $0
1339 SectionSetSize ${SecTSlovakian} 0
1341 StrCpy $Search "sv_SE"
1343 ${if} $Pointer != "-1"
1344 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1345 SectionSetFlags ${SecTSwedish} $0
1346 SectionSetSize ${SecTSwedish} 0
1348 StrCpy $Search "uk_UA"
1350 ${if} $Pointer != "-1"
1351 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1352 SectionSetFlags ${SecTUkrainian} $0
1353 SectionSetSize ${SecTUkrainian} 0
1362 # this function is called at first after starting the uninstaller
1365 !insertmacro PRINTER_INIT
1366 !insertmacro MULTIUSER_UNINIT
1368 # Check that LyX is not currently running
1369 FindProcDLL::FindProc "lyx.exe"
1371 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1375 # set registry root key
1376 ${if} $MultiUser.Privileges == "Admin"
1377 ${orif} $MultiUser.Privileges == "Power"
1378 SetShellVarContext all
1380 SetShellVarContext current
1383 # Ascertain whether the user has sufficient privileges to uninstall.
1384 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1385 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1387 ${andif} $MultiUser.Privileges != "Admin"
1388 ${andif} $MultiUser.Privileges != "Power"
1389 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1392 # warning when LyX couldn't be found in the registry
1393 ${if} $0 == "" # check in HKCU
1394 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1396 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1400 # Macro to investigate name of LyX's preferences folders to be able remove them
1401 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1403 # test if MiKTeX was installed together with LyX
1404 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1405 ${if} $0 == "Yes${APP_SERIES_KEY}"
1406 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1407 StrCpy $LaTeXInstalled "MiKTeX"
1409 SectionSetText 2 "" # hides the corresponding uninstaller section
1412 # test if JabRef was installed together with LyX
1413 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1414 ${if} $0 == "Yes${APP_SERIES_KEY}"
1415 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1416 StrCpy $JabRefInstalled "Yes"
1418 SectionSetText 3 "" # hides the corresponding uninstaller section
1421 # question message if the user really wants to uninstall LyX
1422 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes