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
53 StrCpy $CreateFileAssociations "true"
56 Section "$(SecDesktopTitle)" SecDesktop
58 StrCpy $CreateDesktopIcon "false"
61 !if ${SETUPTYPE} == BUNDLE
62 Section /o "$(SecInstJabRefTitle)" SecInstJabRef
63 AddSize ${SIZE_JABREF}
64 StrCpy $InstallJabRef "true"
68 # Expand the list of dictionaries by default as this was requested by several
69 # users. For the thesaurus this is was not requested because this section
70 # is by default empty.
71 SectionGroup /e "Dictionaries" SecDictionaries
73 Section /o "Afrikaans" SecDAfrikaans
74 StrCpy $DictCodes "af_ZA,$DictCodes"
78 Section /o "Arabic" SecDArabic
79 StrCpy $DictCodes "ar_DZ,$DictCodes"
83 Section /o "Armenian" SecDArmenian
84 StrCpy $DictCodes "hy_AM,$DictCodes"
88 Section /o "Bahasa Indonesia" SecDIndonesian
89 StrCpy $DictCodes "id_ID,$DictCodes"
93 Section /o "Bahasa Melayu" SecDMalayan
94 StrCpy $DictCodes "ms_MY,$DictCodes"
98 Section /o "Belarusian" SecDBelarusian
99 StrCpy $DictCodes "be_BY,$DictCodes"
103 Section /o "Brezhoneg" SecDBreton
104 StrCpy $DictCodes "br_FR,$DictCodes"
108 Section /o "Bulgarian" SecDBulgarian
109 StrCpy $DictCodes "bg_BG,$DictCodes"
113 Section /o "Català" SecDCatalanian
114 StrCpy $DictCodes "ca_ES,$DictCodes"
118 Section /o "Ce
\9atina" SecDCzech
119 StrCpy $DictCodes "cs_CZ,$DictCodes"
123 Section /o "Coptic" SecDCoptic
124 StrCpy $DictCodes "cop_EG,$DictCodes"
128 Section /o "Cymraeg" SecDWelsh
129 StrCpy $DictCodes "cy_GB,$DictCodes"
133 Section /o "Dansk" SecDDanish
134 StrCpy $DictCodes "da_DK,$DictCodes"
138 Section /o "German (A)" SecDGermanAT
139 StrCpy $DictCodes "de_AT,$DictCodes"
143 Section /o "German (CH)" SecDGermanCH
144 StrCpy $DictCodes "de_CH,$DictCodes"
148 Section "German (D)" SecDGermanD
149 # already installed by default
151 #StrCpy $DictCodes "de_DE,$DictCodes"
155 Section /o "Greek" SecDGreek
156 StrCpy $DictCodes "el_GR,$DictCodes"
160 Section /o "Eesti" SecDEstonian
161 StrCpy $DictCodes "et_EE,$DictCodes"
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 Section /o "English (NZ)" SecDEnglishNZ
183 StrCpy $DictCodes "en_NZ,$DictCodes"
187 Section "English (US)" SecDEnglishUS
188 # already installed by default
190 #StrCpy $DictCodes "en_US,$DictCodes"
194 Section "Español (ES)" SecDSpanishES
195 # already installed by default
197 #StrCpy $DictCodes "es_ES,$DictCodes"
201 Section "Español (MX)" SecDSpanishMX
202 # already installed by default
204 #StrCpy $DictCodes "es_MX,$DictCodes"
208 Section /o "Esperanto" SecDEsperanto
209 StrCpy $DictCodes "eo_EO,$DictCodes"
213 Section /o "Euskara" SecDBasque
214 StrCpy $DictCodes "eu_ES,$DictCodes"
218 Section /o "Farsi" SecDFarsi
219 StrCpy $DictCodes "fa_IR,$DictCodes"
223 Section "Français" SecDFrench
224 # already installed by default
226 #StrCpy $DictCodes "fr_FR,$DictCodes"
230 Section /o "Français (Canada)" SecDFrenchCanada
231 StrCpy $DictCodes "fr_CA,$DictCodes"
235 Section /o "Gaeilge" SecDGaelic
236 StrCpy $DictCodes "ga_IR,$DictCodes"
240 Section /o "Gàidhlig" SecDScottish
241 StrCpy $DictCodes "gd_GB,$DictCodes"
245 Section /o "Galego" SecDGalician
246 StrCpy $DictCodes "gl_ES,$DictCodes"
250 Section /o "Hebrew" SecDHebrew
251 StrCpy $DictCodes "he_IL,$DictCodes"
255 Section /o "Hrvatski" SecDCroatian
256 StrCpy $DictCodes "hr_HR,$DictCodes"
260 Section /o "Magyar" SecDHungarian
261 StrCpy $DictCodes "hu_HU,$DictCodes"
265 Section /o "Hindi" SecDHindi
266 StrCpy $DictCodes "hi_IN,$DictCodes"
270 Section /o "Interlingua" SecDInterlingua
271 StrCpy $DictCodes "ia_IA,$DictCodes"
275 Section /o "Íslenska" SecDIcelandic
276 StrCpy $DictCodes "is_IS,$DictCodes"
280 Section /o "Italiano" SecDItalian
281 StrCpy $DictCodes "it_IT,$DictCodes"
285 Section /o "Kazakh" SecDKazakh
286 StrCpy $DictCodes "kk_KZ,$DictCodes"
290 Section /o "Korean" SecDKorean
291 StrCpy $DictCodes "ko_KR,$DictCodes"
295 Section /o "Latina" SecDLatin
296 StrCpy $DictCodes "la_LA,$DictCodes"
300 Section /o "Lietuviu" SecDLithuanian
301 StrCpy $DictCodes "lt_LT,$DictCodes"
305 Section /o "Latvie
\9au" SecDLatvian
306 StrCpy $DictCodes "lv_LV,$DictCodes"
310 Section /o "Marathi" SecDMarathi
311 StrCpy $DictCodes "mr_IN,$DictCodes"
315 Section /o "Nederlands" SecDDutch
316 StrCpy $DictCodes "nl_NL,$DictCodes"
320 Section /o "Norsk (Bokmål)" SecDNorwegianNB
321 StrCpy $DictCodes "nb_NO,$DictCodes"
325 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
326 StrCpy $DictCodes "nn_NO,$DictCodes"
330 Section /o "Occitan" SecDOccitan
331 StrCpy $DictCodes "oc_FR,$DictCodes"
335 Section /o "Polski" SecDPolish
336 StrCpy $DictCodes "pl_PL,$DictCodes"
340 Section /o "Português (BR)" SecDPortugueseBR
341 StrCpy $DictCodes "pt_BR,$DictCodes"
345 Section /o "Português (PT)" SecDPortuguesePT
346 StrCpy $DictCodes "pt_PT,$DictCodes"
350 Section /o "Româna" SecDRomanian
351 StrCpy $DictCodes "ro_RO,$DictCodes"
355 Section /o "Russian" SecDRussian
356 StrCpy $DictCodes "ru_RU,$DictCodes"
360 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
361 StrCpy $DictCodes "dsb_DE,$DictCodes"
365 Section /o "Serb
\9acina (Horno)" SecDSorbianH
366 StrCpy $DictCodes "hsb_DE,$DictCodes"
370 Section /o "Shqipe" SecDAlbanian
371 StrCpy $DictCodes "sq_AL,$DictCodes"
375 Section /o "Sloven
\9acina" SecDSlovenian
376 StrCpy $DictCodes "sl_SI,$DictCodes"
380 Section /o "Slovenský" SecDSlovakian
381 StrCpy $DictCodes "sk_SK,$DictCodes"
385 Section /o "Srpski (Cirilica)" SecDSerbianC
386 StrCpy $DictCodes "sr_RS,$DictCodes"
390 Section /o "Srpski (Latinica)" SecDSerbianL
391 StrCpy $DictCodes "sr_RS-Latin,$DictCodes"
395 Section /o "Svenska" SecDSwedish
396 StrCpy $DictCodes "sv_SE,$DictCodes"
400 Section /o "Tamil" SecDTamil
401 StrCpy $DictCodes "ta_IN,$DictCodes"
405 Section /o "Telugu" SecDTelugu
406 StrCpy $DictCodes "te_IN,$DictCodes"
410 Section /o "Thai" SecDThai
411 StrCpy $DictCodes "th_TH,$DictCodes"
415 Section /o "Türkmençe" SecDTurkmen
416 StrCpy $DictCodes "tk_TM,$DictCodes"
420 Section /o "Türkçe" SecDTurkish
421 StrCpy $DictCodes "tr_TR,$DictCodes"
425 Section /o "Ukrainian" SecDUkrainian
426 StrCpy $DictCodes "uk_UA,$DictCodes"
430 Section /o "Urdu" SecDUrdu
431 StrCpy $DictCodes "ur_PK,$DictCodes"
435 Section /o "Vietnamese" SecDVietnamese
436 StrCpy $DictCodes "vi_VN,$DictCodes"
443 SectionGroup "Thesaurus" SecThesaurus
445 Section /o "Bulgarian" SecTBulgarian
446 StrCpy $ThesCodes "bg_BG,$ThesCodes"
450 Section /o "Català" SecTCatalan
451 StrCpy $ThesCodes "ca_ES,$ThesCodes"
455 Section /o "Ce
\9atina" SecTCzech
456 StrCpy $ThesCodes "cs_CZ,$ThesCodes"
460 Section /o "Dansk" SecTDanish
461 StrCpy $ThesCodes "da_DK,$ThesCodes"
465 Section /o "Deutsch (D/A)" SecTGermanDA
466 StrCpy $ThesCodes "de_DE,$ThesCodes"
470 Section /o "Deutsch (CH)" SecTGermanCH
471 StrCpy $ThesCodes "de_CH,$ThesCodes"
475 Section /o "English (GB)" SecTEnglishGB
476 StrCpy $ThesCodes "en_GB,$ThesCodes"
480 Section /o "English (US/AU)" SecTEnglishUSAU
481 StrCpy $ThesCodes "en_US,$ThesCodes"
485 Section /o "Español" SecTSpanish
486 StrCpy $ThesCodes "es_ES,$ThesCodes"
490 Section /o "Français" SecTFrench
491 StrCpy $ThesCodes "fr_FR,$ThesCodes"
495 Section /o "Gaeilge" SecTGaelic
496 StrCpy $ThesCodes "ga_IR,$ThesCodes"
500 Section /o "Galego" SecTGalician
501 StrCpy $ThesCodes "gl_ES,$ThesCodes"
505 Section /o "Greek" SecTGreek
506 StrCpy $ThesCodes "el_GR,$ThesCodes"
510 Section /o "Íslenska" SecTIcelandic
511 StrCpy $ThesCodes "is_IS,$ThesCodes"
515 Section /o "Italiano" SecTItalian
516 StrCpy $ThesCodes "it_IT,$ThesCodes"
520 Section /o "Magyar" SecTHungarian
521 StrCpy $ThesCodes "hu_HU,$ThesCodes"
525 Section /o "Norsk (Bokmål)" SecTNorwegianNB
526 StrCpy $ThesCodes "nb_NO,$ThesCodes"
530 Section /o "Polski" SecTPolish
531 StrCpy $ThesCodes "pl_PL,$ThesCodes"
535 Section /o "Português" SecTPortuguese
536 StrCpy $ThesCodes "pt_PT,$ThesCodes"
540 Section /o "Româna" SecTRomanian
541 StrCpy $ThesCodes "ro_RO,$ThesCodes"
545 Section /o "Russian" SecTRussian
546 StrCpy $ThesCodes "ru_RU,$ThesCodes"
550 Section /o "Sloven
\9acina" SecTSlovenian
551 StrCpy $ThesCodes "sl_SI,$ThesCodes"
555 Section /o "Slovenský" SecTSlovakian
556 StrCpy $ThesCodes "sk_SK,$ThesCodes"
560 Section /o "Svenska" SecTSwedish
561 StrCpy $ThesCodes "sv_SE,$ThesCodes"
565 Section /o "Ukrainian" SecTUkrainian
566 StrCpy $ThesCodes "uk_UA,$ThesCodes"
572 # Section descriptions
573 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
574 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
575 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
576 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
577 !if ${SETUPTYPE} == BUNDLE
578 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
580 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
581 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
582 !insertmacro MUI_FUNCTION_DESCRIPTION_END
585 # .onInit must be here after the section definition because we have to set
586 # the selection states of the dictionary sections
589 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
590 ${if} $R0 == "5.0" # 2000
591 ${orif} $R0 == "5.1" # XP
592 ${orif} $R0 == "5.2" # 2003
593 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows Vista or newer." /SD IDOK
597 # check that the installer is not currently running
598 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
601 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK
604 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
607 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK
611 # FIXME: check that LyX is not currently running
612 #System::Call 'kernel32::CreateMutexA(i 0, i 0, t "LyX.exe.Instance") i .r1 ?e'
614 #MessageBox MB_OK "$R0"
616 # MessageBox MB_OK|MB_ICONSTOP "$(LyXRunning)"
620 # read the user and computer name
621 ReadRegStr $ComputerName HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName"
622 System::Call "advapi32::GetUserName(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2"
625 !insertmacro MULTIUSER_INIT
627 # check if this LyX version is already installed
628 ${if} $MultiUser.Privileges == "Admin"
629 ${orif} $MultiUser.Privileges == "Power"
630 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayIcon"
632 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayIcon"
633 # handle also the case that LyX is already installed in HKLM
635 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayIcon"
639 # check if the uninstaller was acidentally deleted
640 # if so don't bother the user if he realy wants to install a new LyX over an existing one
641 # because he won't have a chance to deny this
642 StrCpy $4 $0 -10 # remove '\bin\lyx,0'
643 # (for FileCheck the variables $0 and $1 cannot be used)
644 !insertmacro FileCheck $5 "Uninstall-LyX.exe" "$4" # macro from LyXUtils.nsh
646 Goto ForceInstallation
648 # installing over an existing installation of the same LyX release is not necessary
649 # if the users does this he most probably has a problem with LyX that can better be solved
650 # by reinstalling LyX
651 # for beta and other test releases over-installing can even cause errors
652 MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONEXCLAMATION "$(AlreadyInstalled)" /SD IDNO IDYES ForceInstallation
657 # check if there is an existing LyX installation of the same LyX series
658 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
659 IntOp $4 ${APP_VERSION_REVISION} + 20
661 ${if} $MultiUser.Privileges == "Admin"
662 ${orif} $MultiUser.Privileges == "Power"
663 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
664 # also check for an emergency release
666 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
669 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
670 # also check for an emergency release
672 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
676 StrCpy $R5 $0 # store the read version number
677 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
678 # we don't stop here because we want the latest installed version
682 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
683 # store the version number and reformat it temporarily for the error message
684 StrCpy $R0 $OldVersionNumber
685 StrCpy $OldVersionNumber $R5
686 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)" /SD IDOK
687 StrCpy $OldVersionNumber $R0
691 # this can be reset to "true" in section SecDesktop
692 StrCpy $CreateDesktopIcon "false"
693 StrCpy $CreateFileAssociations "false"
696 # Show banner while installer is intializating
697 Banner::show /NOUNLOAD "Checking system"
702 !if ${SETUPTYPE} == BUNDLE
703 # don't let the installer sections appear when the programs are already installed
704 ${if} $PathBibTeXEditor != ""
705 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
709 # select sections of already installed spell-checker dictionaries, make them read-only
710 # and set the necessary size to 0 bytes
711 StrCpy $String $FoundDict
712 StrCpy $Search "af_ZA"
713 Call StrPoint # function from LyXUtils.nsh
714 ${if} $Pointer != "-1"
715 IntOp $0 ${SF_SELECTED} | ${SF_RO}
716 SectionSetFlags ${SecDAfrikaans} $0
717 SectionSetSize ${SecDAfrikaans} 0
719 StrCpy $Search "ar_DZ"
721 ${if} $Pointer != "-1"
722 IntOp $0 ${SF_SELECTED} | ${SF_RO}
723 SectionSetFlags ${SecDArabic} $0
724 SectionSetSize ${SecDArabic} 0
726 StrCpy $Search "hy_AM"
728 ${if} $Pointer != "-1"
729 IntOp $0 ${SF_SELECTED} | ${SF_RO}
730 SectionSetFlags ${SecDArmenian} $0
731 SectionSetSize ${SecDArmenian} 0
733 StrCpy $Search "id_ID"
735 ${if} $Pointer != "-1"
736 IntOp $0 ${SF_SELECTED} | ${SF_RO}
737 SectionSetFlags ${SecDIndonesian} $0
738 SectionSetSize ${SecDIndonesian} 0
740 StrCpy $Search "ms_MY"
742 ${if} $Pointer != "-1"
743 IntOp $0 ${SF_SELECTED} | ${SF_RO}
744 SectionSetFlags ${SecDMalayan} $0
745 SectionSetSize ${SecDMalayan} 0
747 StrCpy $Search "be_BY"
749 ${if} $Pointer != "-1"
750 IntOp $0 ${SF_SELECTED} | ${SF_RO}
751 SectionSetFlags ${SecDBelarusian} $0
752 SectionSetSize ${SecDBelarusian} 0
754 StrCpy $Search "br_FR"
756 ${if} $Pointer != "-1"
757 IntOp $0 ${SF_SELECTED} | ${SF_RO}
758 SectionSetFlags ${SecDBreton} $0
759 SectionSetSize ${SecDBreton} 0
761 StrCpy $Search "bg_BG"
763 ${if} $Pointer != "-1"
764 IntOp $0 ${SF_SELECTED} | ${SF_RO}
765 SectionSetFlags ${SecDBulgarian} $0
766 SectionSetSize ${SecDBulgarian} 0
768 StrCpy $Search "ca_ES"
770 ${if} $Pointer != "-1"
771 IntOp $0 ${SF_SELECTED} | ${SF_RO}
772 SectionSetFlags ${SecDCatalanian} $0
773 SectionSetSize ${SecDCatalanian} 0
775 StrCpy $Search "cs_CZ"
777 ${if} $Pointer != "-1"
778 IntOp $0 ${SF_SELECTED} | ${SF_RO}
779 SectionSetFlags ${SecDCzech} $0
780 SectionSetSize ${SecDCzech} 0
783 StrCpy $Search "cop_EG"
785 ${if} $Pointer != "-1"
786 IntOp $0 ${SF_SELECTED} | ${SF_RO}
787 SectionSetFlags ${SecDCoptic} $0
788 SectionSetSize ${SecDCoptic} 0
790 StrCpy $Search "cy_GB"
792 ${if} $Pointer != "-1"
793 IntOp $0 ${SF_SELECTED} | ${SF_RO}
794 SectionSetFlags ${SecDWelsh} $0
795 SectionSetSize ${SecDWelsh} 0
797 StrCpy $Search "da_DK"
799 ${if} $Pointer != "-1"
800 IntOp $0 ${SF_SELECTED} | ${SF_RO}
801 SectionSetFlags ${SecDDanish} $0
802 SectionSetSize ${SecDDanish} 0
804 StrCpy $Search "de_AT"
806 ${if} $Pointer != "-1"
807 IntOp $0 ${SF_SELECTED} | ${SF_RO}
808 SectionSetFlags ${SecDGermanAT} $0
809 SectionSetSize ${SecDGermanAT} 0
811 StrCpy $Search "de_CH"
813 ${if} $Pointer != "-1"
814 IntOp $0 ${SF_SELECTED} | ${SF_RO}
815 SectionSetFlags ${SecDGermanCH} $0
816 SectionSetSize ${SecDGermanCH} 0
818 StrCpy $Search "de_DE"
820 ${if} $Pointer != "-1"
821 IntOp $0 ${SF_SELECTED} | ${SF_RO}
822 SectionSetFlags ${SecDGermanD} $0
823 SectionSetSize ${SecDGermanD} 0
825 StrCpy $Search "el_GR"
827 ${if} $Pointer != "-1"
828 IntOp $0 ${SF_SELECTED} | ${SF_RO}
829 SectionSetFlags ${SecDGreek} $0
830 SectionSetSize ${SecDGreek} 0
832 StrCpy $Search "et_EE"
834 ${if} $Pointer != "-1"
835 IntOp $0 ${SF_SELECTED} | ${SF_RO}
836 SectionSetFlags ${SecDEstonian} $0
837 SectionSetSize ${SecDEstonian} 0
839 StrCpy $Search "en_AU"
841 ${if} $Pointer != "-1"
842 IntOp $0 ${SF_SELECTED} | ${SF_RO}
843 SectionSetFlags ${SecDEnglishAU} $0
844 SectionSetSize ${SecDEnglishAU} 0
846 StrCpy $Search "en_CA"
848 ${if} $Pointer != "-1"
849 IntOp $0 ${SF_SELECTED} | ${SF_RO}
850 SectionSetFlags ${SecDEnglishCA} $0
851 SectionSetSize ${SecDEnglishCA} 0
853 StrCpy $Search "en_GB"
855 ${if} $Pointer != "-1"
856 IntOp $0 ${SF_SELECTED} | ${SF_RO}
857 SectionSetFlags ${SecDEnglishGB} $0
858 SectionSetSize ${SecDEnglishGB} 0
860 StrCpy $Search "en_NZ"
862 ${if} $Pointer != "-1"
863 IntOp $0 ${SF_SELECTED} | ${SF_RO}
864 SectionSetFlags ${SecDEnglishNZ} $0
865 SectionSetSize ${SecDEnglishNZ} 0
867 StrCpy $Search "en_US"
869 ${if} $Pointer != "-1"
870 IntOp $0 ${SF_SELECTED} | ${SF_RO}
871 SectionSetFlags ${SecDEnglishUS} $0
872 SectionSetSize ${SecDEnglishUS} 0
874 StrCpy $Search "es_ES"
876 ${if} $Pointer != "-1"
877 IntOp $0 ${SF_SELECTED} | ${SF_RO}
878 SectionSetFlags ${SecDSpanishES} $0
879 SectionSetSize ${SecDSpanishES} 0
881 StrCpy $Search "es_MX"
883 ${if} $Pointer != "-1"
884 IntOp $0 ${SF_SELECTED} | ${SF_RO}
885 SectionSetFlags ${SecDSpanishMX} $0
886 SectionSetSize ${SecDSpanishMX} 0
888 StrCpy $Search "eo_EO"
890 ${if} $Pointer != "-1"
891 IntOp $0 ${SF_SELECTED} | ${SF_RO}
892 SectionSetFlags ${SecDEsperanto} $0
893 SectionSetSize ${SecDEsperanto} 0
895 StrCpy $Search "eu_ES"
897 ${if} $Pointer != "-1"
898 IntOp $0 ${SF_SELECTED} | ${SF_RO}
899 SectionSetFlags ${SecDBasque} $0
900 SectionSetSize ${SecDBasque} 0
902 StrCpy $Search "fa_IR"
904 ${if} $Pointer != "-1"
905 IntOp $0 ${SF_SELECTED} | ${SF_RO}
906 SectionSetFlags ${SecDFarsi} $0
907 SectionSetSize ${SecDFarsi} 0
909 StrCpy $Search "fr_CA"
911 ${if} $Pointer != "-1"
912 IntOp $0 ${SF_SELECTED} | ${SF_RO}
913 SectionSetFlags ${SecDFrenchCanada} $0
914 SectionSetSize ${SecDFrenchCanada} 0
916 StrCpy $Search "fr_FR"
918 ${if} $Pointer != "-1"
919 IntOp $0 ${SF_SELECTED} | ${SF_RO}
920 SectionSetFlags ${SecDFrench} $0
921 SectionSetSize ${SecDFrench} 0
923 StrCpy $Search "ga_IR"
925 ${if} $Pointer != "-1"
926 IntOp $0 ${SF_SELECTED} | ${SF_RO}
927 SectionSetFlags ${SecDGaelic} $0
928 SectionSetSize ${SecDGaelic} 0
930 StrCpy $Search "gd_GB"
932 ${if} $Pointer != "-1"
933 IntOp $0 ${SF_SELECTED} | ${SF_RO}
934 SectionSetFlags ${SecDScottish} $0
935 SectionSetSize ${SecDScottish} 0
937 StrCpy $Search "gl_ES"
939 ${if} $Pointer != "-1"
940 IntOp $0 ${SF_SELECTED} | ${SF_RO}
941 SectionSetFlags ${SecDGalician} $0
942 SectionSetSize ${SecDGalician} 0
944 StrCpy $Search "he_IL"
946 ${if} $Pointer != "-1"
947 IntOp $0 ${SF_SELECTED} | ${SF_RO}
948 SectionSetFlags ${SecDHebrew} $0
949 SectionSetSize ${SecDHebrew} 0
951 StrCpy $Search "hi_IN"
953 ${if} $Pointer != "-1"
954 IntOp $0 ${SF_SELECTED} | ${SF_RO}
955 SectionSetFlags ${SecDHindi} $0
956 SectionSetSize ${SecDHindi} 0
958 StrCpy $Search "hr_HR"
960 ${if} $Pointer != "-1"
961 IntOp $0 ${SF_SELECTED} | ${SF_RO}
962 SectionSetFlags ${SecDCroatian} $0
963 SectionSetSize ${SecDCroatian} 0
965 StrCpy $Search "hu_HU"
967 ${if} $Pointer != "-1"
968 IntOp $0 ${SF_SELECTED} | ${SF_RO}
969 SectionSetFlags ${SecDHungarian} $0
970 SectionSetSize ${SecDHungarian} 0
972 StrCpy $Search "ia_IA"
974 ${if} $Pointer != "-1"
975 IntOp $0 ${SF_SELECTED} | ${SF_RO}
976 SectionSetFlags ${SecDInterlingua} $0
977 SectionSetSize ${SecDInterlingua} 0
979 StrCpy $Search "is_IS"
981 ${if} $Pointer != "-1"
982 IntOp $0 ${SF_SELECTED} | ${SF_RO}
983 SectionSetFlags ${SecDIcelandic} $0
984 SectionSetSize ${SecDIcelandic} 0
986 StrCpy $Search "it_IT"
988 ${if} $Pointer != "-1"
989 IntOp $0 ${SF_SELECTED} | ${SF_RO}
990 SectionSetFlags ${SecDItalian} $0
991 SectionSetSize ${SecDItalian} 0
993 StrCpy $Search "kk_KZ"
995 ${if} $Pointer != "-1"
996 IntOp $0 ${SF_SELECTED} | ${SF_RO}
997 SectionSetFlags ${SecDKazakh} $0
998 SectionSetSize ${SecDKazakh} 0
1000 StrCpy $Search "ko_KR"
1002 ${if} $Pointer != "-1"
1003 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1004 SectionSetFlags ${SecDKorean} $0
1005 SectionSetSize ${SecDKorean} 0
1007 StrCpy $Search "la_LA"
1009 ${if} $Pointer != "-1"
1010 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1011 SectionSetFlags ${SecDLatin} $0
1012 SectionSetSize ${SecDLatin} 0
1014 StrCpy $Search "lt_LT"
1016 ${if} $Pointer != "-1"
1017 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1018 SectionSetFlags ${SecDLithuanian} $0
1019 SectionSetSize ${SecDLithuanian} 0
1021 StrCpy $Search "lv_LV"
1023 ${if} $Pointer != "-1"
1024 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1025 SectionSetFlags ${SecDLatvian} $0
1026 SectionSetSize ${SecDLatvian} 0
1028 StrCpy $Search "mr_IN"
1030 ${if} $Pointer != "-1"
1031 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1032 SectionSetFlags ${SecDMarathi} $0
1033 SectionSetSize ${SecDMarathi} 0
1035 StrCpy $Search "nl_NL"
1037 ${if} $Pointer != "-1"
1038 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1039 SectionSetFlags ${SecDDutch} $0
1040 SectionSetSize ${SecDDutch} 0
1042 StrCpy $Search "nb_NO"
1044 ${if} $Pointer != "-1"
1045 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1046 SectionSetFlags ${SecDNorwegianNB} $0
1047 SectionSetSize ${SecDNorwegianNB} 0
1049 StrCpy $Search "nn_NO"
1051 ${if} $Pointer != "-1"
1052 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1053 SectionSetFlags ${SecDNorwegianNN} $0
1054 SectionSetSize ${SecDNorwegianNN} 0
1056 StrCpy $Search "oc_FR"
1058 ${if} $Pointer != "-1"
1059 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1060 SectionSetFlags ${SecDOccitan} $0
1061 SectionSetSize ${SecDOccitan} 0
1063 StrCpy $Search "pl_PL"
1065 ${if} $Pointer != "-1"
1066 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1067 SectionSetFlags ${SecDPolish} $0
1068 SectionSetSize ${SecDPolish} 0
1070 StrCpy $Search "pt_BR"
1072 ${if} $Pointer != "-1"
1073 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1074 SectionSetFlags ${SecDPortugueseBR} $0
1075 SectionSetSize ${SecDPortugueseBR} 0
1077 StrCpy $Search "pt_PT"
1079 ${if} $Pointer != "-1"
1080 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1081 SectionSetFlags ${SecDPortuguesePT} $0
1082 SectionSetSize ${SecDPortuguesePT} 0
1084 StrCpy $Search "ro_RO"
1086 ${if} $Pointer != "-1"
1087 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1088 SectionSetFlags ${SecDRomanian} $0
1089 SectionSetSize ${SecDRomanian} 0
1091 StrCpy $Search "ru_RU"
1093 ${if} $Pointer != "-1"
1094 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1095 SectionSetFlags ${SecDRussian} $0
1096 SectionSetSize ${SecDRussian} 0
1098 StrCpy $Search "dsb_DE"
1100 ${if} $Pointer != "-1"
1101 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1102 SectionSetFlags ${SecDSorbianD} $0
1103 SectionSetSize ${SecDSorbianD} 0
1105 StrCpy $Search "hsb_DE"
1107 ${if} $Pointer != "-1"
1108 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1109 SectionSetFlags ${SecDSorbianH} $0
1110 SectionSetSize ${SecDSorbianH} 0
1112 StrCpy $Search "sq_AL"
1114 ${if} $Pointer != "-1"
1115 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1116 SectionSetFlags ${SecDAlbanian} $0
1117 SectionSetSize ${SecDAlbanian} 0
1119 StrCpy $Search "sl_SI"
1121 ${if} $Pointer != "-1"
1122 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1123 SectionSetFlags ${SecDSlovenian} $0
1124 SectionSetSize ${SecDSlovenian} 0
1126 StrCpy $Search "sk_SK"
1128 ${if} $Pointer != "-1"
1129 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1130 SectionSetFlags ${SecDSlovakian} $0
1131 SectionSetSize ${SecDSlovakian} 0
1133 StrCpy $Search "sr_RS"
1135 ${if} $Pointer != "-1"
1136 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1137 SectionSetFlags ${SecDSerbianC} $0
1138 SectionSetSize ${SecDSerbianC} 0
1140 StrCpy $Search "sr_RS-Latin"
1142 ${if} $Pointer != "-1"
1143 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1144 SectionSetFlags ${SecDSerbianL} $0
1145 SectionSetSize ${SecDSerbianL} 0
1147 StrCpy $Search "sv_SE"
1149 ${if} $Pointer != "-1"
1150 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1151 SectionSetFlags ${SecDSwedish} $0
1152 SectionSetSize ${SecDSwedish} 0
1154 StrCpy $Search "ta_IN"
1156 ${if} $Pointer != "-1"
1157 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1158 SectionSetFlags ${SecDTamil} $0
1159 SectionSetSize ${SecDTamil} 0
1161 StrCpy $Search "te_IN"
1163 ${if} $Pointer != "-1"
1164 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1165 SectionSetFlags ${SecDTelugu} $0
1166 SectionSetSize ${SecDTelugu} 0
1168 StrCpy $Search "th_TH"
1170 ${if} $Pointer != "-1"
1171 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1172 SectionSetFlags ${SecDThai} $0
1173 SectionSetSize ${SecDThai} 0
1175 StrCpy $Search "tk_TM"
1177 ${if} $Pointer != "-1"
1178 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1179 SectionSetFlags ${SecDTurkmen} $0
1180 SectionSetSize ${SecDTurkmen} 0
1182 StrCpy $Search "tr_TR"
1184 ${if} $Pointer != "-1"
1185 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1186 SectionSetFlags ${SecDTurkish} $0
1187 SectionSetSize ${SecDTurkish} 0
1189 StrCpy $Search "uk_UA"
1191 ${if} $Pointer != "-1"
1192 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1193 SectionSetFlags ${SecDUkrainian} $0
1194 SectionSetSize ${SecDUkrainian} 0
1196 StrCpy $Search "ur_PK"
1198 ${if} $Pointer != "-1"
1199 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1200 SectionSetFlags ${SecDUrdu} $0
1201 SectionSetSize ${SecDUrdu} 0
1203 StrCpy $Search "vi_VN"
1205 ${if} $Pointer != "-1"
1206 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1207 SectionSetFlags ${SecDVietnamese} $0
1208 SectionSetSize ${SecDVietnamese} 0
1211 # select sections of already installed thesaurus dictionaries, make them read-only
1212 # and set the necessary size to 0 bytes
1213 StrCpy $String $FoundThes
1214 StrCpy $Search "bg_BG"
1215 Call StrPoint # function from LyXUtils.nsh
1216 ${if} $Pointer != "-1"
1217 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1218 SectionSetFlags ${SecTBulgarian} $0
1219 SectionSetSize ${SecTBulgarian} 0
1221 StrCpy $Search "ca_ES"
1223 ${if} $Pointer != "-1"
1224 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1225 SectionSetFlags ${SecTCatalan} $0
1226 SectionSetSize ${SecTCatalan} 0
1228 StrCpy $Search "cs_CZ"
1230 ${if} $Pointer != "-1"
1231 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1232 SectionSetFlags ${SecTCzech} $0
1233 SectionSetSize ${SecTCzech} 0
1235 StrCpy $Search "da_DK"
1237 ${if} $Pointer != "-1"
1238 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1239 SectionSetFlags ${SecTDanish} $0
1240 SectionSetSize ${SecTDanish} 0
1242 StrCpy $Search "de_DE"
1244 ${if} $Pointer != "-1"
1245 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1246 SectionSetFlags ${SecTGermanDA} $0
1247 SectionSetSize ${SecTGermanDA} 0
1249 StrCpy $Search "de_CH"
1251 ${if} $Pointer != "-1"
1252 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1253 SectionSetFlags ${SecTGermanCH} $0
1254 SectionSetSize ${SecTGermanCH} 0
1256 StrCpy $Search "en_GB"
1258 ${if} $Pointer != "-1"
1259 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1260 SectionSetFlags ${SecTEnglishGB} $0
1261 SectionSetSize ${SecTEnglishGB} 0
1263 StrCpy $Search "en_US"
1265 ${if} $Pointer != "-1"
1266 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1267 SectionSetFlags ${SecTEnglishUSAU} $0
1268 SectionSetSize ${SecTEnglishUSAU} 0
1270 StrCpy $Search "es_ES"
1272 ${if} $Pointer != "-1"
1273 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1274 SectionSetFlags ${SecTSpanish} $0
1275 SectionSetSize ${SecTSpanish} 0
1277 StrCpy $Search "fr_FR"
1279 ${if} $Pointer != "-1"
1280 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1281 SectionSetFlags ${SecTFrench} $0
1282 SectionSetSize ${SecTFrench} 0
1284 StrCpy $Search "ga_IR"
1286 ${if} $Pointer != "-1"
1287 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1288 SectionSetFlags ${SecTGaelic} $0
1289 SectionSetSize ${SecTGaelic} 0
1291 StrCpy $Search "gl_ES"
1293 ${if} $Pointer != "-1"
1294 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1295 SectionSetFlags ${SecTGalician} $0
1296 SectionSetSize ${SecTGalician} 0
1298 StrCpy $Search "el_GR"
1300 ${if} $Pointer != "-1"
1301 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1302 SectionSetFlags ${SecTGreek} $0
1303 SectionSetSize ${SecTGreek} 0
1305 StrCpy $Search "is_IS"
1307 ${if} $Pointer != "-1"
1308 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1309 SectionSetFlags ${SecTIcelandic} $0
1310 SectionSetSize ${SecTIcelandic} 0
1312 StrCpy $Search "it_IT"
1314 ${if} $Pointer != "-1"
1315 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1316 SectionSetFlags ${SecTItalian} $0
1317 SectionSetSize ${SecTItalian} 0
1319 StrCpy $Search "hu_HU"
1321 ${if} $Pointer != "-1"
1322 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1323 SectionSetFlags ${SecTHungarian} $0
1324 SectionSetSize ${SecTHungarian} 0
1326 StrCpy $Search "nb_NO"
1328 ${if} $Pointer != "-1"
1329 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1330 SectionSetFlags ${SecTNorwegianNB} $0
1331 SectionSetSize ${SecTNorwegianNB} 0
1333 StrCpy $Search "pl_PL"
1335 ${if} $Pointer != "-1"
1336 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1337 SectionSetFlags ${SecTPolish} $0
1338 SectionSetSize ${SecTPolish} 0
1340 StrCpy $Search "pt_PT"
1342 ${if} $Pointer != "-1"
1343 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1344 SectionSetFlags ${SecTPortuguese} $0
1345 SectionSetSize ${SecTPortuguese} 0
1347 StrCpy $Search "ro_RO"
1349 ${if} $Pointer != "-1"
1350 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1351 SectionSetFlags ${SecTRomanian} $0
1352 SectionSetSize ${SecTRomanian} 0
1354 StrCpy $Search "ru_RU"
1356 ${if} $Pointer != "-1"
1357 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1358 SectionSetFlags ${SecTRussian} $0
1359 SectionSetSize ${SecTRussian} 0
1361 StrCpy $Search "sl_SI"
1363 ${if} $Pointer != "-1"
1364 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1365 SectionSetFlags ${SecTSlovenian} $0
1366 SectionSetSize ${SecTSlovenian} 0
1368 StrCpy $Search "sk_SK"
1370 ${if} $Pointer != "-1"
1371 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1372 SectionSetFlags ${SecTSlovakian} $0
1373 SectionSetSize ${SecTSlovakian} 0
1375 StrCpy $Search "sv_SE"
1377 ${if} $Pointer != "-1"
1378 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1379 SectionSetFlags ${SecTSwedish} $0
1380 SectionSetSize ${SecTSwedish} 0
1382 StrCpy $Search "uk_UA"
1384 ${if} $Pointer != "-1"
1385 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1386 SectionSetFlags ${SecTUkrainian} $0
1387 SectionSetSize ${SecTUkrainian} 0
1396 # this function is called at first after starting the uninstaller
1399 !insertmacro MULTIUSER_UNINIT
1401 # Check that LyX is not currently running
1402 FindProcDLL::FindProc "lyx.exe"
1404 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)" /SD IDOK
1408 # set registry root key
1409 ${if} $MultiUser.Privileges == "Admin"
1410 ${orif} $MultiUser.Privileges == "Power"
1411 SetShellVarContext all
1413 SetShellVarContext current
1416 # Ascertain whether the user has sufficient privileges to uninstall.
1417 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1418 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1420 ${andif} $MultiUser.Privileges != "Admin"
1421 ${andif} $MultiUser.Privileges != "Power"
1422 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)" /SD IDOK
1425 # warning when LyX couldn't be found in the registry
1426 ${if} $0 == "" # check in HKCU
1427 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1429 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)" /SD IDOK
1433 # Macro to investigate name of LyX's preferences folders to be able remove them
1434 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1436 # test if MiKTeX was installed together with LyX
1437 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1438 ${if} $0 == "Yes${APP_SERIES_KEY}"
1439 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1440 StrCpy $LaTeXInstalled "MiKTeX"
1442 SectionSetText 2 "" # hides the corresponding uninstaller section
1445 # test if JabRef was installed together with LyX
1446 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1447 ${if} $0 == "Yes${APP_SERIES_KEY}"
1448 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1449 StrCpy $JabRefInstalled "Yes"
1451 SectionSetText 3 "" # hides the corresponding uninstaller section
1454 # question message if the user really wants to uninstall LyX
1455 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" /SD IDYES IDYES +2 # continue if yes