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 "Gaeilge" SecDGaelic
232 StrCpy $DictCodes "ga_IR,$DictCodes"
236 Section /o "Gàidhlig" SecDScottish
237 StrCpy $DictCodes "gd_GB,$DictCodes"
241 Section /o "Galego" SecDGalician
242 StrCpy $DictCodes "gl_ES,$DictCodes"
246 Section /o "Hebrew" SecDHebrew
247 StrCpy $DictCodes "he_IL,$DictCodes"
251 Section /o "Hrvatski" SecDCroatian
252 StrCpy $DictCodes "hr_HR,$DictCodes"
256 Section /o "Magyar" SecDHungarian
257 StrCpy $DictCodes "hu_HU,$DictCodes"
261 # enable this for LyX 2.1!
262 #Section /o "Hindi" SecDHindi
263 # StrCpy $DictCodes "hi_IN,$DictCodes"
267 Section /o "Interlingua" SecDInterlingua
268 StrCpy $DictCodes "ia_IA,$DictCodes"
272 Section /o "Íslenska" SecDIcelandic
273 StrCpy $DictCodes "is_IS,$DictCodes"
277 Section /o "Italiano" SecDItalian
278 StrCpy $DictCodes "it_IT,$DictCodes"
282 Section /o "Kazakh" SecDKazakh
283 StrCpy $DictCodes "kk_KZ,$DictCodes"
287 Section /o "Korean" SecDKorean
288 StrCpy $DictCodes "ko_KR,$DictCodes"
292 Section /o "Latina" SecDLatin
293 StrCpy $DictCodes "la_LA,$DictCodes"
297 Section /o "Lietuviu" SecDLithuanian
298 StrCpy $DictCodes "lt_LT,$DictCodes"
302 Section /o "Latvie
\9au" SecDLatvian
303 StrCpy $DictCodes "lv_LV,$DictCodes"
307 # enable this for LyX 2.1!
308 #Section /o "Marathi" SecDMarathi
309 # StrCpy $DictCodes "mr_IN,$DictCodes"
313 Section /o "Nederlands" SecDDutch
314 StrCpy $DictCodes "nl_NL,$DictCodes"
318 Section /o "Norsk (Bokmål)" SecDNorwegianNB
319 StrCpy $DictCodes "nb_NO,$DictCodes"
323 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
324 StrCpy $DictCodes "nn_NO,$DictCodes"
328 # enable this for LyX 2.1!
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" SecDSerbian
385 StrCpy $DictCodes "sr_RS,$DictCodes"
389 Section /o "Svenska" SecDSwedish
390 StrCpy $DictCodes "sv_SE,$DictCodes"
394 # enable this for LyX 2.1!
395 #Section /o "Tamil" SecDTamil
396 # StrCpy $DictCodes "ta_IN,$DictCodes"
400 # enable this for LyX 2.1!
401 #Section /o "Telugu" SecDTelugu
402 # StrCpy $DictCodes "te_IN,$DictCodes"
406 Section /o "Thai" SecDThai
407 StrCpy $DictCodes "th_TH,$DictCodes"
411 Section /o "Ukrainian" SecDUkrainian
412 StrCpy $DictCodes "uk_UA,$DictCodes"
416 # enable this for LyX 2.1!
417 #Section /o "Urdu" SecDUrdu
418 # StrCpy $DictCodes "ur_PK,$DictCodes"
422 Section /o "Vietnamese" SecDVietnamese
423 StrCpy $DictCodes "vi_VN,$DictCodes"
430 SectionGroup "Thesaurus" SecThesaurus
432 Section /o "Bulgarian" SecTBulgarian
433 StrCpy $ThesCodes "bg_BG,$ThesCodes"
437 Section /o "Català" SecTCatalan
438 StrCpy $ThesCodes "ca_ES,$ThesCodes"
442 Section /o "Ce
\9atina" SecTCzech
443 StrCpy $ThesCodes "cs_CZ,$ThesCodes"
447 Section /o "Dansk" SecTDanish
448 StrCpy $ThesCodes "da_DK,$ThesCodes"
452 Section /o "Deutsch (D/A)" SecTGermanDA
453 StrCpy $ThesCodes "de_DE,$ThesCodes"
457 Section /o "Deutsch (CH)" SecTGermanCH
458 StrCpy $ThesCodes "de_CH,$ThesCodes"
462 Section /o "English (GB)" SecTEnglishGB
463 StrCpy $ThesCodes "en_GB,$ThesCodes"
467 Section /o "English (US/AU)" SecTEnglishUSAU
468 StrCpy $ThesCodes "en_US,$ThesCodes"
472 Section /o "Español" SecTSpanish
473 StrCpy $ThesCodes "es_ES,$ThesCodes"
477 Section /o "Français" SecTFrench
478 StrCpy $ThesCodes "fr_FR,$ThesCodes"
482 Section /o "Gaeilge" SecTGaelic
483 StrCpy $ThesCodes "ga_IR,$ThesCodes"
487 Section /o "Greek" SecTGreek
488 StrCpy $ThesCodes "el_GR,$ThesCodes"
492 Section /o "Italiano" SecTItalian
493 StrCpy $ThesCodes "it_IT,$ThesCodes"
497 Section /o "Magyar" SecTHungarian
498 StrCpy $ThesCodes "hu_HU,$ThesCodes"
502 Section /o "Norsk (Bokmål)" SecTNorwegianNB
503 StrCpy $ThesCodes "nb_NO,$ThesCodes"
507 Section /o "Polski" SecTPolish
508 StrCpy $ThesCodes "pl_PL,$ThesCodes"
512 Section /o "Português" SecTPortuguese
513 StrCpy $ThesCodes "pt_PT,$ThesCodes"
517 Section /o "Româna" SecTRomanian
518 StrCpy $ThesCodes "ro_RO,$ThesCodes"
522 Section /o "Russian" SecTRussian
523 StrCpy $ThesCodes "ru_RU,$ThesCodes"
527 Section /o "Sloven
\9acina" SecTSlovenian
528 StrCpy $ThesCodes "sl_SI,$ThesCodes"
532 Section /o "Slovenský" SecTSlovakian
533 StrCpy $ThesCodes "sk_SK,$ThesCodes"
537 Section /o "Svenska" SecTSwedish
538 StrCpy $ThesCodes "sv_SE,$ThesCodes"
544 # Section descriptions
545 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
546 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
547 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
548 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
549 !if ${SETUPTYPE} == BUNDLE
550 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
552 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
553 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
554 !insertmacro MUI_FUNCTION_DESCRIPTION_END
557 #--------------------------------
558 # Installer initialization
562 ${If} ${AtLeastWinVista}
563 StrCpy $PrinterConf "printui.exe"
565 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
570 # .onInit must be here after the section definition because we have to set
571 # the selection states of the dictionary sections
575 ${OrIfNot} ${AtLeastWinXP}
576 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
580 # check that the installer is not currently running
581 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
584 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
587 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
590 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
594 !insertmacro MULTIUSER_INIT
596 # check if this LyX version is already installed
597 ${if} $MultiUser.Privileges == "Admin"
598 ${orif} $MultiUser.Privileges == "Power"
599 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
601 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
602 # handle also the case that LyX is already installed in HKLM
604 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
608 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
612 # check if there is an existing LyX installation of the same LyX series
613 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
614 IntOp $4 ${APP_VERSION_REVISION} + 20
616 ${if} $MultiUser.Privileges == "Admin"
617 ${orif} $MultiUser.Privileges == "Power"
618 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
619 # also check for an emergency release
621 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
624 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
625 # also check for an emergency release
627 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
631 StrCpy $R5 $0 # store the read version number
632 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
633 # we don't stop here because we want the latest installed version
636 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
637 # store the version number and reformat it temporarily for the error message
638 StrCpy $R0 $OldVersionNumber
639 StrCpy $OldVersionNumber $R5
640 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
641 StrCpy $OldVersionNumber $R0
645 !insertmacro PRINTER_INIT
647 # this can be reset to "true" in section SecDesktop
648 StrCpy $CreateDesktopIcon "false"
649 StrCpy $CreateFileAssociations "false"
652 # Show banner while installer is intializating
653 Banner::show /NOUNLOAD "Checking system"
658 !if ${SETUPTYPE} == BUNDLE
659 # don't let the installer sections appear when the programs are already installed
660 ${if} $PathBibTeXEditor != ""
661 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
665 # select sections of already installed spell-checker dictionaries, make them read-only
666 # and set the necessary size to 0 bytes
667 StrCpy $String $FoundDict
668 StrCpy $Search "af_ZA"
669 Call StrPoint # function from LyXUtils.nsh
670 ${if} $Pointer != "-1"
671 IntOp $0 ${SF_SELECTED} | ${SF_RO}
672 SectionSetFlags ${SecDAfrikaans} $0
673 SectionSetSize ${SecDAfrikaans} 0
675 StrCpy $Search "ar_DZ"
677 ${if} $Pointer != "-1"
678 IntOp $0 ${SF_SELECTED} | ${SF_RO}
679 SectionSetFlags ${SecDArabic} $0
680 SectionSetSize ${SecDArabic} 0
682 StrCpy $Search "hy_AM"
684 ${if} $Pointer != "-1"
685 IntOp $0 ${SF_SELECTED} | ${SF_RO}
686 SectionSetFlags ${SecDArmenian} $0
687 SectionSetSize ${SecDArmenian} 0
689 StrCpy $Search "id_ID"
691 ${if} $Pointer != "-1"
692 IntOp $0 ${SF_SELECTED} | ${SF_RO}
693 SectionSetFlags ${SecDIndonesian} $0
694 SectionSetSize ${SecDIndonesian} 0
696 StrCpy $Search "ms_MY"
698 ${if} $Pointer != "-1"
699 IntOp $0 ${SF_SELECTED} | ${SF_RO}
700 SectionSetFlags ${SecDMalayan} $0
701 SectionSetSize ${SecDMalayan} 0
703 StrCpy $Search "be_BY"
705 ${if} $Pointer != "-1"
706 IntOp $0 ${SF_SELECTED} | ${SF_RO}
707 SectionSetFlags ${SecDBelarusian} $0
708 SectionSetSize ${SecDBelarusian} 0
710 StrCpy $Search "br_FR"
712 ${if} $Pointer != "-1"
713 IntOp $0 ${SF_SELECTED} | ${SF_RO}
714 SectionSetFlags ${SecDBreton} $0
715 SectionSetSize ${SecDBreton} 0
717 StrCpy $Search "bg_BG"
719 ${if} $Pointer != "-1"
720 IntOp $0 ${SF_SELECTED} | ${SF_RO}
721 SectionSetFlags ${SecDBulgarian} $0
722 SectionSetSize ${SecDBulgarian} 0
724 StrCpy $Search "ca_ES"
726 ${if} $Pointer != "-1"
727 IntOp $0 ${SF_SELECTED} | ${SF_RO}
728 SectionSetFlags ${SecDCatalanian} $0
729 SectionSetSize ${SecDCatalanian} 0
731 StrCpy $Search "cs_CZ"
733 ${if} $Pointer != "-1"
734 IntOp $0 ${SF_SELECTED} | ${SF_RO}
735 SectionSetFlags ${SecDCzech} $0
736 SectionSetSize ${SecDCzech} 0
739 StrCpy $Search "cop_EG"
741 ${if} $Pointer != "-1"
742 IntOp $0 ${SF_SELECTED} | ${SF_RO}
743 # enable this for LyX 2.1!
744 # SectionSetFlags ${SecDCoptic} $0
745 # SectionSetSize ${SecDCoptic} 0
747 StrCpy $Search "cy_GB"
749 ${if} $Pointer != "-1"
750 IntOp $0 ${SF_SELECTED} | ${SF_RO}
751 SectionSetFlags ${SecDWelsh} $0
752 SectionSetSize ${SecDWelsh} 0
754 StrCpy $Search "da_DK"
756 ${if} $Pointer != "-1"
757 IntOp $0 ${SF_SELECTED} | ${SF_RO}
758 SectionSetFlags ${SecDDanish} $0
759 SectionSetSize ${SecDDanish} 0
761 StrCpy $Search "de_AT"
763 ${if} $Pointer != "-1"
764 IntOp $0 ${SF_SELECTED} | ${SF_RO}
765 SectionSetFlags ${SecDGermanAT} $0
766 SectionSetSize ${SecDGermanAT} 0
768 StrCpy $Search "de_CH"
770 ${if} $Pointer != "-1"
771 IntOp $0 ${SF_SELECTED} | ${SF_RO}
772 SectionSetFlags ${SecDGermanCH} $0
773 SectionSetSize ${SecDGermanCH} 0
775 StrCpy $Search "de_DE"
777 ${if} $Pointer != "-1"
778 IntOp $0 ${SF_SELECTED} | ${SF_RO}
779 SectionSetFlags ${SecDGermanD} $0
780 SectionSetSize ${SecDGermanD} 0
782 StrCpy $Search "el_GR"
784 ${if} $Pointer != "-1"
785 IntOp $0 ${SF_SELECTED} | ${SF_RO}
786 SectionSetFlags ${SecDGreek} $0
787 SectionSetSize ${SecDGreek} 0
789 StrCpy $Search "et_EE"
791 ${if} $Pointer != "-1"
792 IntOp $0 ${SF_SELECTED} | ${SF_RO}
793 SectionSetFlags ${SecDEstonian} $0
794 SectionSetSize ${SecDEstonian} 0
796 StrCpy $Search "en_AU"
798 ${if} $Pointer != "-1"
799 IntOp $0 ${SF_SELECTED} | ${SF_RO}
800 # enable this for LyX 2.1!
801 # SectionSetFlags ${SecDEnglishAU} $0
802 # SectionSetSize ${SecDEnglishAU} 0
804 StrCpy $Search "en_CA"
806 ${if} $Pointer != "-1"
807 IntOp $0 ${SF_SELECTED} | ${SF_RO}
808 SectionSetFlags ${SecDEnglishCA} $0
809 SectionSetSize ${SecDEnglishCA} 0
811 StrCpy $Search "en_GB"
813 ${if} $Pointer != "-1"
814 IntOp $0 ${SF_SELECTED} | ${SF_RO}
815 SectionSetFlags ${SecDEnglishGB} $0
816 SectionSetSize ${SecDEnglishGB} 0
818 StrCpy $Search "en_NZ"
820 ${if} $Pointer != "-1"
821 IntOp $0 ${SF_SELECTED} | ${SF_RO}
822 # enable this for LyX 2.1!
823 # SectionSetFlags ${SecDEnglishNZ} $0
824 # SectionSetSize ${SecDEnglishNZ} 0
826 StrCpy $Search "en_US"
828 ${if} $Pointer != "-1"
829 IntOp $0 ${SF_SELECTED} | ${SF_RO}
830 SectionSetFlags ${SecDEnglishUS} $0
831 SectionSetSize ${SecDEnglishUS} 0
833 StrCpy $Search "es_ES"
835 ${if} $Pointer != "-1"
836 IntOp $0 ${SF_SELECTED} | ${SF_RO}
837 SectionSetFlags ${SecDSpanishES} $0
838 SectionSetSize ${SecDSpanishES} 0
840 StrCpy $Search "es_MX"
842 ${if} $Pointer != "-1"
843 IntOp $0 ${SF_SELECTED} | ${SF_RO}
844 SectionSetFlags ${SecDSpanishMX} $0
845 SectionSetSize ${SecDSpanishMX} 0
847 StrCpy $Search "eo_EO"
849 ${if} $Pointer != "-1"
850 IntOp $0 ${SF_SELECTED} | ${SF_RO}
851 SectionSetFlags ${SecDEsperanto} $0
852 SectionSetSize ${SecDEsperanto} 0
854 StrCpy $Search "eu_ES"
856 ${if} $Pointer != "-1"
857 IntOp $0 ${SF_SELECTED} | ${SF_RO}
858 SectionSetFlags ${SecDBasque} $0
859 SectionSetSize ${SecDBasque} 0
861 StrCpy $Search "fa_IR"
863 ${if} $Pointer != "-1"
864 IntOp $0 ${SF_SELECTED} | ${SF_RO}
865 SectionSetFlags ${SecDFarsi} $0
866 SectionSetSize ${SecDFarsi} 0
868 StrCpy $Search "fr_FR"
870 ${if} $Pointer != "-1"
871 IntOp $0 ${SF_SELECTED} | ${SF_RO}
872 SectionSetFlags ${SecDFrench} $0
873 SectionSetSize ${SecDFrench} 0
875 StrCpy $Search "ga_IR"
877 ${if} $Pointer != "-1"
878 IntOp $0 ${SF_SELECTED} | ${SF_RO}
879 SectionSetFlags ${SecDGaelic} $0
880 SectionSetSize ${SecDGaelic} 0
882 StrCpy $Search "gd_GB"
884 ${if} $Pointer != "-1"
885 IntOp $0 ${SF_SELECTED} | ${SF_RO}
886 SectionSetFlags ${SecDScottish} $0
887 SectionSetSize ${SecDScottish} 0
889 StrCpy $Search "gl_ES"
891 ${if} $Pointer != "-1"
892 IntOp $0 ${SF_SELECTED} | ${SF_RO}
893 SectionSetFlags ${SecDGalician} $0
894 SectionSetSize ${SecDGalician} 0
896 StrCpy $Search "he_IL"
898 ${if} $Pointer != "-1"
899 IntOp $0 ${SF_SELECTED} | ${SF_RO}
900 SectionSetFlags ${SecDHebrew} $0
901 SectionSetSize ${SecDHebrew} 0
903 StrCpy $Search "hi_IN"
905 ${if} $Pointer != "-1"
906 IntOp $0 ${SF_SELECTED} | ${SF_RO}
907 # enable this for LyX 2.1!
908 # SectionSetFlags ${SecDHindi} $0
909 # SectionSetSize ${SecDHindi} 0
911 StrCpy $Search "hr_HR"
913 ${if} $Pointer != "-1"
914 IntOp $0 ${SF_SELECTED} | ${SF_RO}
915 SectionSetFlags ${SecDCroatian} $0
916 SectionSetSize ${SecDCroatian} 0
918 StrCpy $Search "hu_HU"
920 ${if} $Pointer != "-1"
921 IntOp $0 ${SF_SELECTED} | ${SF_RO}
922 SectionSetFlags ${SecDHungarian} $0
923 SectionSetSize ${SecDHungarian} 0
925 StrCpy $Search "ia_IA"
927 ${if} $Pointer != "-1"
928 IntOp $0 ${SF_SELECTED} | ${SF_RO}
929 SectionSetFlags ${SecDInterlingua} $0
930 SectionSetSize ${SecDInterlingua} 0
932 StrCpy $Search "is_IS"
934 ${if} $Pointer != "-1"
935 IntOp $0 ${SF_SELECTED} | ${SF_RO}
936 SectionSetFlags ${SecDIcelandic} $0
937 SectionSetSize ${SecDIcelandic} 0
939 StrCpy $Search "it_IT"
941 ${if} $Pointer != "-1"
942 IntOp $0 ${SF_SELECTED} | ${SF_RO}
943 SectionSetFlags ${SecDItalian} $0
944 SectionSetSize ${SecDItalian} 0
946 StrCpy $Search "kk_KZ"
948 ${if} $Pointer != "-1"
949 IntOp $0 ${SF_SELECTED} | ${SF_RO}
950 SectionSetFlags ${SecDKazakh} $0
951 SectionSetSize ${SecDKazakh} 0
953 StrCpy $Search "ko_KR"
955 ${if} $Pointer != "-1"
956 IntOp $0 ${SF_SELECTED} | ${SF_RO}
957 SectionSetFlags ${SecDKorean} $0
958 SectionSetSize ${SecDKorean} 0
960 StrCpy $Search "la_LA"
962 ${if} $Pointer != "-1"
963 IntOp $0 ${SF_SELECTED} | ${SF_RO}
964 SectionSetFlags ${SecDLatin} $0
965 SectionSetSize ${SecDLatin} 0
967 StrCpy $Search "lt_LT"
969 ${if} $Pointer != "-1"
970 IntOp $0 ${SF_SELECTED} | ${SF_RO}
971 SectionSetFlags ${SecDLithuanian} $0
972 SectionSetSize ${SecDLithuanian} 0
974 StrCpy $Search "lv_LV"
976 ${if} $Pointer != "-1"
977 IntOp $0 ${SF_SELECTED} | ${SF_RO}
978 SectionSetFlags ${SecDLatvian} $0
979 SectionSetSize ${SecDLatvian} 0
981 StrCpy $Search "nl_NL"
983 ${if} $Pointer != "-1"
984 IntOp $0 ${SF_SELECTED} | ${SF_RO}
985 SectionSetFlags ${SecDDutch} $0
986 SectionSetSize ${SecDDutch} 0
988 StrCpy $Search "nb_NO"
990 ${if} $Pointer != "-1"
991 IntOp $0 ${SF_SELECTED} | ${SF_RO}
992 SectionSetFlags ${SecDNorwegianNB} $0
993 SectionSetSize ${SecDNorwegianNB} 0
995 StrCpy $Search "nn_NO"
997 ${if} $Pointer != "-1"
998 IntOp $0 ${SF_SELECTED} | ${SF_RO}
999 SectionSetFlags ${SecDNorwegianNN} $0
1000 SectionSetSize ${SecDNorwegianNN} 0
1002 StrCpy $Search "oc_FR"
1004 ${if} $Pointer != "-1"
1005 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1006 # enable this for LyX 2.1!
1007 # SectionSetFlags ${SecDOccitan} $0
1008 # SectionSetSize ${SecDOccitan} 0
1010 StrCpy $Search "pl_PL"
1012 ${if} $Pointer != "-1"
1013 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1014 SectionSetFlags ${SecDPolish} $0
1015 SectionSetSize ${SecDPolish} 0
1017 StrCpy $Search "pt_BR"
1019 ${if} $Pointer != "-1"
1020 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1021 SectionSetFlags ${SecDPortugueseBR} $0
1022 SectionSetSize ${SecDPortugueseBR} 0
1024 StrCpy $Search "pt_PT"
1026 ${if} $Pointer != "-1"
1027 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1028 SectionSetFlags ${SecDPortuguesePT} $0
1029 SectionSetSize ${SecDPortuguesePT} 0
1031 StrCpy $Search "ro_RO"
1033 ${if} $Pointer != "-1"
1034 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1035 SectionSetFlags ${SecDRomanian} $0
1036 SectionSetSize ${SecDRomanian} 0
1038 StrCpy $Search "ru_RU"
1040 ${if} $Pointer != "-1"
1041 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1042 SectionSetFlags ${SecDRussian} $0
1043 SectionSetSize ${SecDRussian} 0
1045 StrCpy $Search "dsb_DE"
1047 ${if} $Pointer != "-1"
1048 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1049 SectionSetFlags ${SecDSorbianD} $0
1050 SectionSetSize ${SecDSorbianD} 0
1052 StrCpy $Search "hsb_DE"
1054 ${if} $Pointer != "-1"
1055 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1056 SectionSetFlags ${SecDSorbianH} $0
1057 SectionSetSize ${SecDSorbianH} 0
1059 StrCpy $Search "sq_AL"
1061 ${if} $Pointer != "-1"
1062 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1063 SectionSetFlags ${SecDAlbanian} $0
1064 SectionSetSize ${SecDAlbanian} 0
1066 StrCpy $Search "sl_SI"
1068 ${if} $Pointer != "-1"
1069 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1070 SectionSetFlags ${SecDSlovenian} $0
1071 SectionSetSize ${SecDSlovenian} 0
1073 StrCpy $Search "sk_SK"
1075 ${if} $Pointer != "-1"
1076 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1077 SectionSetFlags ${SecDSlovakian} $0
1078 SectionSetSize ${SecDSlovakian} 0
1080 StrCpy $Search "sr_RS"
1082 ${if} $Pointer != "-1"
1083 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1084 SectionSetFlags ${SecDSerbian} $0
1085 SectionSetSize ${SecDSerbian} 0
1087 StrCpy $Search "sv_SE"
1089 ${if} $Pointer != "-1"
1090 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1091 SectionSetFlags ${SecDSwedish} $0
1092 SectionSetSize ${SecDSwedish} 0
1094 StrCpy $Search "ta_IN"
1096 ${if} $Pointer != "-1"
1097 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1098 # enable this for LyX 2.1!
1099 # SectionSetFlags ${SecDTamil} $0
1100 # SectionSetSize ${SecDTamil} 0
1102 StrCpy $Search "te_IN"
1104 ${if} $Pointer != "-1"
1105 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1106 # enable this for LyX 2.1!
1107 # SectionSetFlags ${SecDTelugu} $0
1108 # SectionSetSize ${SecDTelugu} 0
1110 StrCpy $Search "th_TH"
1112 ${if} $Pointer != "-1"
1113 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1114 SectionSetFlags ${SecDThai} $0
1115 SectionSetSize ${SecDThai} 0
1117 StrCpy $Search "uk_UA"
1119 ${if} $Pointer != "-1"
1120 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1121 SectionSetFlags ${SecDUkrainian} $0
1122 SectionSetSize ${SecDUkrainian} 0
1124 StrCpy $Search "ur_PK"
1126 ${if} $Pointer != "-1"
1127 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1128 # enable this for LyX 2.1!
1129 # SectionSetFlags ${SecDUrdu} $0
1130 # SectionSetSize ${SecDUrdu} 0
1132 StrCpy $Search "vi_VN"
1134 ${if} $Pointer != "-1"
1135 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1136 SectionSetFlags ${SecDVietnamese} $0
1137 SectionSetSize ${SecDVietnamese} 0
1140 # select sections of already installed thesaurus dictionaries, make them read-only
1141 # and set the necessary size to 0 bytes
1142 StrCpy $String $FoundThes
1143 StrCpy $Search "bg_BG"
1144 Call StrPoint # function from LyXUtils.nsh
1145 ${if} $Pointer != "-1"
1146 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1147 SectionSetFlags ${SecTBulgarian} $0
1148 SectionSetSize ${SecTBulgarian} 0
1150 StrCpy $Search "ca_ES"
1152 ${if} $Pointer != "-1"
1153 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1154 SectionSetFlags ${SecTCatalan} $0
1155 SectionSetSize ${SecTCatalan} 0
1157 StrCpy $Search "cs_CZ"
1159 ${if} $Pointer != "-1"
1160 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1161 SectionSetFlags ${SecTCzech} $0
1162 SectionSetSize ${SecTCzech} 0
1164 StrCpy $Search "da_DK"
1166 ${if} $Pointer != "-1"
1167 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1168 SectionSetFlags ${SecTDanish} $0
1169 SectionSetSize ${SecTDanish} 0
1171 StrCpy $Search "de_DE"
1173 ${if} $Pointer != "-1"
1174 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1175 SectionSetFlags ${SecTGermanDA} $0
1176 SectionSetSize ${SecTGermanDA} 0
1178 StrCpy $Search "de_CH"
1180 ${if} $Pointer != "-1"
1181 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1182 SectionSetFlags ${SecTGermanCH} $0
1183 SectionSetSize ${SecTGermanCH} 0
1185 StrCpy $Search "en_GB"
1187 ${if} $Pointer != "-1"
1188 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1189 SectionSetFlags ${SecTEnglishGB} $0
1190 SectionSetSize ${SecTEnglishGB} 0
1192 StrCpy $Search "en_US"
1194 ${if} $Pointer != "-1"
1195 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1196 SectionSetFlags ${SecTEnglishUSAU} $0
1197 SectionSetSize ${SecTEnglishUSAU} 0
1199 StrCpy $Search "es_ES"
1201 ${if} $Pointer != "-1"
1202 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1203 SectionSetFlags ${SecTSpanish} $0
1204 SectionSetSize ${SecTSpanish} 0
1206 StrCpy $Search "fr_FR"
1208 ${if} $Pointer != "-1"
1209 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1210 SectionSetFlags ${SecTFrench} $0
1211 SectionSetSize ${SecTFrench} 0
1213 StrCpy $Search "ga_IR"
1215 ${if} $Pointer != "-1"
1216 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1217 SectionSetFlags ${SecTGaelic} $0
1218 SectionSetSize ${SecTGaelic} 0
1220 StrCpy $Search "el_GR"
1222 ${if} $Pointer != "-1"
1223 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1224 SectionSetFlags ${SecTGreek} $0
1225 SectionSetSize ${SecTGreek} 0
1227 StrCpy $Search "it_IT"
1229 ${if} $Pointer != "-1"
1230 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1231 SectionSetFlags ${SecTItalian} $0
1232 SectionSetSize ${SecTItalian} 0
1234 StrCpy $Search "hu_HU"
1236 ${if} $Pointer != "-1"
1237 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1238 SectionSetFlags ${SecTHungarian} $0
1239 SectionSetSize ${SecTHungarian} 0
1241 StrCpy $Search "nb_NO"
1243 ${if} $Pointer != "-1"
1244 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1245 SectionSetFlags ${SecTNorwegianNB} $0
1246 SectionSetSize ${SecTNorwegianNB} 0
1248 StrCpy $Search "pl_PL"
1250 ${if} $Pointer != "-1"
1251 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1252 SectionSetFlags ${SecTPolish} $0
1253 SectionSetSize ${SecTPolish} 0
1255 StrCpy $Search "pt_PT"
1257 ${if} $Pointer != "-1"
1258 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1259 SectionSetFlags ${SecTPortuguese} $0
1260 SectionSetSize ${SecTPortuguese} 0
1262 StrCpy $Search "ro_RO"
1264 ${if} $Pointer != "-1"
1265 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1266 SectionSetFlags ${SecTRomanian} $0
1267 SectionSetSize ${SecTRomanian} 0
1269 StrCpy $Search "ru_RU"
1271 ${if} $Pointer != "-1"
1272 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1273 SectionSetFlags ${SecTRussian} $0
1274 SectionSetSize ${SecTRussian} 0
1276 StrCpy $Search "sl_SI"
1278 ${if} $Pointer != "-1"
1279 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1280 SectionSetFlags ${SecTSlovenian} $0
1281 SectionSetSize ${SecTSlovenian} 0
1283 StrCpy $Search "sk_SK"
1285 ${if} $Pointer != "-1"
1286 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1287 SectionSetFlags ${SecTSlovakian} $0
1288 SectionSetSize ${SecTSlovakian} 0
1290 StrCpy $Search "sv_SE"
1292 ${if} $Pointer != "-1"
1293 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1294 SectionSetFlags ${SecTSwedish} $0
1295 SectionSetSize ${SecTSwedish} 0
1304 # this function is called at first after starting the uninstaller
1307 !insertmacro PRINTER_INIT
1308 !insertmacro MULTIUSER_UNINIT
1310 # Check that LyX is not currently running
1311 FindProcDLL::FindProc "lyx.exe"
1313 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1317 # set registry root key
1318 ${if} $MultiUser.Privileges == "Admin"
1319 ${orif} $MultiUser.Privileges == "Power"
1320 SetShellVarContext all
1322 SetShellVarContext current
1325 # Ascertain whether the user has sufficient privileges to uninstall.
1326 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1327 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1329 ${andif} $MultiUser.Privileges != "Admin"
1330 ${andif} $MultiUser.Privileges != "Power"
1331 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1334 # warning when LyX couldn't be found in the registry
1335 ${if} $0 == "" # check in HKCU
1336 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1338 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1342 # Macro to investigate name of LyX's preferences folders to be able remove them
1343 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1345 # test if MiKTeX was installed together with LyX
1346 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1347 ${if} $0 == "Yes${APP_SERIES_KEY}"
1348 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1349 StrCpy $LaTeXInstalled "MiKTeX"
1351 SectionSetText 2 "" # hides the corresponding uninstaller section
1354 # test if JabRef was installed together with LyX
1355 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1356 ${if} $0 == "Yes${APP_SERIES_KEY}"
1357 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1358 StrCpy $JabRefInstalled "Yes"
1360 SectionSetText 3 "" # hides the corresponding uninstaller section
1363 # question message if the user really wants to uninstall LyX
1364 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes