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 "Ukrainian" SecDUkrainian
419 StrCpy $DictCodes "uk_UA,$DictCodes"
423 Section /o "Urdu" SecDUrdu
424 StrCpy $DictCodes "ur_PK,$DictCodes"
428 Section /o "Vietnamese" SecDVietnamese
429 StrCpy $DictCodes "vi_VN,$DictCodes"
436 SectionGroup "Thesaurus" SecThesaurus
438 Section /o "Bulgarian" SecTBulgarian
439 StrCpy $ThesCodes "bg_BG,$ThesCodes"
443 Section /o "Català" SecTCatalan
444 StrCpy $ThesCodes "ca_ES,$ThesCodes"
448 Section /o "Ce
\9atina" SecTCzech
449 StrCpy $ThesCodes "cs_CZ,$ThesCodes"
453 Section /o "Dansk" SecTDanish
454 StrCpy $ThesCodes "da_DK,$ThesCodes"
458 Section /o "Deutsch (D/A)" SecTGermanDA
459 StrCpy $ThesCodes "de_DE,$ThesCodes"
463 Section /o "Deutsch (CH)" SecTGermanCH
464 StrCpy $ThesCodes "de_CH,$ThesCodes"
468 Section /o "English (GB)" SecTEnglishGB
469 StrCpy $ThesCodes "en_GB,$ThesCodes"
473 Section /o "English (US/AU)" SecTEnglishUSAU
474 StrCpy $ThesCodes "en_US,$ThesCodes"
478 Section /o "Español" SecTSpanish
479 StrCpy $ThesCodes "es_ES,$ThesCodes"
483 Section /o "Français" SecTFrench
484 StrCpy $ThesCodes "fr_FR,$ThesCodes"
488 Section /o "Gaeilge" SecTGaelic
489 StrCpy $ThesCodes "ga_IR,$ThesCodes"
493 Section /o "Galego" SecTGalician
494 StrCpy $ThesCodes "gl_ES,$ThesCodes"
498 Section /o "Greek" SecTGreek
499 StrCpy $ThesCodes "el_GR,$ThesCodes"
503 Section /o "Íslenska" SecTIcelandic
504 StrCpy $ThesCodes "is_IS,$ThesCodes"
508 Section /o "Italiano" SecTItalian
509 StrCpy $ThesCodes "it_IT,$ThesCodes"
513 Section /o "Magyar" SecTHungarian
514 StrCpy $ThesCodes "hu_HU,$ThesCodes"
518 Section /o "Norsk (Bokmål)" SecTNorwegianNB
519 StrCpy $ThesCodes "nb_NO,$ThesCodes"
523 Section /o "Polski" SecTPolish
524 StrCpy $ThesCodes "pl_PL,$ThesCodes"
528 Section /o "Português" SecTPortuguese
529 StrCpy $ThesCodes "pt_PT,$ThesCodes"
533 Section /o "Româna" SecTRomanian
534 StrCpy $ThesCodes "ro_RO,$ThesCodes"
538 Section /o "Russian" SecTRussian
539 StrCpy $ThesCodes "ru_RU,$ThesCodes"
543 Section /o "Sloven
\9acina" SecTSlovenian
544 StrCpy $ThesCodes "sl_SI,$ThesCodes"
548 Section /o "Slovenský" SecTSlovakian
549 StrCpy $ThesCodes "sk_SK,$ThesCodes"
553 Section /o "Svenska" SecTSwedish
554 StrCpy $ThesCodes "sv_SE,$ThesCodes"
558 Section /o "Ukrainian" SecTUkrainian
559 StrCpy $ThesCodes "uk_UA,$ThesCodes"
565 # Section descriptions
566 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
567 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
568 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
569 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
570 !if ${SETUPTYPE} == BUNDLE
571 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
573 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
574 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
575 !insertmacro MUI_FUNCTION_DESCRIPTION_END
578 #--------------------------------
579 # Installer initialization
583 ${If} ${AtLeastWinVista}
584 StrCpy $PrinterConf "printui.exe"
586 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
591 # .onInit must be here after the section definition because we have to set
592 # the selection states of the dictionary sections
596 ${OrIfNot} ${AtLeastWinXP}
597 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later." /SD IDOK
601 # check that the installer is not currently running
602 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
605 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK
608 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
611 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK
615 # FIXME: check that LyX is not currently running
616 #System::Call 'kernel32::CreateMutexA(i 0, i 0, t "LyX.exe.Instance") i .r1 ?e'
618 #MessageBox MB_OK "$R0"
620 # MessageBox MB_OK|MB_ICONSTOP "$(LyXRunning)"
624 !insertmacro MULTIUSER_INIT
626 # check if this LyX version is already installed
627 ${if} $MultiUser.Privileges == "Admin"
628 ${orif} $MultiUser.Privileges == "Power"
629 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayIcon"
631 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayIcon"
632 # handle also the case that LyX is already installed in HKLM
634 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayIcon"
638 # check if the uninstaller was acidentally deleted
639 # if so don't bother the user if he realy wants to install a new LyX over an existing one
640 # because he won't have a chance to deny this
641 StrCpy $4 $0 -10 # remove '\bin\lyx,0'
642 # (for FileCheck the variables $0 and $1 cannot be used)
643 !insertmacro FileCheck $5 "Uninstall-LyX.exe" "$4" # macro from LyXUtils.nsh
645 Goto ForceInstallation
647 # installing over an existing installation of the same LyX release is not necessary
648 # if the users does this he most probably has a problem with LyX that can better be solved
649 # by reinstalling LyX
650 # for beta and other test releases over-installing can even cause errors
651 MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONEXCLAMATION "$(AlreadyInstalled)" /SD IDNO IDYES ForceInstallation
656 # check if there is an existing LyX installation of the same LyX series
657 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
658 IntOp $4 ${APP_VERSION_REVISION} + 20
660 ${if} $MultiUser.Privileges == "Admin"
661 ${orif} $MultiUser.Privileges == "Power"
662 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
663 # also check for an emergency release
665 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
668 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
669 # also check for an emergency release
671 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
675 StrCpy $R5 $0 # store the read version number
676 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
677 # we don't stop here because we want the latest installed version
681 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
682 # store the version number and reformat it temporarily for the error message
683 StrCpy $R0 $OldVersionNumber
684 StrCpy $OldVersionNumber $R5
685 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)" /SD IDOK
686 StrCpy $OldVersionNumber $R0
690 !insertmacro PRINTER_INIT
692 # this can be reset to "true" in section SecDesktop
693 StrCpy $CreateDesktopIcon "false"
694 StrCpy $CreateFileAssociations "false"
697 # Show banner while installer is intializating
698 Banner::show /NOUNLOAD "Checking system"
703 !if ${SETUPTYPE} == BUNDLE
704 # don't let the installer sections appear when the programs are already installed
705 ${if} $PathBibTeXEditor != ""
706 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
710 # select sections of already installed spell-checker dictionaries, make them read-only
711 # and set the necessary size to 0 bytes
712 StrCpy $String $FoundDict
713 StrCpy $Search "af_ZA"
714 Call StrPoint # function from LyXUtils.nsh
715 ${if} $Pointer != "-1"
716 IntOp $0 ${SF_SELECTED} | ${SF_RO}
717 SectionSetFlags ${SecDAfrikaans} $0
718 SectionSetSize ${SecDAfrikaans} 0
720 StrCpy $Search "ar_DZ"
722 ${if} $Pointer != "-1"
723 IntOp $0 ${SF_SELECTED} | ${SF_RO}
724 SectionSetFlags ${SecDArabic} $0
725 SectionSetSize ${SecDArabic} 0
727 StrCpy $Search "hy_AM"
729 ${if} $Pointer != "-1"
730 IntOp $0 ${SF_SELECTED} | ${SF_RO}
731 SectionSetFlags ${SecDArmenian} $0
732 SectionSetSize ${SecDArmenian} 0
734 StrCpy $Search "id_ID"
736 ${if} $Pointer != "-1"
737 IntOp $0 ${SF_SELECTED} | ${SF_RO}
738 SectionSetFlags ${SecDIndonesian} $0
739 SectionSetSize ${SecDIndonesian} 0
741 StrCpy $Search "ms_MY"
743 ${if} $Pointer != "-1"
744 IntOp $0 ${SF_SELECTED} | ${SF_RO}
745 SectionSetFlags ${SecDMalayan} $0
746 SectionSetSize ${SecDMalayan} 0
748 StrCpy $Search "be_BY"
750 ${if} $Pointer != "-1"
751 IntOp $0 ${SF_SELECTED} | ${SF_RO}
752 SectionSetFlags ${SecDBelarusian} $0
753 SectionSetSize ${SecDBelarusian} 0
755 StrCpy $Search "br_FR"
757 ${if} $Pointer != "-1"
758 IntOp $0 ${SF_SELECTED} | ${SF_RO}
759 SectionSetFlags ${SecDBreton} $0
760 SectionSetSize ${SecDBreton} 0
762 StrCpy $Search "bg_BG"
764 ${if} $Pointer != "-1"
765 IntOp $0 ${SF_SELECTED} | ${SF_RO}
766 SectionSetFlags ${SecDBulgarian} $0
767 SectionSetSize ${SecDBulgarian} 0
769 StrCpy $Search "ca_ES"
771 ${if} $Pointer != "-1"
772 IntOp $0 ${SF_SELECTED} | ${SF_RO}
773 SectionSetFlags ${SecDCatalanian} $0
774 SectionSetSize ${SecDCatalanian} 0
776 StrCpy $Search "cs_CZ"
778 ${if} $Pointer != "-1"
779 IntOp $0 ${SF_SELECTED} | ${SF_RO}
780 SectionSetFlags ${SecDCzech} $0
781 SectionSetSize ${SecDCzech} 0
784 StrCpy $Search "cop_EG"
786 ${if} $Pointer != "-1"
787 IntOp $0 ${SF_SELECTED} | ${SF_RO}
788 SectionSetFlags ${SecDCoptic} $0
789 SectionSetSize ${SecDCoptic} 0
791 StrCpy $Search "cy_GB"
793 ${if} $Pointer != "-1"
794 IntOp $0 ${SF_SELECTED} | ${SF_RO}
795 SectionSetFlags ${SecDWelsh} $0
796 SectionSetSize ${SecDWelsh} 0
798 StrCpy $Search "da_DK"
800 ${if} $Pointer != "-1"
801 IntOp $0 ${SF_SELECTED} | ${SF_RO}
802 SectionSetFlags ${SecDDanish} $0
803 SectionSetSize ${SecDDanish} 0
805 StrCpy $Search "de_AT"
807 ${if} $Pointer != "-1"
808 IntOp $0 ${SF_SELECTED} | ${SF_RO}
809 SectionSetFlags ${SecDGermanAT} $0
810 SectionSetSize ${SecDGermanAT} 0
812 StrCpy $Search "de_CH"
814 ${if} $Pointer != "-1"
815 IntOp $0 ${SF_SELECTED} | ${SF_RO}
816 SectionSetFlags ${SecDGermanCH} $0
817 SectionSetSize ${SecDGermanCH} 0
819 StrCpy $Search "de_DE"
821 ${if} $Pointer != "-1"
822 IntOp $0 ${SF_SELECTED} | ${SF_RO}
823 SectionSetFlags ${SecDGermanD} $0
824 SectionSetSize ${SecDGermanD} 0
826 StrCpy $Search "el_GR"
828 ${if} $Pointer != "-1"
829 IntOp $0 ${SF_SELECTED} | ${SF_RO}
830 SectionSetFlags ${SecDGreek} $0
831 SectionSetSize ${SecDGreek} 0
833 StrCpy $Search "et_EE"
835 ${if} $Pointer != "-1"
836 IntOp $0 ${SF_SELECTED} | ${SF_RO}
837 SectionSetFlags ${SecDEstonian} $0
838 SectionSetSize ${SecDEstonian} 0
840 StrCpy $Search "en_AU"
842 ${if} $Pointer != "-1"
843 IntOp $0 ${SF_SELECTED} | ${SF_RO}
844 SectionSetFlags ${SecDEnglishAU} $0
845 SectionSetSize ${SecDEnglishAU} 0
847 StrCpy $Search "en_CA"
849 ${if} $Pointer != "-1"
850 IntOp $0 ${SF_SELECTED} | ${SF_RO}
851 SectionSetFlags ${SecDEnglishCA} $0
852 SectionSetSize ${SecDEnglishCA} 0
854 StrCpy $Search "en_GB"
856 ${if} $Pointer != "-1"
857 IntOp $0 ${SF_SELECTED} | ${SF_RO}
858 SectionSetFlags ${SecDEnglishGB} $0
859 SectionSetSize ${SecDEnglishGB} 0
861 StrCpy $Search "en_NZ"
863 ${if} $Pointer != "-1"
864 IntOp $0 ${SF_SELECTED} | ${SF_RO}
865 SectionSetFlags ${SecDEnglishNZ} $0
866 SectionSetSize ${SecDEnglishNZ} 0
868 StrCpy $Search "en_US"
870 ${if} $Pointer != "-1"
871 IntOp $0 ${SF_SELECTED} | ${SF_RO}
872 SectionSetFlags ${SecDEnglishUS} $0
873 SectionSetSize ${SecDEnglishUS} 0
875 StrCpy $Search "es_ES"
877 ${if} $Pointer != "-1"
878 IntOp $0 ${SF_SELECTED} | ${SF_RO}
879 SectionSetFlags ${SecDSpanishES} $0
880 SectionSetSize ${SecDSpanishES} 0
882 StrCpy $Search "es_MX"
884 ${if} $Pointer != "-1"
885 IntOp $0 ${SF_SELECTED} | ${SF_RO}
886 SectionSetFlags ${SecDSpanishMX} $0
887 SectionSetSize ${SecDSpanishMX} 0
889 StrCpy $Search "eo_EO"
891 ${if} $Pointer != "-1"
892 IntOp $0 ${SF_SELECTED} | ${SF_RO}
893 SectionSetFlags ${SecDEsperanto} $0
894 SectionSetSize ${SecDEsperanto} 0
896 StrCpy $Search "eu_ES"
898 ${if} $Pointer != "-1"
899 IntOp $0 ${SF_SELECTED} | ${SF_RO}
900 SectionSetFlags ${SecDBasque} $0
901 SectionSetSize ${SecDBasque} 0
903 StrCpy $Search "fa_IR"
905 ${if} $Pointer != "-1"
906 IntOp $0 ${SF_SELECTED} | ${SF_RO}
907 SectionSetFlags ${SecDFarsi} $0
908 SectionSetSize ${SecDFarsi} 0
910 StrCpy $Search "fr_CA"
912 ${if} $Pointer != "-1"
913 IntOp $0 ${SF_SELECTED} | ${SF_RO}
914 SectionSetFlags ${SecDFrenchCanada} $0
915 SectionSetSize ${SecDFrenchCanada} 0
917 StrCpy $Search "fr_FR"
919 ${if} $Pointer != "-1"
920 IntOp $0 ${SF_SELECTED} | ${SF_RO}
921 SectionSetFlags ${SecDFrench} $0
922 SectionSetSize ${SecDFrench} 0
924 StrCpy $Search "ga_IR"
926 ${if} $Pointer != "-1"
927 IntOp $0 ${SF_SELECTED} | ${SF_RO}
928 SectionSetFlags ${SecDGaelic} $0
929 SectionSetSize ${SecDGaelic} 0
931 StrCpy $Search "gd_GB"
933 ${if} $Pointer != "-1"
934 IntOp $0 ${SF_SELECTED} | ${SF_RO}
935 SectionSetFlags ${SecDScottish} $0
936 SectionSetSize ${SecDScottish} 0
938 StrCpy $Search "gl_ES"
940 ${if} $Pointer != "-1"
941 IntOp $0 ${SF_SELECTED} | ${SF_RO}
942 SectionSetFlags ${SecDGalician} $0
943 SectionSetSize ${SecDGalician} 0
945 StrCpy $Search "he_IL"
947 ${if} $Pointer != "-1"
948 IntOp $0 ${SF_SELECTED} | ${SF_RO}
949 SectionSetFlags ${SecDHebrew} $0
950 SectionSetSize ${SecDHebrew} 0
952 StrCpy $Search "hi_IN"
954 ${if} $Pointer != "-1"
955 IntOp $0 ${SF_SELECTED} | ${SF_RO}
956 SectionSetFlags ${SecDHindi} $0
957 SectionSetSize ${SecDHindi} 0
959 StrCpy $Search "hr_HR"
961 ${if} $Pointer != "-1"
962 IntOp $0 ${SF_SELECTED} | ${SF_RO}
963 SectionSetFlags ${SecDCroatian} $0
964 SectionSetSize ${SecDCroatian} 0
966 StrCpy $Search "hu_HU"
968 ${if} $Pointer != "-1"
969 IntOp $0 ${SF_SELECTED} | ${SF_RO}
970 SectionSetFlags ${SecDHungarian} $0
971 SectionSetSize ${SecDHungarian} 0
973 StrCpy $Search "ia_IA"
975 ${if} $Pointer != "-1"
976 IntOp $0 ${SF_SELECTED} | ${SF_RO}
977 SectionSetFlags ${SecDInterlingua} $0
978 SectionSetSize ${SecDInterlingua} 0
980 StrCpy $Search "is_IS"
982 ${if} $Pointer != "-1"
983 IntOp $0 ${SF_SELECTED} | ${SF_RO}
984 SectionSetFlags ${SecDIcelandic} $0
985 SectionSetSize ${SecDIcelandic} 0
987 StrCpy $Search "it_IT"
989 ${if} $Pointer != "-1"
990 IntOp $0 ${SF_SELECTED} | ${SF_RO}
991 SectionSetFlags ${SecDItalian} $0
992 SectionSetSize ${SecDItalian} 0
994 StrCpy $Search "kk_KZ"
996 ${if} $Pointer != "-1"
997 IntOp $0 ${SF_SELECTED} | ${SF_RO}
998 SectionSetFlags ${SecDKazakh} $0
999 SectionSetSize ${SecDKazakh} 0
1001 StrCpy $Search "ko_KR"
1003 ${if} $Pointer != "-1"
1004 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1005 SectionSetFlags ${SecDKorean} $0
1006 SectionSetSize ${SecDKorean} 0
1008 StrCpy $Search "la_LA"
1010 ${if} $Pointer != "-1"
1011 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1012 SectionSetFlags ${SecDLatin} $0
1013 SectionSetSize ${SecDLatin} 0
1015 StrCpy $Search "lt_LT"
1017 ${if} $Pointer != "-1"
1018 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1019 SectionSetFlags ${SecDLithuanian} $0
1020 SectionSetSize ${SecDLithuanian} 0
1022 StrCpy $Search "lv_LV"
1024 ${if} $Pointer != "-1"
1025 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1026 SectionSetFlags ${SecDLatvian} $0
1027 SectionSetSize ${SecDLatvian} 0
1029 StrCpy $Search "mr_IN"
1031 ${if} $Pointer != "-1"
1032 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1033 SectionSetFlags ${SecDMarathi} $0
1034 SectionSetSize ${SecDMarathi} 0
1036 StrCpy $Search "nl_NL"
1038 ${if} $Pointer != "-1"
1039 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1040 SectionSetFlags ${SecDDutch} $0
1041 SectionSetSize ${SecDDutch} 0
1043 StrCpy $Search "nb_NO"
1045 ${if} $Pointer != "-1"
1046 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1047 SectionSetFlags ${SecDNorwegianNB} $0
1048 SectionSetSize ${SecDNorwegianNB} 0
1050 StrCpy $Search "nn_NO"
1052 ${if} $Pointer != "-1"
1053 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1054 SectionSetFlags ${SecDNorwegianNN} $0
1055 SectionSetSize ${SecDNorwegianNN} 0
1057 StrCpy $Search "oc_FR"
1059 ${if} $Pointer != "-1"
1060 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1061 SectionSetFlags ${SecDOccitan} $0
1062 SectionSetSize ${SecDOccitan} 0
1064 StrCpy $Search "pl_PL"
1066 ${if} $Pointer != "-1"
1067 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1068 SectionSetFlags ${SecDPolish} $0
1069 SectionSetSize ${SecDPolish} 0
1071 StrCpy $Search "pt_BR"
1073 ${if} $Pointer != "-1"
1074 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1075 SectionSetFlags ${SecDPortugueseBR} $0
1076 SectionSetSize ${SecDPortugueseBR} 0
1078 StrCpy $Search "pt_PT"
1080 ${if} $Pointer != "-1"
1081 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1082 SectionSetFlags ${SecDPortuguesePT} $0
1083 SectionSetSize ${SecDPortuguesePT} 0
1085 StrCpy $Search "ro_RO"
1087 ${if} $Pointer != "-1"
1088 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1089 SectionSetFlags ${SecDRomanian} $0
1090 SectionSetSize ${SecDRomanian} 0
1092 StrCpy $Search "ru_RU"
1094 ${if} $Pointer != "-1"
1095 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1096 SectionSetFlags ${SecDRussian} $0
1097 SectionSetSize ${SecDRussian} 0
1099 StrCpy $Search "dsb_DE"
1101 ${if} $Pointer != "-1"
1102 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1103 SectionSetFlags ${SecDSorbianD} $0
1104 SectionSetSize ${SecDSorbianD} 0
1106 StrCpy $Search "hsb_DE"
1108 ${if} $Pointer != "-1"
1109 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1110 SectionSetFlags ${SecDSorbianH} $0
1111 SectionSetSize ${SecDSorbianH} 0
1113 StrCpy $Search "sq_AL"
1115 ${if} $Pointer != "-1"
1116 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1117 SectionSetFlags ${SecDAlbanian} $0
1118 SectionSetSize ${SecDAlbanian} 0
1120 StrCpy $Search "sl_SI"
1122 ${if} $Pointer != "-1"
1123 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1124 SectionSetFlags ${SecDSlovenian} $0
1125 SectionSetSize ${SecDSlovenian} 0
1127 StrCpy $Search "sk_SK"
1129 ${if} $Pointer != "-1"
1130 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1131 SectionSetFlags ${SecDSlovakian} $0
1132 SectionSetSize ${SecDSlovakian} 0
1134 StrCpy $Search "sr_RS"
1136 ${if} $Pointer != "-1"
1137 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1138 SectionSetFlags ${SecDSerbianC} $0
1139 SectionSetSize ${SecDSerbianC} 0
1141 StrCpy $Search "sr_RS-Latin"
1143 ${if} $Pointer != "-1"
1144 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1145 SectionSetFlags ${SecDSerbianL} $0
1146 SectionSetSize ${SecDSerbianL} 0
1148 StrCpy $Search "sv_SE"
1150 ${if} $Pointer != "-1"
1151 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1152 SectionSetFlags ${SecDSwedish} $0
1153 SectionSetSize ${SecDSwedish} 0
1155 StrCpy $Search "ta_IN"
1157 ${if} $Pointer != "-1"
1158 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1159 SectionSetFlags ${SecDTamil} $0
1160 SectionSetSize ${SecDTamil} 0
1162 StrCpy $Search "te_IN"
1164 ${if} $Pointer != "-1"
1165 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1166 SectionSetFlags ${SecDTelugu} $0
1167 SectionSetSize ${SecDTelugu} 0
1169 StrCpy $Search "th_TH"
1171 ${if} $Pointer != "-1"
1172 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1173 SectionSetFlags ${SecDThai} $0
1174 SectionSetSize ${SecDThai} 0
1176 StrCpy $Search "tk_TM"
1178 ${if} $Pointer != "-1"
1179 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1180 SectionSetFlags ${SecDTurkmen} $0
1181 SectionSetSize ${SecDTurkmen} 0
1183 StrCpy $Search "uk_UA"
1185 ${if} $Pointer != "-1"
1186 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1187 SectionSetFlags ${SecDUkrainian} $0
1188 SectionSetSize ${SecDUkrainian} 0
1190 StrCpy $Search "ur_PK"
1192 ${if} $Pointer != "-1"
1193 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1194 SectionSetFlags ${SecDUrdu} $0
1195 SectionSetSize ${SecDUrdu} 0
1197 StrCpy $Search "vi_VN"
1199 ${if} $Pointer != "-1"
1200 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1201 SectionSetFlags ${SecDVietnamese} $0
1202 SectionSetSize ${SecDVietnamese} 0
1205 # select sections of already installed thesaurus dictionaries, make them read-only
1206 # and set the necessary size to 0 bytes
1207 StrCpy $String $FoundThes
1208 StrCpy $Search "bg_BG"
1209 Call StrPoint # function from LyXUtils.nsh
1210 ${if} $Pointer != "-1"
1211 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1212 SectionSetFlags ${SecTBulgarian} $0
1213 SectionSetSize ${SecTBulgarian} 0
1215 StrCpy $Search "ca_ES"
1217 ${if} $Pointer != "-1"
1218 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1219 SectionSetFlags ${SecTCatalan} $0
1220 SectionSetSize ${SecTCatalan} 0
1222 StrCpy $Search "cs_CZ"
1224 ${if} $Pointer != "-1"
1225 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1226 SectionSetFlags ${SecTCzech} $0
1227 SectionSetSize ${SecTCzech} 0
1229 StrCpy $Search "da_DK"
1231 ${if} $Pointer != "-1"
1232 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1233 SectionSetFlags ${SecTDanish} $0
1234 SectionSetSize ${SecTDanish} 0
1236 StrCpy $Search "de_DE"
1238 ${if} $Pointer != "-1"
1239 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1240 SectionSetFlags ${SecTGermanDA} $0
1241 SectionSetSize ${SecTGermanDA} 0
1243 StrCpy $Search "de_CH"
1245 ${if} $Pointer != "-1"
1246 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1247 SectionSetFlags ${SecTGermanCH} $0
1248 SectionSetSize ${SecTGermanCH} 0
1250 StrCpy $Search "en_GB"
1252 ${if} $Pointer != "-1"
1253 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1254 SectionSetFlags ${SecTEnglishGB} $0
1255 SectionSetSize ${SecTEnglishGB} 0
1257 StrCpy $Search "en_US"
1259 ${if} $Pointer != "-1"
1260 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1261 SectionSetFlags ${SecTEnglishUSAU} $0
1262 SectionSetSize ${SecTEnglishUSAU} 0
1264 StrCpy $Search "es_ES"
1266 ${if} $Pointer != "-1"
1267 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1268 SectionSetFlags ${SecTSpanish} $0
1269 SectionSetSize ${SecTSpanish} 0
1271 StrCpy $Search "fr_FR"
1273 ${if} $Pointer != "-1"
1274 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1275 SectionSetFlags ${SecTFrench} $0
1276 SectionSetSize ${SecTFrench} 0
1278 StrCpy $Search "ga_IR"
1280 ${if} $Pointer != "-1"
1281 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1282 SectionSetFlags ${SecTGaelic} $0
1283 SectionSetSize ${SecTGaelic} 0
1285 StrCpy $Search "gl_ES"
1287 ${if} $Pointer != "-1"
1288 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1289 SectionSetFlags ${SecTGalician} $0
1290 SectionSetSize ${SecTGalician} 0
1292 StrCpy $Search "el_GR"
1294 ${if} $Pointer != "-1"
1295 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1296 SectionSetFlags ${SecTGreek} $0
1297 SectionSetSize ${SecTGreek} 0
1299 StrCpy $Search "is_IS"
1301 ${if} $Pointer != "-1"
1302 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1303 SectionSetFlags ${SecTIcelandic} $0
1304 SectionSetSize ${SecTIcelandic} 0
1306 StrCpy $Search "it_IT"
1308 ${if} $Pointer != "-1"
1309 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1310 SectionSetFlags ${SecTItalian} $0
1311 SectionSetSize ${SecTItalian} 0
1313 StrCpy $Search "hu_HU"
1315 ${if} $Pointer != "-1"
1316 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1317 SectionSetFlags ${SecTHungarian} $0
1318 SectionSetSize ${SecTHungarian} 0
1320 StrCpy $Search "nb_NO"
1322 ${if} $Pointer != "-1"
1323 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1324 SectionSetFlags ${SecTNorwegianNB} $0
1325 SectionSetSize ${SecTNorwegianNB} 0
1327 StrCpy $Search "pl_PL"
1329 ${if} $Pointer != "-1"
1330 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1331 SectionSetFlags ${SecTPolish} $0
1332 SectionSetSize ${SecTPolish} 0
1334 StrCpy $Search "pt_PT"
1336 ${if} $Pointer != "-1"
1337 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1338 SectionSetFlags ${SecTPortuguese} $0
1339 SectionSetSize ${SecTPortuguese} 0
1341 StrCpy $Search "ro_RO"
1343 ${if} $Pointer != "-1"
1344 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1345 SectionSetFlags ${SecTRomanian} $0
1346 SectionSetSize ${SecTRomanian} 0
1348 StrCpy $Search "ru_RU"
1350 ${if} $Pointer != "-1"
1351 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1352 SectionSetFlags ${SecTRussian} $0
1353 SectionSetSize ${SecTRussian} 0
1355 StrCpy $Search "sl_SI"
1357 ${if} $Pointer != "-1"
1358 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1359 SectionSetFlags ${SecTSlovenian} $0
1360 SectionSetSize ${SecTSlovenian} 0
1362 StrCpy $Search "sk_SK"
1364 ${if} $Pointer != "-1"
1365 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1366 SectionSetFlags ${SecTSlovakian} $0
1367 SectionSetSize ${SecTSlovakian} 0
1369 StrCpy $Search "sv_SE"
1371 ${if} $Pointer != "-1"
1372 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1373 SectionSetFlags ${SecTSwedish} $0
1374 SectionSetSize ${SecTSwedish} 0
1376 StrCpy $Search "uk_UA"
1378 ${if} $Pointer != "-1"
1379 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1380 SectionSetFlags ${SecTUkrainian} $0
1381 SectionSetSize ${SecTUkrainian} 0
1390 # this function is called at first after starting the uninstaller
1393 !insertmacro PRINTER_INIT
1394 !insertmacro MULTIUSER_UNINIT
1396 # Check that LyX is not currently running
1397 FindProcDLL::FindProc "lyx.exe"
1399 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)" /SD IDOK
1403 # set registry root key
1404 ${if} $MultiUser.Privileges == "Admin"
1405 ${orif} $MultiUser.Privileges == "Power"
1406 SetShellVarContext all
1408 SetShellVarContext current
1411 # Ascertain whether the user has sufficient privileges to uninstall.
1412 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1413 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1415 ${andif} $MultiUser.Privileges != "Admin"
1416 ${andif} $MultiUser.Privileges != "Power"
1417 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)" /SD IDOK
1420 # warning when LyX couldn't be found in the registry
1421 ${if} $0 == "" # check in HKCU
1422 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1424 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)" /SD IDOK
1428 # Macro to investigate name of LyX's preferences folders to be able remove them
1429 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1431 # test if MiKTeX was installed together with LyX
1432 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1433 ${if} $0 == "Yes${APP_SERIES_KEY}"
1434 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1435 StrCpy $LaTeXInstalled "MiKTeX"
1437 SectionSetText 2 "" # hides the corresponding uninstaller section
1440 # test if JabRef was installed together with LyX
1441 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1442 ${if} $0 == "Yes${APP_SERIES_KEY}"
1443 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1444 StrCpy $JabRefInstalled "Yes"
1446 SectionSetText 3 "" # hides the corresponding uninstaller section
1449 # question message if the user really wants to uninstall LyX
1450 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" /SD IDYES IDYES +2 # continue if yes