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 Section /o "Nederlands" SecDDutch
308 StrCpy $DictCodes "nl_NL,$DictCodes"
312 Section /o "Norsk (Bokmål)" SecDNorwegianNB
313 StrCpy $DictCodes "nb_NO,$DictCodes"
317 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
318 StrCpy $DictCodes "nn_NO,$DictCodes"
322 # enable this for LyX 2.1!
323 #Section /o "Occitan" SecDOccitan
324 # StrCpy $DictCodes "oc_FR,$DictCodes"
328 Section /o "Polski" SecDPolish
329 StrCpy $DictCodes "pl_PL,$DictCodes"
333 Section /o "Português (BR)" SecDPortugueseBR
334 StrCpy $DictCodes "pt_BR,$DictCodes"
338 Section /o "Português (PT)" SecDPortuguesePT
339 StrCpy $DictCodes "pt_PT,$DictCodes"
343 Section /o "Româna" SecDRomanian
344 StrCpy $DictCodes "ro_RO,$DictCodes"
348 Section /o "Russian" SecDRussian
349 StrCpy $DictCodes "ru_RU,$DictCodes"
353 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
354 StrCpy $DictCodes "dsb_DE,$DictCodes"
358 Section /o "Serb
\9acina (Horno)" SecDSorbianH
359 StrCpy $DictCodes "hsb_DE,$DictCodes"
363 Section /o "Shqipe" SecDAlbanian
364 StrCpy $DictCodes "sq_AL,$DictCodes"
368 Section /o "Sloven
\9acina" SecDSlovenian
369 StrCpy $DictCodes "sl_SI,$DictCodes"
373 Section /o "Slovenský" SecDSlovakian
374 StrCpy $DictCodes "sk_SK,$DictCodes"
378 Section /o "Srpski" SecDSerbian
379 StrCpy $DictCodes "sr_RS,$DictCodes"
383 Section /o "Svenska" SecDSwedish
384 StrCpy $DictCodes "sv_SE,$DictCodes"
388 # enable this for LyX 2.1!
389 #Section /o "Tamil" SecDTamil
390 # StrCpy $DictCodes "ta_IN,$DictCodes"
394 # enable this for LyX 2.1!
395 #Section /o "Telugu" SecDTelugu
396 # StrCpy $DictCodes "te_IN,$DictCodes"
400 Section /o "Thai" SecDThai
401 StrCpy $DictCodes "th_TH,$DictCodes"
405 Section /o "Ukrainian" SecDUkrainian
406 StrCpy $DictCodes "uk_UA,$DictCodes"
410 # enable this for LyX 2.1!
411 #Section /o "Urdu" SecDUrdu
412 # StrCpy $DictCodes "ur_PK,$DictCodes"
416 Section /o "Vietnamese" SecDVietnamese
417 StrCpy $DictCodes "vi_VN,$DictCodes"
424 SectionGroup "Thesaurus" SecThesaurus
426 Section /o "Bulgarian" SecTBulgarian
427 StrCpy $ThesCodes "bg_BG,$ThesCodes"
431 Section /o "Català" SecTCatalan
432 StrCpy $ThesCodes "ca_ES,$ThesCodes"
436 Section /o "Ce
\9atina" SecTCzech
437 StrCpy $ThesCodes "cs_CZ,$ThesCodes"
441 Section /o "Dansk" SecTDanish
442 StrCpy $ThesCodes "da_DK,$ThesCodes"
446 Section /o "Deutsch (D/A)" SecTGermanDA
447 StrCpy $ThesCodes "de_DE,$ThesCodes"
451 Section /o "Deutsch (CH)" SecTGermanCH
452 StrCpy $ThesCodes "de_CH,$ThesCodes"
456 Section /o "English (GB)" SecTEnglishGB
457 StrCpy $ThesCodes "en_GB,$ThesCodes"
461 Section /o "English (US/AU)" SecTEnglishUSAU
462 StrCpy $ThesCodes "en_US,$ThesCodes"
466 Section /o "Español" SecTSpanish
467 StrCpy $ThesCodes "es_ES,$ThesCodes"
471 Section /o "Français" SecTFrench
472 StrCpy $ThesCodes "fr_FR,$ThesCodes"
476 Section /o "Gaeilge" SecTGaelic
477 StrCpy $ThesCodes "ga_IR,$ThesCodes"
481 Section /o "Greek" SecTGreek
482 StrCpy $ThesCodes "el_GR,$ThesCodes"
486 Section /o "Italiano" SecTItalian
487 StrCpy $ThesCodes "it_IT,$ThesCodes"
491 Section /o "Magyar" SecTHungarian
492 StrCpy $ThesCodes "hu_HU,$ThesCodes"
496 Section /o "Norsk" SecTNorwegian
497 StrCpy $ThesCodes "no_NO,$ThesCodes"
501 Section /o "Polski" SecTPolish
502 StrCpy $ThesCodes "pl_PL,$ThesCodes"
506 Section /o "Português" SecTPortuguese
507 StrCpy $ThesCodes "pt_PT,$ThesCodes"
511 Section /o "Româna" SecTRomanian
512 StrCpy $ThesCodes "ro_RO,$ThesCodes"
516 Section /o "Russian" SecTRussian
517 StrCpy $ThesCodes "ru_RU,$ThesCodes"
521 Section /o "Sloven
\9acina" SecTSlovenian
522 StrCpy $ThesCodes "sl_SI,$ThesCodes"
526 Section /o "Slovenský" SecTSlovakian
527 StrCpy $ThesCodes "sk_SK,$ThesCodes"
531 Section /o "Svenska" SecTSwedish
532 StrCpy $ThesCodes "sv_SE,$ThesCodes"
538 # Section descriptions
539 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
540 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
541 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
542 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
543 !if ${SETUPTYPE} == BUNDLE
544 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
546 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
547 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
548 !insertmacro MUI_FUNCTION_DESCRIPTION_END
551 #--------------------------------
552 # Installer initialization
556 ${If} ${AtLeastWinVista}
557 StrCpy $PrinterConf "printui.exe"
559 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
564 # .onInit must be here after the section definition because we have to set
565 # the selection states of the dictionary sections
569 ${OrIfNot} ${AtLeastWinXP}
570 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
574 # check that the installer is not currently running
575 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
578 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
581 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
584 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
588 !insertmacro MULTIUSER_INIT
590 # check if this LyX version is already installed
591 ${if} $MultiUser.Privileges == "Admin"
592 ${orif} $MultiUser.Privileges == "Power"
593 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
595 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
596 # handle also the case that LyX is already installed in HKLM
598 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
602 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
606 # check if there is an existing LyX installation of the same LyX series
607 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
608 IntOp $4 ${APP_VERSION_REVISION} + 20
610 ${if} $MultiUser.Privileges == "Admin"
611 ${orif} $MultiUser.Privileges == "Power"
612 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
613 # also check for an emergency release
615 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
618 ReadRegStr $0 HKCU "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 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
625 StrCpy $R5 $0 # store the read version number
626 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
627 # we don't stop here because we want the latest installed version
630 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
631 # store the version number and reformat it temporarily for the error message
632 StrCpy $R0 $OldVersionNumber
633 StrCpy $OldVersionNumber $R5
634 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
635 StrCpy $OldVersionNumber $R0
639 !insertmacro PRINTER_INIT
641 # this can be reset to "true" in section SecDesktop
642 StrCpy $CreateDesktopIcon "false"
643 StrCpy $CreateFileAssociations "false"
646 # Show banner while installer is intializating
647 Banner::show /NOUNLOAD "Checking system"
652 !if ${SETUPTYPE} == BUNDLE
653 # don't let the installer sections appear when the programs are already installed
654 ${if} $PathBibTeXEditor != ""
655 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
659 # select sections of already installed spell-checker dictionaries, make them read-only
660 # and set the necessary size to 0 bytes
661 StrCpy $String $FoundDict
662 StrCpy $Search "af_ZA"
663 Call StrPoint # function from LyXUtils.nsh
664 ${if} $Pointer != "-1"
665 IntOp $0 ${SF_SELECTED} | ${SF_RO}
666 SectionSetFlags ${SecDAfrikaans} $0
667 SectionSetSize ${SecDAfrikaans} 0
669 StrCpy $Search "ar_DZ"
671 ${if} $Pointer != "-1"
672 IntOp $0 ${SF_SELECTED} | ${SF_RO}
673 SectionSetFlags ${SecDArabic} $0
674 SectionSetSize ${SecDArabic} 0
676 StrCpy $Search "hy_AM"
678 ${if} $Pointer != "-1"
679 IntOp $0 ${SF_SELECTED} | ${SF_RO}
680 SectionSetFlags ${SecDArmenian} $0
681 SectionSetSize ${SecDArmenian} 0
683 StrCpy $Search "id_ID"
685 ${if} $Pointer != "-1"
686 IntOp $0 ${SF_SELECTED} | ${SF_RO}
687 SectionSetFlags ${SecDIndonesian} $0
688 SectionSetSize ${SecDIndonesian} 0
690 StrCpy $Search "ms_MY"
692 ${if} $Pointer != "-1"
693 IntOp $0 ${SF_SELECTED} | ${SF_RO}
694 SectionSetFlags ${SecDMalayan} $0
695 SectionSetSize ${SecDMalayan} 0
697 StrCpy $Search "be_BY"
699 ${if} $Pointer != "-1"
700 IntOp $0 ${SF_SELECTED} | ${SF_RO}
701 SectionSetFlags ${SecDBelarusian} $0
702 SectionSetSize ${SecDBelarusian} 0
704 StrCpy $Search "br_FR"
706 ${if} $Pointer != "-1"
707 IntOp $0 ${SF_SELECTED} | ${SF_RO}
708 SectionSetFlags ${SecDBreton} $0
709 SectionSetSize ${SecDBreton} 0
711 StrCpy $Search "bg_BG"
713 ${if} $Pointer != "-1"
714 IntOp $0 ${SF_SELECTED} | ${SF_RO}
715 SectionSetFlags ${SecDBulgarian} $0
716 SectionSetSize ${SecDBulgarian} 0
718 StrCpy $Search "ca_ES"
720 ${if} $Pointer != "-1"
721 IntOp $0 ${SF_SELECTED} | ${SF_RO}
722 SectionSetFlags ${SecDCatalanian} $0
723 SectionSetSize ${SecDCatalanian} 0
725 StrCpy $Search "cs_CZ"
727 ${if} $Pointer != "-1"
728 IntOp $0 ${SF_SELECTED} | ${SF_RO}
729 SectionSetFlags ${SecDCzech} $0
730 SectionSetSize ${SecDCzech} 0
733 StrCpy $Search "cop_EG"
735 ${if} $Pointer != "-1"
736 IntOp $0 ${SF_SELECTED} | ${SF_RO}
737 # enable this for LyX 2.1!
738 # SectionSetFlags ${SecDCoptic} $0
739 # SectionSetSize ${SecDCoptic} 0
741 StrCpy $Search "cy_GB"
743 ${if} $Pointer != "-1"
744 IntOp $0 ${SF_SELECTED} | ${SF_RO}
745 SectionSetFlags ${SecDWelsh} $0
746 SectionSetSize ${SecDWelsh} 0
748 StrCpy $Search "da_DK"
750 ${if} $Pointer != "-1"
751 IntOp $0 ${SF_SELECTED} | ${SF_RO}
752 SectionSetFlags ${SecDDanish} $0
753 SectionSetSize ${SecDDanish} 0
755 StrCpy $Search "de_AT"
757 ${if} $Pointer != "-1"
758 IntOp $0 ${SF_SELECTED} | ${SF_RO}
759 SectionSetFlags ${SecDGermanAT} $0
760 SectionSetSize ${SecDGermanAT} 0
762 StrCpy $Search "de_CH"
764 ${if} $Pointer != "-1"
765 IntOp $0 ${SF_SELECTED} | ${SF_RO}
766 SectionSetFlags ${SecDGermanCH} $0
767 SectionSetSize ${SecDGermanCH} 0
769 StrCpy $Search "de_DE"
771 ${if} $Pointer != "-1"
772 IntOp $0 ${SF_SELECTED} | ${SF_RO}
773 SectionSetFlags ${SecDGermanD} $0
774 SectionSetSize ${SecDGermanD} 0
776 StrCpy $Search "el_GR"
778 ${if} $Pointer != "-1"
779 IntOp $0 ${SF_SELECTED} | ${SF_RO}
780 SectionSetFlags ${SecDGreek} $0
781 SectionSetSize ${SecDGreek} 0
783 StrCpy $Search "et_EE"
785 ${if} $Pointer != "-1"
786 IntOp $0 ${SF_SELECTED} | ${SF_RO}
787 SectionSetFlags ${SecDEstonian} $0
788 SectionSetSize ${SecDEstonian} 0
790 StrCpy $Search "en_AU"
792 ${if} $Pointer != "-1"
793 IntOp $0 ${SF_SELECTED} | ${SF_RO}
794 # enable this for LyX 2.1!
795 # SectionSetFlags ${SecDEnglishAU} $0
796 # SectionSetSize ${SecDEnglishAU} 0
798 StrCpy $Search "en_CA"
800 ${if} $Pointer != "-1"
801 IntOp $0 ${SF_SELECTED} | ${SF_RO}
802 SectionSetFlags ${SecDEnglishCA} $0
803 SectionSetSize ${SecDEnglishCA} 0
805 StrCpy $Search "en_GB"
807 ${if} $Pointer != "-1"
808 IntOp $0 ${SF_SELECTED} | ${SF_RO}
809 SectionSetFlags ${SecDEnglishGB} $0
810 SectionSetSize ${SecDEnglishGB} 0
812 StrCpy $Search "en_NZ"
814 ${if} $Pointer != "-1"
815 IntOp $0 ${SF_SELECTED} | ${SF_RO}
816 # enable this for LyX 2.1!
817 # SectionSetFlags ${SecDEnglishNZ} $0
818 # SectionSetSize ${SecDEnglishNZ} 0
820 StrCpy $Search "en_US"
822 ${if} $Pointer != "-1"
823 IntOp $0 ${SF_SELECTED} | ${SF_RO}
824 SectionSetFlags ${SecDEnglishUS} $0
825 SectionSetSize ${SecDEnglishUS} 0
827 StrCpy $Search "es_ES"
829 ${if} $Pointer != "-1"
830 IntOp $0 ${SF_SELECTED} | ${SF_RO}
831 SectionSetFlags ${SecDSpanishES} $0
832 SectionSetSize ${SecDSpanishES} 0
834 StrCpy $Search "es_MX"
836 ${if} $Pointer != "-1"
837 IntOp $0 ${SF_SELECTED} | ${SF_RO}
838 SectionSetFlags ${SecDSpanishMX} $0
839 SectionSetSize ${SecDSpanishMX} 0
841 StrCpy $Search "eo_EO"
843 ${if} $Pointer != "-1"
844 IntOp $0 ${SF_SELECTED} | ${SF_RO}
845 SectionSetFlags ${SecDEsperanto} $0
846 SectionSetSize ${SecDEsperanto} 0
848 StrCpy $Search "eu_ES"
850 ${if} $Pointer != "-1"
851 IntOp $0 ${SF_SELECTED} | ${SF_RO}
852 SectionSetFlags ${SecDBasque} $0
853 SectionSetSize ${SecDBasque} 0
855 StrCpy $Search "fa_IR"
857 ${if} $Pointer != "-1"
858 IntOp $0 ${SF_SELECTED} | ${SF_RO}
859 SectionSetFlags ${SecDFarsi} $0
860 SectionSetSize ${SecDFarsi} 0
862 StrCpy $Search "fr_FR"
864 ${if} $Pointer != "-1"
865 IntOp $0 ${SF_SELECTED} | ${SF_RO}
866 SectionSetFlags ${SecDFrench} $0
867 SectionSetSize ${SecDFrench} 0
869 StrCpy $Search "ga_IR"
871 ${if} $Pointer != "-1"
872 IntOp $0 ${SF_SELECTED} | ${SF_RO}
873 SectionSetFlags ${SecDGaelic} $0
874 SectionSetSize ${SecDGaelic} 0
876 StrCpy $Search "gd_GB"
878 ${if} $Pointer != "-1"
879 IntOp $0 ${SF_SELECTED} | ${SF_RO}
880 SectionSetFlags ${SecDScottish} $0
881 SectionSetSize ${SecDScottish} 0
883 StrCpy $Search "gl_ES"
885 ${if} $Pointer != "-1"
886 IntOp $0 ${SF_SELECTED} | ${SF_RO}
887 SectionSetFlags ${SecDGalician} $0
888 SectionSetSize ${SecDGalician} 0
890 StrCpy $Search "he_IL"
892 ${if} $Pointer != "-1"
893 IntOp $0 ${SF_SELECTED} | ${SF_RO}
894 SectionSetFlags ${SecDHebrew} $0
895 SectionSetSize ${SecDHebrew} 0
897 StrCpy $Search "hi_IN"
899 ${if} $Pointer != "-1"
900 IntOp $0 ${SF_SELECTED} | ${SF_RO}
901 # enable this for LyX 2.1!
902 # SectionSetFlags ${SecDHindi} $0
903 # SectionSetSize ${SecDHindi} 0
905 StrCpy $Search "hr_HR"
907 ${if} $Pointer != "-1"
908 IntOp $0 ${SF_SELECTED} | ${SF_RO}
909 SectionSetFlags ${SecDCroatian} $0
910 SectionSetSize ${SecDCroatian} 0
912 StrCpy $Search "hu_HU"
914 ${if} $Pointer != "-1"
915 IntOp $0 ${SF_SELECTED} | ${SF_RO}
916 SectionSetFlags ${SecDHungarian} $0
917 SectionSetSize ${SecDHungarian} 0
919 StrCpy $Search "ia_IA"
921 ${if} $Pointer != "-1"
922 IntOp $0 ${SF_SELECTED} | ${SF_RO}
923 SectionSetFlags ${SecDInterlingua} $0
924 SectionSetSize ${SecDInterlingua} 0
926 StrCpy $Search "is_IS"
928 ${if} $Pointer != "-1"
929 IntOp $0 ${SF_SELECTED} | ${SF_RO}
930 SectionSetFlags ${SecDIcelandic} $0
931 SectionSetSize ${SecDIcelandic} 0
933 StrCpy $Search "it_IT"
935 ${if} $Pointer != "-1"
936 IntOp $0 ${SF_SELECTED} | ${SF_RO}
937 SectionSetFlags ${SecDItalian} $0
938 SectionSetSize ${SecDItalian} 0
940 StrCpy $Search "kk_KZ"
942 ${if} $Pointer != "-1"
943 IntOp $0 ${SF_SELECTED} | ${SF_RO}
944 SectionSetFlags ${SecDKazakh} $0
945 SectionSetSize ${SecDKazakh} 0
947 StrCpy $Search "ko_KR"
949 ${if} $Pointer != "-1"
950 IntOp $0 ${SF_SELECTED} | ${SF_RO}
951 SectionSetFlags ${SecDKorean} $0
952 SectionSetSize ${SecDKorean} 0
954 StrCpy $Search "la_LA"
956 ${if} $Pointer != "-1"
957 IntOp $0 ${SF_SELECTED} | ${SF_RO}
958 SectionSetFlags ${SecDLatin} $0
959 SectionSetSize ${SecDLatin} 0
961 StrCpy $Search "lt_LT"
963 ${if} $Pointer != "-1"
964 IntOp $0 ${SF_SELECTED} | ${SF_RO}
965 SectionSetFlags ${SecDLithuanian} $0
966 SectionSetSize ${SecDLithuanian} 0
968 StrCpy $Search "lv_LV"
970 ${if} $Pointer != "-1"
971 IntOp $0 ${SF_SELECTED} | ${SF_RO}
972 SectionSetFlags ${SecDLatvian} $0
973 SectionSetSize ${SecDLatvian} 0
975 StrCpy $Search "nl_NL"
977 ${if} $Pointer != "-1"
978 IntOp $0 ${SF_SELECTED} | ${SF_RO}
979 SectionSetFlags ${SecDDutch} $0
980 SectionSetSize ${SecDDutch} 0
982 StrCpy $Search "nb_NO"
984 ${if} $Pointer != "-1"
985 IntOp $0 ${SF_SELECTED} | ${SF_RO}
986 SectionSetFlags ${SecDNorwegianNB} $0
987 SectionSetSize ${SecDNorwegianNB} 0
989 StrCpy $Search "nn_NO"
991 ${if} $Pointer != "-1"
992 IntOp $0 ${SF_SELECTED} | ${SF_RO}
993 SectionSetFlags ${SecDNorwegianNN} $0
994 SectionSetSize ${SecDNorwegianNN} 0
996 StrCpy $Search "oc_FR"
998 ${if} $Pointer != "-1"
999 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1000 # enable this for LyX 2.1!
1001 # SectionSetFlags ${SecDOccitan} $0
1002 # SectionSetSize ${SecDOccitan} 0
1004 StrCpy $Search "pl_PL"
1006 ${if} $Pointer != "-1"
1007 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1008 SectionSetFlags ${SecDPolish} $0
1009 SectionSetSize ${SecDPolish} 0
1011 StrCpy $Search "pt_BR"
1013 ${if} $Pointer != "-1"
1014 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1015 SectionSetFlags ${SecDPortugueseBR} $0
1016 SectionSetSize ${SecDPortugueseBR} 0
1018 StrCpy $Search "pt_PT"
1020 ${if} $Pointer != "-1"
1021 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1022 SectionSetFlags ${SecDPortuguesePT} $0
1023 SectionSetSize ${SecDPortuguesePT} 0
1025 StrCpy $Search "ro_RO"
1027 ${if} $Pointer != "-1"
1028 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1029 SectionSetFlags ${SecDRomanian} $0
1030 SectionSetSize ${SecDRomanian} 0
1032 StrCpy $Search "ru_RU"
1034 ${if} $Pointer != "-1"
1035 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1036 SectionSetFlags ${SecDRussian} $0
1037 SectionSetSize ${SecDRussian} 0
1039 StrCpy $Search "dsb_DE"
1041 ${if} $Pointer != "-1"
1042 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1043 SectionSetFlags ${SecDSorbianD} $0
1044 SectionSetSize ${SecDSorbianD} 0
1046 StrCpy $Search "hsb_DE"
1048 ${if} $Pointer != "-1"
1049 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1050 SectionSetFlags ${SecDSorbianH} $0
1051 SectionSetSize ${SecDSorbianH} 0
1053 StrCpy $Search "sq_AL"
1055 ${if} $Pointer != "-1"
1056 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1057 SectionSetFlags ${SecDAlbanian} $0
1058 SectionSetSize ${SecDAlbanian} 0
1060 StrCpy $Search "sl_SI"
1062 ${if} $Pointer != "-1"
1063 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1064 SectionSetFlags ${SecDSlovenian} $0
1065 SectionSetSize ${SecDSlovenian} 0
1067 StrCpy $Search "sk_SK"
1069 ${if} $Pointer != "-1"
1070 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1071 SectionSetFlags ${SecDSlovakian} $0
1072 SectionSetSize ${SecDSlovakian} 0
1074 StrCpy $Search "sr_RS"
1076 ${if} $Pointer != "-1"
1077 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1078 SectionSetFlags ${SecDSerbian} $0
1079 SectionSetSize ${SecDSerbian} 0
1081 StrCpy $Search "sv_SE"
1083 ${if} $Pointer != "-1"
1084 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1085 SectionSetFlags ${SecDSwedish} $0
1086 SectionSetSize ${SecDSwedish} 0
1088 StrCpy $Search "ta_IN"
1090 ${if} $Pointer != "-1"
1091 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1092 # enable this for LyX 2.1!
1093 # SectionSetFlags ${SecDTamil} $0
1094 # SectionSetSize ${SecDTamil} 0
1096 StrCpy $Search "te_IN"
1098 ${if} $Pointer != "-1"
1099 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1100 # enable this for LyX 2.1!
1101 # SectionSetFlags ${SecDTelugu} $0
1102 # SectionSetSize ${SecDTelugu} 0
1104 StrCpy $Search "th_TH"
1106 ${if} $Pointer != "-1"
1107 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1108 SectionSetFlags ${SecDThai} $0
1109 SectionSetSize ${SecDThai} 0
1111 StrCpy $Search "uk_UA"
1113 ${if} $Pointer != "-1"
1114 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1115 SectionSetFlags ${SecDUkrainian} $0
1116 SectionSetSize ${SecDUkrainian} 0
1118 StrCpy $Search "ur_PK"
1120 ${if} $Pointer != "-1"
1121 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1122 # enable this for LyX 2.1!
1123 # SectionSetFlags ${SecDUrdu} $0
1124 # SectionSetSize ${SecDUrdu} 0
1126 StrCpy $Search "vi_VN"
1128 ${if} $Pointer != "-1"
1129 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1130 SectionSetFlags ${SecDVietnamese} $0
1131 SectionSetSize ${SecDVietnamese} 0
1134 # select sections of already installed thesaurus dictionaries, make them read-only
1135 # and set the necessary size to 0 bytes
1136 StrCpy $String $FoundThes
1137 StrCpy $Search "bg_BG"
1138 Call StrPoint # function from LyXUtils.nsh
1139 ${if} $Pointer != "-1"
1140 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1141 SectionSetFlags ${SecTBulgarian} $0
1142 SectionSetSize ${SecTBulgarian} 0
1144 StrCpy $Search "ca_ES"
1146 ${if} $Pointer != "-1"
1147 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1148 SectionSetFlags ${SecTCatalan} $0
1149 SectionSetSize ${SecTCatalan} 0
1151 StrCpy $Search "cs_CZ"
1153 ${if} $Pointer != "-1"
1154 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1155 SectionSetFlags ${SecTCzech} $0
1156 SectionSetSize ${SecTCzech} 0
1158 StrCpy $Search "da_DK"
1160 ${if} $Pointer != "-1"
1161 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1162 SectionSetFlags ${SecTDanish} $0
1163 SectionSetSize ${SecTDanish} 0
1165 StrCpy $Search "de_DE"
1167 ${if} $Pointer != "-1"
1168 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1169 SectionSetFlags ${SecTGermanDA} $0
1170 SectionSetSize ${SecTGermanDA} 0
1172 StrCpy $Search "de_CH"
1174 ${if} $Pointer != "-1"
1175 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1176 SectionSetFlags ${SecTGermanCH} $0
1177 SectionSetSize ${SecTGermanCH} 0
1179 StrCpy $Search "en_GB"
1181 ${if} $Pointer != "-1"
1182 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1183 SectionSetFlags ${SecTEnglishGB} $0
1184 SectionSetSize ${SecTEnglishGB} 0
1186 StrCpy $Search "en_US"
1188 ${if} $Pointer != "-1"
1189 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1190 SectionSetFlags ${SecTEnglishUSAU} $0
1191 SectionSetSize ${SecTEnglishUSAU} 0
1193 StrCpy $Search "es_ES"
1195 ${if} $Pointer != "-1"
1196 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1197 SectionSetFlags ${SecTSpanish} $0
1198 SectionSetSize ${SecTSpanish} 0
1200 StrCpy $Search "fr_FR"
1202 ${if} $Pointer != "-1"
1203 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1204 SectionSetFlags ${SecTFrench} $0
1205 SectionSetSize ${SecTFrench} 0
1207 StrCpy $Search "ga_IR"
1209 ${if} $Pointer != "-1"
1210 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1211 SectionSetFlags ${SecTGaelic} $0
1212 SectionSetSize ${SecTGaelic} 0
1214 StrCpy $Search "el_GR"
1216 ${if} $Pointer != "-1"
1217 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1218 SectionSetFlags ${SecTGreek} $0
1219 SectionSetSize ${SecTGreek} 0
1221 StrCpy $Search "it_IT"
1223 ${if} $Pointer != "-1"
1224 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1225 SectionSetFlags ${SecTItalian} $0
1226 SectionSetSize ${SecTItalian} 0
1228 StrCpy $Search "hu_HU"
1230 ${if} $Pointer != "-1"
1231 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1232 SectionSetFlags ${SecTHungarian} $0
1233 SectionSetSize ${SecTHungarian} 0
1235 StrCpy $Search "no_NO"
1237 ${if} $Pointer != "-1"
1238 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1239 SectionSetFlags ${SecTNorwegian} $0
1240 SectionSetSize ${SecTNorwegian} 0
1242 StrCpy $Search "pl_PL"
1244 ${if} $Pointer != "-1"
1245 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1246 SectionSetFlags ${SecTPolish} $0
1247 SectionSetSize ${SecTPolish} 0
1249 StrCpy $Search "pt_PT"
1251 ${if} $Pointer != "-1"
1252 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1253 SectionSetFlags ${SecTPortuguese} $0
1254 SectionSetSize ${SecTPortuguese} 0
1256 StrCpy $Search "ro_RO"
1258 ${if} $Pointer != "-1"
1259 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1260 SectionSetFlags ${SecTRomanian} $0
1261 SectionSetSize ${SecTRomanian} 0
1263 StrCpy $Search "ru_RU"
1265 ${if} $Pointer != "-1"
1266 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1267 SectionSetFlags ${SecTRussian} $0
1268 SectionSetSize ${SecTRussian} 0
1270 StrCpy $Search "sl_SI"
1272 ${if} $Pointer != "-1"
1273 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1274 SectionSetFlags ${SecTSlovenian} $0
1275 SectionSetSize ${SecTSlovenian} 0
1277 StrCpy $Search "sk_SK"
1279 ${if} $Pointer != "-1"
1280 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1281 SectionSetFlags ${SecTSlovakian} $0
1282 SectionSetSize ${SecTSlovakian} 0
1284 StrCpy $Search "sv_SE"
1286 ${if} $Pointer != "-1"
1287 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1288 SectionSetFlags ${SecTSwedish} $0
1289 SectionSetSize ${SecTSwedish} 0
1298 # this function is called at first after starting the uninstaller
1301 !insertmacro PRINTER_INIT
1302 !insertmacro MULTIUSER_UNINIT
1304 # Check that LyX is not currently running
1305 FindProcDLL::FindProc "lyx.exe"
1307 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1311 # set registry root key
1312 ${if} $MultiUser.Privileges == "Admin"
1313 ${orif} $MultiUser.Privileges == "Power"
1314 SetShellVarContext all
1316 SetShellVarContext current
1319 # Ascertain whether the user has sufficient privileges to uninstall.
1320 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1321 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1323 ${andif} $MultiUser.Privileges != "Admin"
1324 ${andif} $MultiUser.Privileges != "Power"
1325 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1328 # warning when LyX couldn't be found in the registry
1329 ${if} $0 == "" # check in HKCU
1330 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1332 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1336 # Macro to investigate name of LyX's preferences folders to be able remove them
1337 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1339 # test if MiKTeX was installed together with LyX
1340 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1341 ${if} $0 == "Yes${APP_SERIES_KEY}"
1342 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1343 StrCpy $LaTeXInstalled "MiKTeX"
1345 SectionSetText 2 "" # hides the corresponding uninstaller section
1348 # test if JabRef was installed together with LyX
1349 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1350 ${if} $0 == "Yes${APP_SERIES_KEY}"
1351 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1352 StrCpy $JabRefInstalled "Yes"
1354 SectionSetText 3 "" # hides the corresponding uninstaller section
1357 # question message if the user really wants to uninstall LyX
1358 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes