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 Section /o "Coptic" SecDCoptic
122 StrCpy $DictCodes "cop_EG,$DictCodes"
126 Section /o "Cymraeg" SecDWelsh
127 StrCpy $DictCodes "cy_GB,$DictCodes"
131 Section /o "Dansk" SecDDanish
132 StrCpy $DictCodes "da_DK,$DictCodes"
136 Section /o "German (A)" SecDGermanAT
137 StrCpy $DictCodes "de_AT,$DictCodes"
141 Section /o "German (CH)" SecDGermanCH
142 StrCpy $DictCodes "de_CH,$DictCodes"
146 Section "German (D)" SecDGermanD
147 # already installed by default
149 #StrCpy $DictCodes "de_DE,$DictCodes"
153 Section /o "Greek" SecDGreek
154 StrCpy $DictCodes "el_GR,$DictCodes"
158 Section /o "Eesti" SecDEstonian
159 StrCpy $DictCodes "et_EE,$DictCodes"
163 Section /o "English (AU)" SecDEnglishAU
164 StrCpy $DictCodes "en_AU,$DictCodes"
168 Section /o "English (CA)" SecDEnglishCA
169 StrCpy $DictCodes "en_CA,$DictCodes"
173 Section "English (GB)" SecDEnglishGB
174 # already installed by default
176 #StrCpy $DictCodes "en_GB,$DictCodes"
180 Section /o "English (NZ)" SecDEnglishNZ
181 StrCpy $DictCodes "en_NZ,$DictCodes"
185 Section "English (US)" SecDEnglishUS
186 # already installed by default
188 #StrCpy $DictCodes "en_US,$DictCodes"
192 Section "Español (ES)" SecDSpanishES
193 # already installed by default
195 #StrCpy $DictCodes "es_ES,$DictCodes"
199 Section "Español (MX)" SecDSpanishMX
200 # already installed by default
202 #StrCpy $DictCodes "es_MX,$DictCodes"
206 Section /o "Esperanto" SecDEsperanto
207 StrCpy $DictCodes "eo_EO,$DictCodes"
211 Section /o "Euskara" SecDBasque
212 StrCpy $DictCodes "eu_ES,$DictCodes"
216 Section /o "Farsi" SecDFarsi
217 StrCpy $DictCodes "fa_IR,$DictCodes"
221 Section "Français" SecDFrench
222 # already installed by default
224 #StrCpy $DictCodes "fr_FR,$DictCodes"
228 Section /o "Français (Canada)" SecDFrenchCanada
229 StrCpy $DictCodes "fr_CA,$DictCodes"
233 Section /o "Gaeilge" SecDGaelic
234 StrCpy $DictCodes "ga_IR,$DictCodes"
238 Section /o "Gàidhlig" SecDScottish
239 StrCpy $DictCodes "gd_GB,$DictCodes"
243 Section /o "Galego" SecDGalician
244 StrCpy $DictCodes "gl_ES,$DictCodes"
248 Section /o "Hebrew" SecDHebrew
249 StrCpy $DictCodes "he_IL,$DictCodes"
253 Section /o "Hrvatski" SecDCroatian
254 StrCpy $DictCodes "hr_HR,$DictCodes"
258 Section /o "Magyar" SecDHungarian
259 StrCpy $DictCodes "hu_HU,$DictCodes"
263 Section /o "Hindi" SecDHindi
264 StrCpy $DictCodes "hi_IN,$DictCodes"
268 Section /o "Interlingua" SecDInterlingua
269 StrCpy $DictCodes "ia_IA,$DictCodes"
273 Section /o "Íslenska" SecDIcelandic
274 StrCpy $DictCodes "is_IS,$DictCodes"
278 Section /o "Italiano" SecDItalian
279 StrCpy $DictCodes "it_IT,$DictCodes"
283 Section /o "Kazakh" SecDKazakh
284 StrCpy $DictCodes "kk_KZ,$DictCodes"
288 Section /o "Korean" SecDKorean
289 StrCpy $DictCodes "ko_KR,$DictCodes"
293 Section /o "Latina" SecDLatin
294 StrCpy $DictCodes "la_LA,$DictCodes"
298 Section /o "Lietuviu" SecDLithuanian
299 StrCpy $DictCodes "lt_LT,$DictCodes"
303 Section /o "Latvie
\9au" SecDLatvian
304 StrCpy $DictCodes "lv_LV,$DictCodes"
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 Section /o "Occitan" SecDOccitan
329 StrCpy $DictCodes "oc_FR,$DictCodes"
333 Section /o "Polski" SecDPolish
334 StrCpy $DictCodes "pl_PL,$DictCodes"
338 Section /o "Português (BR)" SecDPortugueseBR
339 StrCpy $DictCodes "pt_BR,$DictCodes"
343 Section /o "Português (PT)" SecDPortuguesePT
344 StrCpy $DictCodes "pt_PT,$DictCodes"
348 Section /o "Româna" SecDRomanian
349 StrCpy $DictCodes "ro_RO,$DictCodes"
353 Section /o "Russian" SecDRussian
354 StrCpy $DictCodes "ru_RU,$DictCodes"
358 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
359 StrCpy $DictCodes "dsb_DE,$DictCodes"
363 Section /o "Serb
\9acina (Horno)" SecDSorbianH
364 StrCpy $DictCodes "hsb_DE,$DictCodes"
368 Section /o "Shqipe" SecDAlbanian
369 StrCpy $DictCodes "sq_AL,$DictCodes"
373 Section /o "Sloven
\9acina" SecDSlovenian
374 StrCpy $DictCodes "sl_SI,$DictCodes"
378 Section /o "Slovenský" SecDSlovakian
379 StrCpy $DictCodes "sk_SK,$DictCodes"
383 Section /o "Srpski (Cirilica)" SecDSerbianC
384 StrCpy $DictCodes "sr_RS,$DictCodes"
388 Section /o "Srpski (Latinica)" SecDSerbianL
389 StrCpy $DictCodes "sr_RS-Latin,$DictCodes"
393 Section /o "Svenska" SecDSwedish
394 StrCpy $DictCodes "sv_SE,$DictCodes"
398 Section /o "Tamil" SecDTamil
399 StrCpy $DictCodes "ta_IN,$DictCodes"
403 Section /o "Telugu" SecDTelugu
404 StrCpy $DictCodes "te_IN,$DictCodes"
408 Section /o "Thai" SecDThai
409 StrCpy $DictCodes "th_TH,$DictCodes"
413 Section /o "Türkmençe" SecDTurkmen
414 StrCpy $DictCodes "tk_TM,$DictCodes"
418 Section /o "Türkçe" SecDTurkish
419 StrCpy $DictCodes "tr_TR,$DictCodes"
423 Section /o "Ukrainian" SecDUkrainian
424 StrCpy $DictCodes "uk_UA,$DictCodes"
428 Section /o "Urdu" SecDUrdu
429 StrCpy $DictCodes "ur_PK,$DictCodes"
433 Section /o "Vietnamese" SecDVietnamese
434 StrCpy $DictCodes "vi_VN,$DictCodes"
441 SectionGroup "Thesaurus" SecThesaurus
443 Section /o "Bulgarian" SecTBulgarian
444 StrCpy $ThesCodes "bg_BG,$ThesCodes"
448 Section /o "Català" SecTCatalan
449 StrCpy $ThesCodes "ca_ES,$ThesCodes"
453 Section /o "Ce
\9atina" SecTCzech
454 StrCpy $ThesCodes "cs_CZ,$ThesCodes"
458 Section /o "Dansk" SecTDanish
459 StrCpy $ThesCodes "da_DK,$ThesCodes"
463 Section /o "Deutsch (D/A)" SecTGermanDA
464 StrCpy $ThesCodes "de_DE,$ThesCodes"
468 Section /o "Deutsch (CH)" SecTGermanCH
469 StrCpy $ThesCodes "de_CH,$ThesCodes"
473 Section /o "English (GB)" SecTEnglishGB
474 StrCpy $ThesCodes "en_GB,$ThesCodes"
478 Section /o "English (US/AU)" SecTEnglishUSAU
479 StrCpy $ThesCodes "en_US,$ThesCodes"
483 Section /o "Español" SecTSpanish
484 StrCpy $ThesCodes "es_ES,$ThesCodes"
488 Section /o "Français" SecTFrench
489 StrCpy $ThesCodes "fr_FR,$ThesCodes"
493 Section /o "Gaeilge" SecTGaelic
494 StrCpy $ThesCodes "ga_IR,$ThesCodes"
498 Section /o "Galego" SecTGalician
499 StrCpy $ThesCodes "gl_ES,$ThesCodes"
503 Section /o "Greek" SecTGreek
504 StrCpy $ThesCodes "el_GR,$ThesCodes"
508 Section /o "Íslenska" SecTIcelandic
509 StrCpy $ThesCodes "is_IS,$ThesCodes"
513 Section /o "Italiano" SecTItalian
514 StrCpy $ThesCodes "it_IT,$ThesCodes"
518 Section /o "Magyar" SecTHungarian
519 StrCpy $ThesCodes "hu_HU,$ThesCodes"
523 Section /o "Norsk (Bokmål)" SecTNorwegianNB
524 StrCpy $ThesCodes "nb_NO,$ThesCodes"
528 Section /o "Polski" SecTPolish
529 StrCpy $ThesCodes "pl_PL,$ThesCodes"
533 Section /o "Português" SecTPortuguese
534 StrCpy $ThesCodes "pt_PT,$ThesCodes"
538 Section /o "Româna" SecTRomanian
539 StrCpy $ThesCodes "ro_RO,$ThesCodes"
543 Section /o "Russian" SecTRussian
544 StrCpy $ThesCodes "ru_RU,$ThesCodes"
548 Section /o "Sloven
\9acina" SecTSlovenian
549 StrCpy $ThesCodes "sl_SI,$ThesCodes"
553 Section /o "Slovenský" SecTSlovakian
554 StrCpy $ThesCodes "sk_SK,$ThesCodes"
558 Section /o "Svenska" SecTSwedish
559 StrCpy $ThesCodes "sv_SE,$ThesCodes"
563 Section /o "Ukrainian" SecTUkrainian
564 StrCpy $ThesCodes "uk_UA,$ThesCodes"
570 # Section descriptions
571 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
572 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
573 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
574 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
575 !if ${SETUPTYPE} == BUNDLE
576 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
578 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
579 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
580 !insertmacro MUI_FUNCTION_DESCRIPTION_END
583 #--------------------------------
584 # Installer initialization
588 ${If} ${AtLeastWinVista}
589 StrCpy $PrinterConf "printui.exe"
591 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
596 # .onInit must be here after the section definition because we have to set
597 # the selection states of the dictionary sections
601 ${OrIfNot} ${AtLeastWinXP}
602 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later." /SD IDOK
606 # check that the installer is not currently running
607 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
610 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK
613 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
616 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK
620 # FIXME: check that LyX is not currently running
621 #System::Call 'kernel32::CreateMutexA(i 0, i 0, t "LyX.exe.Instance") i .r1 ?e'
623 #MessageBox MB_OK "$R0"
625 # MessageBox MB_OK|MB_ICONSTOP "$(LyXRunning)"
629 !insertmacro MULTIUSER_INIT
631 # check if this LyX version is already installed
632 ${if} $MultiUser.Privileges == "Admin"
633 ${orif} $MultiUser.Privileges == "Power"
634 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayIcon"
636 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayIcon"
637 # handle also the case that LyX is already installed in HKLM
639 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayIcon"
643 # check if the uninstaller was acidentally deleted
644 # if so don't bother the user if he realy wants to install a new LyX over an existing one
645 # because he won't have a chance to deny this
646 StrCpy $4 $0 -10 # remove '\bin\lyx,0'
647 # (for FileCheck the variables $0 and $1 cannot be used)
648 !insertmacro FileCheck $5 "Uninstall-LyX.exe" "$4" # macro from LyXUtils.nsh
650 Goto ForceInstallation
652 # installing over an existing installation of the same LyX release is not necessary
653 # if the users does this he most probably has a problem with LyX that can better be solved
654 # by reinstalling LyX
655 # for beta and other test releases over-installing can even cause errors
656 MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONEXCLAMATION "$(AlreadyInstalled)" /SD IDNO IDYES ForceInstallation
661 # check if there is an existing LyX installation of the same LyX series
662 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
663 IntOp $4 ${APP_VERSION_REVISION} + 20
665 ${if} $MultiUser.Privileges == "Admin"
666 ${orif} $MultiUser.Privileges == "Power"
667 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
668 # also check for an emergency release
670 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
673 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
674 # also check for an emergency release
676 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
680 StrCpy $R5 $0 # store the read version number
681 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
682 # we don't stop here because we want the latest installed version
686 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
687 # store the version number and reformat it temporarily for the error message
688 StrCpy $R0 $OldVersionNumber
689 StrCpy $OldVersionNumber $R5
690 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)" /SD IDOK
691 StrCpy $OldVersionNumber $R0
695 !insertmacro PRINTER_INIT
697 # this can be reset to "true" in section SecDesktop
698 StrCpy $CreateDesktopIcon "false"
699 StrCpy $CreateFileAssociations "false"
702 # Show banner while installer is intializating
703 Banner::show /NOUNLOAD "Checking system"
708 !if ${SETUPTYPE} == BUNDLE
709 # don't let the installer sections appear when the programs are already installed
710 ${if} $PathBibTeXEditor != ""
711 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
715 # select sections of already installed spell-checker dictionaries, make them read-only
716 # and set the necessary size to 0 bytes
717 StrCpy $String $FoundDict
718 StrCpy $Search "af_ZA"
719 Call StrPoint # function from LyXUtils.nsh
720 ${if} $Pointer != "-1"
721 IntOp $0 ${SF_SELECTED} | ${SF_RO}
722 SectionSetFlags ${SecDAfrikaans} $0
723 SectionSetSize ${SecDAfrikaans} 0
725 StrCpy $Search "ar_DZ"
727 ${if} $Pointer != "-1"
728 IntOp $0 ${SF_SELECTED} | ${SF_RO}
729 SectionSetFlags ${SecDArabic} $0
730 SectionSetSize ${SecDArabic} 0
732 StrCpy $Search "hy_AM"
734 ${if} $Pointer != "-1"
735 IntOp $0 ${SF_SELECTED} | ${SF_RO}
736 SectionSetFlags ${SecDArmenian} $0
737 SectionSetSize ${SecDArmenian} 0
739 StrCpy $Search "id_ID"
741 ${if} $Pointer != "-1"
742 IntOp $0 ${SF_SELECTED} | ${SF_RO}
743 SectionSetFlags ${SecDIndonesian} $0
744 SectionSetSize ${SecDIndonesian} 0
746 StrCpy $Search "ms_MY"
748 ${if} $Pointer != "-1"
749 IntOp $0 ${SF_SELECTED} | ${SF_RO}
750 SectionSetFlags ${SecDMalayan} $0
751 SectionSetSize ${SecDMalayan} 0
753 StrCpy $Search "be_BY"
755 ${if} $Pointer != "-1"
756 IntOp $0 ${SF_SELECTED} | ${SF_RO}
757 SectionSetFlags ${SecDBelarusian} $0
758 SectionSetSize ${SecDBelarusian} 0
760 StrCpy $Search "br_FR"
762 ${if} $Pointer != "-1"
763 IntOp $0 ${SF_SELECTED} | ${SF_RO}
764 SectionSetFlags ${SecDBreton} $0
765 SectionSetSize ${SecDBreton} 0
767 StrCpy $Search "bg_BG"
769 ${if} $Pointer != "-1"
770 IntOp $0 ${SF_SELECTED} | ${SF_RO}
771 SectionSetFlags ${SecDBulgarian} $0
772 SectionSetSize ${SecDBulgarian} 0
774 StrCpy $Search "ca_ES"
776 ${if} $Pointer != "-1"
777 IntOp $0 ${SF_SELECTED} | ${SF_RO}
778 SectionSetFlags ${SecDCatalanian} $0
779 SectionSetSize ${SecDCatalanian} 0
781 StrCpy $Search "cs_CZ"
783 ${if} $Pointer != "-1"
784 IntOp $0 ${SF_SELECTED} | ${SF_RO}
785 SectionSetFlags ${SecDCzech} $0
786 SectionSetSize ${SecDCzech} 0
789 StrCpy $Search "cop_EG"
791 ${if} $Pointer != "-1"
792 IntOp $0 ${SF_SELECTED} | ${SF_RO}
793 SectionSetFlags ${SecDCoptic} $0
794 SectionSetSize ${SecDCoptic} 0
796 StrCpy $Search "cy_GB"
798 ${if} $Pointer != "-1"
799 IntOp $0 ${SF_SELECTED} | ${SF_RO}
800 SectionSetFlags ${SecDWelsh} $0
801 SectionSetSize ${SecDWelsh} 0
803 StrCpy $Search "da_DK"
805 ${if} $Pointer != "-1"
806 IntOp $0 ${SF_SELECTED} | ${SF_RO}
807 SectionSetFlags ${SecDDanish} $0
808 SectionSetSize ${SecDDanish} 0
810 StrCpy $Search "de_AT"
812 ${if} $Pointer != "-1"
813 IntOp $0 ${SF_SELECTED} | ${SF_RO}
814 SectionSetFlags ${SecDGermanAT} $0
815 SectionSetSize ${SecDGermanAT} 0
817 StrCpy $Search "de_CH"
819 ${if} $Pointer != "-1"
820 IntOp $0 ${SF_SELECTED} | ${SF_RO}
821 SectionSetFlags ${SecDGermanCH} $0
822 SectionSetSize ${SecDGermanCH} 0
824 StrCpy $Search "de_DE"
826 ${if} $Pointer != "-1"
827 IntOp $0 ${SF_SELECTED} | ${SF_RO}
828 SectionSetFlags ${SecDGermanD} $0
829 SectionSetSize ${SecDGermanD} 0
831 StrCpy $Search "el_GR"
833 ${if} $Pointer != "-1"
834 IntOp $0 ${SF_SELECTED} | ${SF_RO}
835 SectionSetFlags ${SecDGreek} $0
836 SectionSetSize ${SecDGreek} 0
838 StrCpy $Search "et_EE"
840 ${if} $Pointer != "-1"
841 IntOp $0 ${SF_SELECTED} | ${SF_RO}
842 SectionSetFlags ${SecDEstonian} $0
843 SectionSetSize ${SecDEstonian} 0
845 StrCpy $Search "en_AU"
847 ${if} $Pointer != "-1"
848 IntOp $0 ${SF_SELECTED} | ${SF_RO}
849 SectionSetFlags ${SecDEnglishAU} $0
850 SectionSetSize ${SecDEnglishAU} 0
852 StrCpy $Search "en_CA"
854 ${if} $Pointer != "-1"
855 IntOp $0 ${SF_SELECTED} | ${SF_RO}
856 SectionSetFlags ${SecDEnglishCA} $0
857 SectionSetSize ${SecDEnglishCA} 0
859 StrCpy $Search "en_GB"
861 ${if} $Pointer != "-1"
862 IntOp $0 ${SF_SELECTED} | ${SF_RO}
863 SectionSetFlags ${SecDEnglishGB} $0
864 SectionSetSize ${SecDEnglishGB} 0
866 StrCpy $Search "en_NZ"
868 ${if} $Pointer != "-1"
869 IntOp $0 ${SF_SELECTED} | ${SF_RO}
870 SectionSetFlags ${SecDEnglishNZ} $0
871 SectionSetSize ${SecDEnglishNZ} 0
873 StrCpy $Search "en_US"
875 ${if} $Pointer != "-1"
876 IntOp $0 ${SF_SELECTED} | ${SF_RO}
877 SectionSetFlags ${SecDEnglishUS} $0
878 SectionSetSize ${SecDEnglishUS} 0
880 StrCpy $Search "es_ES"
882 ${if} $Pointer != "-1"
883 IntOp $0 ${SF_SELECTED} | ${SF_RO}
884 SectionSetFlags ${SecDSpanishES} $0
885 SectionSetSize ${SecDSpanishES} 0
887 StrCpy $Search "es_MX"
889 ${if} $Pointer != "-1"
890 IntOp $0 ${SF_SELECTED} | ${SF_RO}
891 SectionSetFlags ${SecDSpanishMX} $0
892 SectionSetSize ${SecDSpanishMX} 0
894 StrCpy $Search "eo_EO"
896 ${if} $Pointer != "-1"
897 IntOp $0 ${SF_SELECTED} | ${SF_RO}
898 SectionSetFlags ${SecDEsperanto} $0
899 SectionSetSize ${SecDEsperanto} 0
901 StrCpy $Search "eu_ES"
903 ${if} $Pointer != "-1"
904 IntOp $0 ${SF_SELECTED} | ${SF_RO}
905 SectionSetFlags ${SecDBasque} $0
906 SectionSetSize ${SecDBasque} 0
908 StrCpy $Search "fa_IR"
910 ${if} $Pointer != "-1"
911 IntOp $0 ${SF_SELECTED} | ${SF_RO}
912 SectionSetFlags ${SecDFarsi} $0
913 SectionSetSize ${SecDFarsi} 0
915 StrCpy $Search "fr_CA"
917 ${if} $Pointer != "-1"
918 IntOp $0 ${SF_SELECTED} | ${SF_RO}
919 SectionSetFlags ${SecDFrenchCanada} $0
920 SectionSetSize ${SecDFrenchCanada} 0
922 StrCpy $Search "fr_FR"
924 ${if} $Pointer != "-1"
925 IntOp $0 ${SF_SELECTED} | ${SF_RO}
926 SectionSetFlags ${SecDFrench} $0
927 SectionSetSize ${SecDFrench} 0
929 StrCpy $Search "ga_IR"
931 ${if} $Pointer != "-1"
932 IntOp $0 ${SF_SELECTED} | ${SF_RO}
933 SectionSetFlags ${SecDGaelic} $0
934 SectionSetSize ${SecDGaelic} 0
936 StrCpy $Search "gd_GB"
938 ${if} $Pointer != "-1"
939 IntOp $0 ${SF_SELECTED} | ${SF_RO}
940 SectionSetFlags ${SecDScottish} $0
941 SectionSetSize ${SecDScottish} 0
943 StrCpy $Search "gl_ES"
945 ${if} $Pointer != "-1"
946 IntOp $0 ${SF_SELECTED} | ${SF_RO}
947 SectionSetFlags ${SecDGalician} $0
948 SectionSetSize ${SecDGalician} 0
950 StrCpy $Search "he_IL"
952 ${if} $Pointer != "-1"
953 IntOp $0 ${SF_SELECTED} | ${SF_RO}
954 SectionSetFlags ${SecDHebrew} $0
955 SectionSetSize ${SecDHebrew} 0
957 StrCpy $Search "hi_IN"
959 ${if} $Pointer != "-1"
960 IntOp $0 ${SF_SELECTED} | ${SF_RO}
961 SectionSetFlags ${SecDHindi} $0
962 SectionSetSize ${SecDHindi} 0
964 StrCpy $Search "hr_HR"
966 ${if} $Pointer != "-1"
967 IntOp $0 ${SF_SELECTED} | ${SF_RO}
968 SectionSetFlags ${SecDCroatian} $0
969 SectionSetSize ${SecDCroatian} 0
971 StrCpy $Search "hu_HU"
973 ${if} $Pointer != "-1"
974 IntOp $0 ${SF_SELECTED} | ${SF_RO}
975 SectionSetFlags ${SecDHungarian} $0
976 SectionSetSize ${SecDHungarian} 0
978 StrCpy $Search "ia_IA"
980 ${if} $Pointer != "-1"
981 IntOp $0 ${SF_SELECTED} | ${SF_RO}
982 SectionSetFlags ${SecDInterlingua} $0
983 SectionSetSize ${SecDInterlingua} 0
985 StrCpy $Search "is_IS"
987 ${if} $Pointer != "-1"
988 IntOp $0 ${SF_SELECTED} | ${SF_RO}
989 SectionSetFlags ${SecDIcelandic} $0
990 SectionSetSize ${SecDIcelandic} 0
992 StrCpy $Search "it_IT"
994 ${if} $Pointer != "-1"
995 IntOp $0 ${SF_SELECTED} | ${SF_RO}
996 SectionSetFlags ${SecDItalian} $0
997 SectionSetSize ${SecDItalian} 0
999 StrCpy $Search "kk_KZ"
1001 ${if} $Pointer != "-1"
1002 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1003 SectionSetFlags ${SecDKazakh} $0
1004 SectionSetSize ${SecDKazakh} 0
1006 StrCpy $Search "ko_KR"
1008 ${if} $Pointer != "-1"
1009 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1010 SectionSetFlags ${SecDKorean} $0
1011 SectionSetSize ${SecDKorean} 0
1013 StrCpy $Search "la_LA"
1015 ${if} $Pointer != "-1"
1016 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1017 SectionSetFlags ${SecDLatin} $0
1018 SectionSetSize ${SecDLatin} 0
1020 StrCpy $Search "lt_LT"
1022 ${if} $Pointer != "-1"
1023 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1024 SectionSetFlags ${SecDLithuanian} $0
1025 SectionSetSize ${SecDLithuanian} 0
1027 StrCpy $Search "lv_LV"
1029 ${if} $Pointer != "-1"
1030 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1031 SectionSetFlags ${SecDLatvian} $0
1032 SectionSetSize ${SecDLatvian} 0
1034 StrCpy $Search "mr_IN"
1036 ${if} $Pointer != "-1"
1037 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1038 SectionSetFlags ${SecDMarathi} $0
1039 SectionSetSize ${SecDMarathi} 0
1041 StrCpy $Search "nl_NL"
1043 ${if} $Pointer != "-1"
1044 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1045 SectionSetFlags ${SecDDutch} $0
1046 SectionSetSize ${SecDDutch} 0
1048 StrCpy $Search "nb_NO"
1050 ${if} $Pointer != "-1"
1051 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1052 SectionSetFlags ${SecDNorwegianNB} $0
1053 SectionSetSize ${SecDNorwegianNB} 0
1055 StrCpy $Search "nn_NO"
1057 ${if} $Pointer != "-1"
1058 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1059 SectionSetFlags ${SecDNorwegianNN} $0
1060 SectionSetSize ${SecDNorwegianNN} 0
1062 StrCpy $Search "oc_FR"
1064 ${if} $Pointer != "-1"
1065 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1066 SectionSetFlags ${SecDOccitan} $0
1067 SectionSetSize ${SecDOccitan} 0
1069 StrCpy $Search "pl_PL"
1071 ${if} $Pointer != "-1"
1072 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1073 SectionSetFlags ${SecDPolish} $0
1074 SectionSetSize ${SecDPolish} 0
1076 StrCpy $Search "pt_BR"
1078 ${if} $Pointer != "-1"
1079 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1080 SectionSetFlags ${SecDPortugueseBR} $0
1081 SectionSetSize ${SecDPortugueseBR} 0
1083 StrCpy $Search "pt_PT"
1085 ${if} $Pointer != "-1"
1086 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1087 SectionSetFlags ${SecDPortuguesePT} $0
1088 SectionSetSize ${SecDPortuguesePT} 0
1090 StrCpy $Search "ro_RO"
1092 ${if} $Pointer != "-1"
1093 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1094 SectionSetFlags ${SecDRomanian} $0
1095 SectionSetSize ${SecDRomanian} 0
1097 StrCpy $Search "ru_RU"
1099 ${if} $Pointer != "-1"
1100 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1101 SectionSetFlags ${SecDRussian} $0
1102 SectionSetSize ${SecDRussian} 0
1104 StrCpy $Search "dsb_DE"
1106 ${if} $Pointer != "-1"
1107 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1108 SectionSetFlags ${SecDSorbianD} $0
1109 SectionSetSize ${SecDSorbianD} 0
1111 StrCpy $Search "hsb_DE"
1113 ${if} $Pointer != "-1"
1114 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1115 SectionSetFlags ${SecDSorbianH} $0
1116 SectionSetSize ${SecDSorbianH} 0
1118 StrCpy $Search "sq_AL"
1120 ${if} $Pointer != "-1"
1121 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1122 SectionSetFlags ${SecDAlbanian} $0
1123 SectionSetSize ${SecDAlbanian} 0
1125 StrCpy $Search "sl_SI"
1127 ${if} $Pointer != "-1"
1128 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1129 SectionSetFlags ${SecDSlovenian} $0
1130 SectionSetSize ${SecDSlovenian} 0
1132 StrCpy $Search "sk_SK"
1134 ${if} $Pointer != "-1"
1135 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1136 SectionSetFlags ${SecDSlovakian} $0
1137 SectionSetSize ${SecDSlovakian} 0
1139 StrCpy $Search "sr_RS"
1141 ${if} $Pointer != "-1"
1142 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1143 SectionSetFlags ${SecDSerbianC} $0
1144 SectionSetSize ${SecDSerbianC} 0
1146 StrCpy $Search "sr_RS-Latin"
1148 ${if} $Pointer != "-1"
1149 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1150 SectionSetFlags ${SecDSerbianL} $0
1151 SectionSetSize ${SecDSerbianL} 0
1153 StrCpy $Search "sv_SE"
1155 ${if} $Pointer != "-1"
1156 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1157 SectionSetFlags ${SecDSwedish} $0
1158 SectionSetSize ${SecDSwedish} 0
1160 StrCpy $Search "ta_IN"
1162 ${if} $Pointer != "-1"
1163 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1164 SectionSetFlags ${SecDTamil} $0
1165 SectionSetSize ${SecDTamil} 0
1167 StrCpy $Search "te_IN"
1169 ${if} $Pointer != "-1"
1170 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1171 SectionSetFlags ${SecDTelugu} $0
1172 SectionSetSize ${SecDTelugu} 0
1174 StrCpy $Search "th_TH"
1176 ${if} $Pointer != "-1"
1177 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1178 SectionSetFlags ${SecDThai} $0
1179 SectionSetSize ${SecDThai} 0
1181 StrCpy $Search "tk_TM"
1183 ${if} $Pointer != "-1"
1184 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1185 SectionSetFlags ${SecDTurkmen} $0
1186 SectionSetSize ${SecDTurkmen} 0
1188 StrCpy $Search "tr_TR"
1190 ${if} $Pointer != "-1"
1191 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1192 SectionSetFlags ${SecDTurkish} $0
1193 SectionSetSize ${SecDTurkish} 0
1195 StrCpy $Search "uk_UA"
1197 ${if} $Pointer != "-1"
1198 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1199 SectionSetFlags ${SecDUkrainian} $0
1200 SectionSetSize ${SecDUkrainian} 0
1202 StrCpy $Search "ur_PK"
1204 ${if} $Pointer != "-1"
1205 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1206 SectionSetFlags ${SecDUrdu} $0
1207 SectionSetSize ${SecDUrdu} 0
1209 StrCpy $Search "vi_VN"
1211 ${if} $Pointer != "-1"
1212 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1213 SectionSetFlags ${SecDVietnamese} $0
1214 SectionSetSize ${SecDVietnamese} 0
1217 # select sections of already installed thesaurus dictionaries, make them read-only
1218 # and set the necessary size to 0 bytes
1219 StrCpy $String $FoundThes
1220 StrCpy $Search "bg_BG"
1221 Call StrPoint # function from LyXUtils.nsh
1222 ${if} $Pointer != "-1"
1223 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1224 SectionSetFlags ${SecTBulgarian} $0
1225 SectionSetSize ${SecTBulgarian} 0
1227 StrCpy $Search "ca_ES"
1229 ${if} $Pointer != "-1"
1230 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1231 SectionSetFlags ${SecTCatalan} $0
1232 SectionSetSize ${SecTCatalan} 0
1234 StrCpy $Search "cs_CZ"
1236 ${if} $Pointer != "-1"
1237 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1238 SectionSetFlags ${SecTCzech} $0
1239 SectionSetSize ${SecTCzech} 0
1241 StrCpy $Search "da_DK"
1243 ${if} $Pointer != "-1"
1244 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1245 SectionSetFlags ${SecTDanish} $0
1246 SectionSetSize ${SecTDanish} 0
1248 StrCpy $Search "de_DE"
1250 ${if} $Pointer != "-1"
1251 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1252 SectionSetFlags ${SecTGermanDA} $0
1253 SectionSetSize ${SecTGermanDA} 0
1255 StrCpy $Search "de_CH"
1257 ${if} $Pointer != "-1"
1258 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1259 SectionSetFlags ${SecTGermanCH} $0
1260 SectionSetSize ${SecTGermanCH} 0
1262 StrCpy $Search "en_GB"
1264 ${if} $Pointer != "-1"
1265 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1266 SectionSetFlags ${SecTEnglishGB} $0
1267 SectionSetSize ${SecTEnglishGB} 0
1269 StrCpy $Search "en_US"
1271 ${if} $Pointer != "-1"
1272 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1273 SectionSetFlags ${SecTEnglishUSAU} $0
1274 SectionSetSize ${SecTEnglishUSAU} 0
1276 StrCpy $Search "es_ES"
1278 ${if} $Pointer != "-1"
1279 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1280 SectionSetFlags ${SecTSpanish} $0
1281 SectionSetSize ${SecTSpanish} 0
1283 StrCpy $Search "fr_FR"
1285 ${if} $Pointer != "-1"
1286 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1287 SectionSetFlags ${SecTFrench} $0
1288 SectionSetSize ${SecTFrench} 0
1290 StrCpy $Search "ga_IR"
1292 ${if} $Pointer != "-1"
1293 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1294 SectionSetFlags ${SecTGaelic} $0
1295 SectionSetSize ${SecTGaelic} 0
1297 StrCpy $Search "gl_ES"
1299 ${if} $Pointer != "-1"
1300 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1301 SectionSetFlags ${SecTGalician} $0
1302 SectionSetSize ${SecTGalician} 0
1304 StrCpy $Search "el_GR"
1306 ${if} $Pointer != "-1"
1307 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1308 SectionSetFlags ${SecTGreek} $0
1309 SectionSetSize ${SecTGreek} 0
1311 StrCpy $Search "is_IS"
1313 ${if} $Pointer != "-1"
1314 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1315 SectionSetFlags ${SecTIcelandic} $0
1316 SectionSetSize ${SecTIcelandic} 0
1318 StrCpy $Search "it_IT"
1320 ${if} $Pointer != "-1"
1321 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1322 SectionSetFlags ${SecTItalian} $0
1323 SectionSetSize ${SecTItalian} 0
1325 StrCpy $Search "hu_HU"
1327 ${if} $Pointer != "-1"
1328 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1329 SectionSetFlags ${SecTHungarian} $0
1330 SectionSetSize ${SecTHungarian} 0
1332 StrCpy $Search "nb_NO"
1334 ${if} $Pointer != "-1"
1335 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1336 SectionSetFlags ${SecTNorwegianNB} $0
1337 SectionSetSize ${SecTNorwegianNB} 0
1339 StrCpy $Search "pl_PL"
1341 ${if} $Pointer != "-1"
1342 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1343 SectionSetFlags ${SecTPolish} $0
1344 SectionSetSize ${SecTPolish} 0
1346 StrCpy $Search "pt_PT"
1348 ${if} $Pointer != "-1"
1349 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1350 SectionSetFlags ${SecTPortuguese} $0
1351 SectionSetSize ${SecTPortuguese} 0
1353 StrCpy $Search "ro_RO"
1355 ${if} $Pointer != "-1"
1356 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1357 SectionSetFlags ${SecTRomanian} $0
1358 SectionSetSize ${SecTRomanian} 0
1360 StrCpy $Search "ru_RU"
1362 ${if} $Pointer != "-1"
1363 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1364 SectionSetFlags ${SecTRussian} $0
1365 SectionSetSize ${SecTRussian} 0
1367 StrCpy $Search "sl_SI"
1369 ${if} $Pointer != "-1"
1370 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1371 SectionSetFlags ${SecTSlovenian} $0
1372 SectionSetSize ${SecTSlovenian} 0
1374 StrCpy $Search "sk_SK"
1376 ${if} $Pointer != "-1"
1377 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1378 SectionSetFlags ${SecTSlovakian} $0
1379 SectionSetSize ${SecTSlovakian} 0
1381 StrCpy $Search "sv_SE"
1383 ${if} $Pointer != "-1"
1384 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1385 SectionSetFlags ${SecTSwedish} $0
1386 SectionSetSize ${SecTSwedish} 0
1388 StrCpy $Search "uk_UA"
1390 ${if} $Pointer != "-1"
1391 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1392 SectionSetFlags ${SecTUkrainian} $0
1393 SectionSetSize ${SecTUkrainian} 0
1402 # this function is called at first after starting the uninstaller
1405 !insertmacro PRINTER_INIT
1406 !insertmacro MULTIUSER_UNINIT
1408 # Check that LyX is not currently running
1409 FindProcDLL::FindProc "lyx.exe"
1411 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)" /SD IDOK
1415 # set registry root key
1416 ${if} $MultiUser.Privileges == "Admin"
1417 ${orif} $MultiUser.Privileges == "Power"
1418 SetShellVarContext all
1420 SetShellVarContext current
1423 # Ascertain whether the user has sufficient privileges to uninstall.
1424 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1425 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1427 ${andif} $MultiUser.Privileges != "Admin"
1428 ${andif} $MultiUser.Privileges != "Power"
1429 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)" /SD IDOK
1432 # warning when LyX couldn't be found in the registry
1433 ${if} $0 == "" # check in HKCU
1434 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1436 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)" /SD IDOK
1440 # Macro to investigate name of LyX's preferences folders to be able remove them
1441 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1443 # test if MiKTeX was installed together with LyX
1444 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1445 ${if} $0 == "Yes${APP_SERIES_KEY}"
1446 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1447 StrCpy $LaTeXInstalled "MiKTeX"
1449 SectionSetText 2 "" # hides the corresponding uninstaller section
1452 # test if JabRef was installed together with LyX
1453 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1454 ${if} $0 == "Yes${APP_SERIES_KEY}"
1455 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1456 StrCpy $JabRefInstalled "Yes"
1458 SectionSetText 3 "" # hides the corresponding uninstaller section
1461 # question message if the user really wants to uninstall LyX
1462 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" /SD IDYES IDYES +2 # continue if yes