5 Initialization function
9 #--------------------------------
15 # COMPONENT can be LaTeX, ImageMagick and Ghostscript
16 !macro EXTERNAL_INIT COMPONENT
18 # APP_REGKEY_SETUP = "Software\${APP_NAME}${APP_SERIES_KEY}\Setup"
19 # where ${APP_NAME}${APP_SERIES_KEY} is something like LyX16
20 ReadRegStr $ComponentPath SHELL_CONTEXT "${APP_REGKEY_SETUP}" "${COMPONENT} Path"
22 # BIN_LATEX etc are defined in settings.nsh
23 ${If} ${FileExists} "$ComponentPath\${BIN_${COMPONENT}}"
24 # set variables like PathLaTeX
25 StrCpy $Path${COMPONENT} $ComponentPath
32 # Get directories of components from registry
34 !insertmacro EXTERNAL_INIT LaTeX
38 ReadRegStr $LyXLangName SHELL_CONTEXT "${APP_REGKEY_SETUP}" "LyX Language"
40 ${If} $LyXLangName != ""
41 StrCpy $LangName $LyXLangName
46 #--------------------------------
47 # visible installer sections
49 Section "!${APP_NAME}" SecCore
52 Section "$(SecFileAssocTitle)" SecFileAssoc
53 StrCpy $CreateFileAssociations "true"
55 Section "$(SecDesktopTitle)" SecDesktop
56 StrCpy $CreateDesktopIcon "true"
59 !if ${SETUPTYPE} == BUNDLE
60 Section /o "$(SecInstJabRefTitle)" SecInstJabRef
62 StrCpy $InstallJabRef "true"
66 SectionGroup "Dictionaries" SecDictionaries
68 Section /o "Afrikaans" SecDAfrikaans
69 StrCpy $DictCodes "af_ZA,$DictCodes"
73 Section /o "Arabic" SecDArabic
74 StrCpy $DictCodes "ar_DZ,$DictCodes"
78 Section /o "Armenian" SecDArmenian
79 StrCpy $DictCodes "hy_AM,$DictCodes"
83 Section /o "Bahasa Indonesia" SecDIndonesian
84 StrCpy $DictCodes "id_ID,$DictCodes"
88 Section /o "Bahasa Melayu" SecDMalayan
89 StrCpy $DictCodes "ms_MY,$DictCodes"
93 Section /o "Belarusian" SecDBelarusian
94 StrCpy $DictCodes "be_BY,$DictCodes"
98 Section /o "Brezhoneg" SecDBreton
99 StrCpy $DictCodes "br_FR,$DictCodes"
103 Section /o "Bulgarian" SecDBulgarian
104 StrCpy $DictCodes "bg_BG,$DictCodes"
108 Section /o "Català" SecDCatalanian
109 StrCpy $DictCodes "ca_ES,$DictCodes"
113 Section /o "Ce
\9atina" SecDCzech
114 StrCpy $DictCodes "cs_CZ,$DictCodes"
118 # enable this for LyX 2.1!
119 #Section /o "Coptic" SecDCoptic
120 # StrCpy $DictCodes "cop_EG,$DictCodes"
124 Section /o "Cymraeg" SecDWelsh
125 StrCpy $DictCodes "cy_GB,$DictCodes"
129 Section /o "Dansk" SecDDanish
130 StrCpy $DictCodes "da_DK,$DictCodes"
134 Section /o "German (A)" SecDGermanAT
135 StrCpy $DictCodes "de_AT,$DictCodes"
139 Section /o "German (CH)" SecDGermanCH
140 StrCpy $DictCodes "de_CH,$DictCodes"
144 Section "German (D)" SecDGermanD
145 # already installed by default
147 #StrCpy $DictCodes "de_DE,$DictCodes"
151 Section /o "Greek" SecDGreek
152 StrCpy $DictCodes "el_GR,$DictCodes"
156 Section /o "Eesti" SecDEstonian
157 StrCpy $DictCodes "et_EE,$DictCodes"
161 # enable this for LyX 2.1!
162 #Section /o "English (AU)" SecDEnglishAU
163 # StrCpy $DictCodes "en_AU,$DictCodes"
167 Section /o "English (CA)" SecDEnglishCA
168 StrCpy $DictCodes "en_CA,$DictCodes"
172 Section "English (GB)" SecDEnglishGB
173 # already installed by default
175 #StrCpy $DictCodes "en_GB,$DictCodes"
179 # enable this for LyX 2.1!
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 "Gaeilge" SecDGaelic
229 StrCpy $DictCodes "ga_IR,$DictCodes"
233 Section /o "Gàidhlig" SecDScottish
234 StrCpy $DictCodes "gd_GB,$DictCodes"
238 Section /o "Galego" SecDGalician
239 StrCpy $DictCodes "gl_ES,$DictCodes"
243 Section /o "Hebrew" SecDHebrew
244 StrCpy $DictCodes "he_IL,$DictCodes"
248 Section /o "Hrvatski" SecDCroatian
249 StrCpy $DictCodes "hr_HR,$DictCodes"
253 Section /o "Magyar" SecDHungarian
254 StrCpy $DictCodes "hu_HU,$DictCodes"
258 Section /o "Interlingua" SecDInterlingua
259 StrCpy $DictCodes "ia_IA,$DictCodes"
263 Section /o "Íslenska" SecDIcelandic
264 StrCpy $DictCodes "is_IS,$DictCodes"
268 Section /o "Italiano" SecDItalian
269 StrCpy $DictCodes "it_IT,$DictCodes"
273 Section /o "Kazakh" SecDKazakh
274 StrCpy $DictCodes "kk_KZ,$DictCodes"
278 Section /o "Korean" SecDKorean
279 StrCpy $DictCodes "ko_KR,$DictCodes"
283 Section /o "Latina" SecDLatin
284 StrCpy $DictCodes "la_LA,$DictCodes"
288 Section /o "Lietuviu" SecDLithuanian
289 StrCpy $DictCodes "lt_LT,$DictCodes"
293 Section /o "Latvie
\9au" SecDLatvian
294 StrCpy $DictCodes "lv_LV,$DictCodes"
298 Section /o "Nederlands" SecDDutch
299 StrCpy $DictCodes "nl_NL,$DictCodes"
303 Section /o "Norsk (Bokmål)" SecDNorwegianNB
304 StrCpy $DictCodes "nb_NO,$DictCodes"
308 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
309 StrCpy $DictCodes "nn_NO,$DictCodes"
313 Section /o "Polski" SecDPolish
314 StrCpy $DictCodes "pl_PL,$DictCodes"
318 Section /o "Português (BR)" SecDPortugueseBR
319 StrCpy $DictCodes "pt_BR,$DictCodes"
323 Section /o "Português (PT)" SecDPortuguesePT
324 StrCpy $DictCodes "pt_PT,$DictCodes"
328 Section /o "Româna" SecDRomanian
329 StrCpy $DictCodes "ro_RO,$DictCodes"
333 Section /o "Russian" SecDRussian
334 StrCpy $DictCodes "ru_RU,$DictCodes"
338 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
339 StrCpy $DictCodes "dsb_DE,$DictCodes"
343 Section /o "Serb
\9acina (Horno)" SecDSorbianH
344 StrCpy $DictCodes "hsb_DE,$DictCodes"
348 Section /o "Shqipe" SecDAlbanian
349 StrCpy $DictCodes "sq_AL,$DictCodes"
353 Section /o "Sloven
\9acina" SecDSlowenian
354 StrCpy $DictCodes "sl_SI,$DictCodes"
358 Section /o "Slovenský" SecDSlowakian
359 StrCpy $DictCodes "sk_SK$ThesCodes"
363 Section /o "Srpski" SecDSerbian
364 StrCpy $DictCodes "sr_RS,$DictCodes"
368 Section /o "Svenska" SecDSwedish
369 StrCpy $DictCodes "sv_SE,$DictCodes"
373 Section /o "Thai" SecDThai
374 StrCpy $DictCodes "th_TH,$DictCodes"
378 Section /o "Ukrainian" SecDUkrainian
379 StrCpy $DictCodes "uk_UA,$DictCodes"
383 Section /o "Vietnamese" SecDVietnamese
384 StrCpy $DictCodes "vi_VN,$DictCodes"
390 SectionGroup "Thesaurus" SecThesaurus
392 Section /o "Bulgarian" SecTBulgarian
393 StrCpy $ThesCodes "bg_BG$ThesCodes"
397 Section /o "Català" SecTCatalan
398 StrCpy $ThesCodes "ca_ES$ThesCodes"
402 Section /o "Ce
\9atina" SecTCzech
403 StrCpy $ThesCodes "cs_CZ$ThesCodes"
407 Section /o "Dansk" SecTDanish
408 StrCpy $ThesCodes "da_DK$ThesCodes"
412 Section /o "Deutsch (D/A)" SecTGermanDA
413 StrCpy $ThesCodes "de_DE$ThesCodes"
417 Section /o "Deutsch (CH)" SecTGermanCH
418 StrCpy $ThesCodes "de_CH$ThesCodes"
422 Section /o "English (GB)" SecTEnglishGB
423 StrCpy $ThesCodes "en_GB$ThesCodes"
427 Section /o "English (US/AU)" SecTEnglishUSAU
428 StrCpy $ThesCodes "en_US$ThesCodes"
432 Section /o "Español" SecTSpanish
433 StrCpy $ThesCodes "es_ES$ThesCodes"
437 Section /o "Français" SecTFrench
438 StrCpy $ThesCodes "fr_FR$ThesCodes"
442 Section /o "Gaeilge" SecTGaelic
443 StrCpy $ThesCodes "ga_IR$ThesCodes"
447 Section /o "Greek" SecTGreek
448 StrCpy $ThesCodes "el_GR$ThesCodes"
452 Section /o "Italiano" SecTItalian
453 StrCpy $ThesCodes "it_IT$ThesCodes"
457 Section /o "Magyar" SecTHungarian
458 StrCpy $ThesCodes "hu_HU$ThesCodes"
462 Section /o "Norsk" SecTNorwegian
463 StrCpy $ThesCodes "no_NO$ThesCodes"
467 Section /o "Polski" SecTPolish
468 StrCpy $ThesCodes "pl_PL$ThesCodes"
472 Section /o "Português" SecTPortuguese
473 StrCpy $ThesCodes "pt_PT$ThesCodes"
477 Section /o "Româna" SecTRomanian
478 StrCpy $ThesCodes "ro_RO$ThesCodes"
482 Section /o "Russian" SecTRussian
483 StrCpy $ThesCodes "ru_RU$ThesCodes"
487 Section /o "Sloven
\9acina" SecTSlowenian
488 StrCpy $ThesCodes "sl_SI$ThesCodes"
492 Section /o "Slovenský" SecTSlowakian
493 StrCpy $ThesCodes "sk_SK$ThesCodes"
497 Section /o "Svenska" SecTSwedish
498 StrCpy $ThesCodes "sv_SE$ThesCodes"
504 # Section descriptions
505 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
506 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
507 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
508 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
509 !if ${SETUPTYPE} == BUNDLE
510 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
512 !insertmacro MUI_FUNCTION_DESCRIPTION_END
515 #--------------------------------
516 # Installer initialization
520 ${If} ${AtLeastWinVista}
521 StrCpy $PrinterConf "printui.exe"
523 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
528 # .onInit must be here after the section definition because we have to set
529 # the selection states of the dictionary sections
533 ${OrIfNot} ${AtLeastWinXP}
534 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
538 # check that the installer is not currently running
539 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
542 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
545 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
548 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
552 # check if this LyX version is already installed
553 ${if} $MultiUser.Privileges == "Admin"
554 ${orif} $MultiUser.Privileges == "Power"
555 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
557 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
558 # handle also the case that LyX is already installed in HKLM
560 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
564 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
568 !insertmacro PRINTER_INIT
569 !insertmacro MULTIUSER_INIT
571 # this can be reset to "true" in section SecDesktop
572 StrCpy $CreateDesktopIcon "false"
573 StrCpy $CreateFileAssociations "false"
576 # Show banner while installer is intializating
577 Banner::show /NOUNLOAD "Checking system"
583 !if ${SETUPTYPE} == BUNDLE
584 # don't let the installer sections appear when the programs are already installed
585 ${if} $PathBibTeXEditor != ""
586 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
590 # select sections of already installed spell-checker dictionaries, make them read-only
591 # and set the necessary size to 0 bytes
592 StrCpy $String $FoundDict
593 StrCpy $Search "af_ZA"
594 Call StrPoint # function from LyXUtils.nsh
595 ${if} $Pointer != "-1"
596 IntOp $0 ${SF_SELECTED} | ${SF_RO}
597 SectionSetFlags ${SecDAfrikaans} $0
598 SectionSetSize ${SecDAfrikaans} 0
600 StrCpy $Search "ar_DZ"
602 ${if} $Pointer != "-1"
603 IntOp $0 ${SF_SELECTED} | ${SF_RO}
604 SectionSetFlags ${SecDArabic} $0
605 SectionSetSize ${SecDArabic} 0
607 StrCpy $Search "hy_AM"
609 ${if} $Pointer != "-1"
610 IntOp $0 ${SF_SELECTED} | ${SF_RO}
611 SectionSetFlags ${SecDArmenian} $0
612 SectionSetSize ${SecDArmenian} 0
614 StrCpy $Search "id_ID"
616 ${if} $Pointer != "-1"
617 IntOp $0 ${SF_SELECTED} | ${SF_RO}
618 SectionSetFlags ${SecDIndonesian} $0
619 SectionSetSize ${SecDIndonesian} 0
621 StrCpy $Search "ms_MY"
623 ${if} $Pointer != "-1"
624 IntOp $0 ${SF_SELECTED} | ${SF_RO}
625 SectionSetFlags ${SecDMalayan} $0
626 SectionSetSize ${SecDMalayan} 0
628 StrCpy $Search "be_BY"
630 ${if} $Pointer != "-1"
631 IntOp $0 ${SF_SELECTED} | ${SF_RO}
632 SectionSetFlags ${SecDBelarusian} $0
633 SectionSetSize ${SecDBelarusian} 0
635 StrCpy $Search "br_FR"
637 ${if} $Pointer != "-1"
638 IntOp $0 ${SF_SELECTED} | ${SF_RO}
639 SectionSetFlags ${SecDBreton} $0
640 SectionSetSize ${SecDBreton} 0
642 StrCpy $Search "bg_BG"
644 ${if} $Pointer != "-1"
645 IntOp $0 ${SF_SELECTED} | ${SF_RO}
646 SectionSetFlags ${SecDBulgarian} $0
647 SectionSetSize ${SecDBulgarian} 0
649 StrCpy $Search "ca_ES"
651 ${if} $Pointer != "-1"
652 IntOp $0 ${SF_SELECTED} | ${SF_RO}
653 SectionSetFlags ${SecDCatalanian} $0
654 SectionSetSize ${SecDCatalanian} 0
656 StrCpy $Search "cs_CZ"
658 ${if} $Pointer != "-1"
659 IntOp $0 ${SF_SELECTED} | ${SF_RO}
660 SectionSetFlags ${SecDCzech} $0
661 SectionSetSize ${SecDCzech} 0
664 StrCpy $Search "cop_EG"
666 ${if} $Pointer != "-1"
667 IntOp $0 ${SF_SELECTED} | ${SF_RO}
668 # enable this for LyX 2.1!
669 # SectionSetFlags ${SecDCoptic} $0
670 # SectionSetSize ${SecDCoptic} 0
672 StrCpy $Search "cy_GB"
674 ${if} $Pointer != "-1"
675 IntOp $0 ${SF_SELECTED} | ${SF_RO}
676 SectionSetFlags ${SecDWelsh} $0
677 SectionSetSize ${SecDWelsh} 0
679 StrCpy $Search "da_DK"
681 ${if} $Pointer != "-1"
682 IntOp $0 ${SF_SELECTED} | ${SF_RO}
683 SectionSetFlags ${SecDDanish} $0
684 SectionSetSize ${SecDDanish} 0
686 StrCpy $Search "de_AT"
688 ${if} $Pointer != "-1"
689 IntOp $0 ${SF_SELECTED} | ${SF_RO}
690 SectionSetFlags ${SecDGermanAT} $0
691 SectionSetSize ${SecDGermanAT} 0
693 StrCpy $Search "de_CH"
695 ${if} $Pointer != "-1"
696 IntOp $0 ${SF_SELECTED} | ${SF_RO}
697 SectionSetFlags ${SecDGermanCH} $0
698 SectionSetSize ${SecDGermanCH} 0
700 StrCpy $Search "de_DE"
702 ${if} $Pointer != "-1"
703 IntOp $0 ${SF_SELECTED} | ${SF_RO}
704 SectionSetFlags ${SecDGermanD} $0
705 SectionSetSize ${SecDGermanD} 0
707 StrCpy $Search "el_GR"
709 ${if} $Pointer != "-1"
710 IntOp $0 ${SF_SELECTED} | ${SF_RO}
711 SectionSetFlags ${SecDGreek} $0
712 SectionSetSize ${SecDGreek} 0
714 StrCpy $Search "et_EE"
716 ${if} $Pointer != "-1"
717 IntOp $0 ${SF_SELECTED} | ${SF_RO}
718 SectionSetFlags ${SecDEstonian} $0
719 SectionSetSize ${SecDEstonian} 0
721 StrCpy $Search "en_AU"
723 ${if} $Pointer != "-1"
724 IntOp $0 ${SF_SELECTED} | ${SF_RO}
725 # enable this for LyX 2.1!
726 # SectionSetFlags ${SecDEnglishAU} $0
727 # SectionSetSize ${SecDEnglishAU} 0
729 StrCpy $Search "en_CA"
731 ${if} $Pointer != "-1"
732 IntOp $0 ${SF_SELECTED} | ${SF_RO}
733 SectionSetFlags ${SecDEnglishCA} $0
734 SectionSetSize ${SecDEnglishCA} 0
736 StrCpy $Search "en_GB"
738 ${if} $Pointer != "-1"
739 IntOp $0 ${SF_SELECTED} | ${SF_RO}
740 SectionSetFlags ${SecDEnglishGB} $0
741 SectionSetSize ${SecDEnglishGB} 0
743 StrCpy $Search "en_NZ"
745 ${if} $Pointer != "-1"
746 IntOp $0 ${SF_SELECTED} | ${SF_RO}
747 # enable this for LyX 2.1!
748 # SectionSetFlags ${SecDEnglishNZ} $0
749 # SectionSetSize ${SecDEnglishNZ} 0
751 StrCpy $Search "en_US"
753 ${if} $Pointer != "-1"
754 IntOp $0 ${SF_SELECTED} | ${SF_RO}
755 SectionSetFlags ${SecDEnglishUS} $0
756 SectionSetSize ${SecDEnglishUS} 0
758 StrCpy $Search "es_ES"
760 ${if} $Pointer != "-1"
761 IntOp $0 ${SF_SELECTED} | ${SF_RO}
762 SectionSetFlags ${SecDSpanishES} $0
763 SectionSetSize ${SecDSpanishES} 0
765 StrCpy $Search "es_MX"
767 ${if} $Pointer != "-1"
768 IntOp $0 ${SF_SELECTED} | ${SF_RO}
769 SectionSetFlags ${SecDSpanishMX} $0
770 SectionSetSize ${SecDSpanishMX} 0
772 StrCpy $Search "eo_EO"
774 ${if} $Pointer != "-1"
775 IntOp $0 ${SF_SELECTED} | ${SF_RO}
776 SectionSetFlags ${SecDEsperanto} $0
777 SectionSetSize ${SecDEsperanto} 0
779 StrCpy $Search "eu_ES"
781 ${if} $Pointer != "-1"
782 IntOp $0 ${SF_SELECTED} | ${SF_RO}
783 SectionSetFlags ${SecDBasque} $0
784 SectionSetSize ${SecDBasque} 0
786 StrCpy $Search "fa_IR"
788 ${if} $Pointer != "-1"
789 IntOp $0 ${SF_SELECTED} | ${SF_RO}
790 SectionSetFlags ${SecDFarsi} $0
791 SectionSetSize ${SecDFarsi} 0
793 StrCpy $Search "fr_FR"
795 ${if} $Pointer != "-1"
796 IntOp $0 ${SF_SELECTED} | ${SF_RO}
797 SectionSetFlags ${SecDFrench} $0
798 SectionSetSize ${SecDFrench} 0
800 StrCpy $Search "ga_IR"
802 ${if} $Pointer != "-1"
803 IntOp $0 ${SF_SELECTED} | ${SF_RO}
804 SectionSetFlags ${SecDGaelic} $0
805 SectionSetSize ${SecDGaelic} 0
807 StrCpy $Search "gd_GB"
809 ${if} $Pointer != "-1"
810 IntOp $0 ${SF_SELECTED} | ${SF_RO}
811 SectionSetFlags ${SecDScottish} $0
812 SectionSetSize ${SecDScottish} 0
814 StrCpy $Search "gl_ES"
816 ${if} $Pointer != "-1"
817 IntOp $0 ${SF_SELECTED} | ${SF_RO}
818 SectionSetFlags ${SecDGalician} $0
819 SectionSetSize ${SecDGalician} 0
821 StrCpy $Search "he_IL"
823 ${if} $Pointer != "-1"
824 IntOp $0 ${SF_SELECTED} | ${SF_RO}
825 SectionSetFlags ${SecDHebrew} $0
826 SectionSetSize ${SecDHebrew} 0
828 StrCpy $Search "hr_HR"
830 ${if} $Pointer != "-1"
831 IntOp $0 ${SF_SELECTED} | ${SF_RO}
832 SectionSetFlags ${SecDCroatian} $0
833 SectionSetSize ${SecDCroatian} 0
835 StrCpy $Search "hu_HU"
837 ${if} $Pointer != "-1"
838 IntOp $0 ${SF_SELECTED} | ${SF_RO}
839 SectionSetFlags ${SecDHungarian} $0
840 SectionSetSize ${SecDHungarian} 0
842 StrCpy $Search "ia_IA"
844 ${if} $Pointer != "-1"
845 IntOp $0 ${SF_SELECTED} | ${SF_RO}
846 SectionSetFlags ${SecDInterlingua} $0
847 SectionSetSize ${SecDInterlingua} 0
849 StrCpy $Search "is_IS"
851 ${if} $Pointer != "-1"
852 IntOp $0 ${SF_SELECTED} | ${SF_RO}
853 SectionSetFlags ${SecDIcelandic} $0
854 SectionSetSize ${SecDIcelandic} 0
856 StrCpy $Search "it_IT"
858 ${if} $Pointer != "-1"
859 IntOp $0 ${SF_SELECTED} | ${SF_RO}
860 SectionSetFlags ${SecDItalian} $0
861 SectionSetSize ${SecDItalian} 0
863 StrCpy $Search "kk_KZ"
865 ${if} $Pointer != "-1"
866 IntOp $0 ${SF_SELECTED} | ${SF_RO}
867 SectionSetFlags ${SecDKazakh} $0
868 SectionSetSize ${SecDKazakh} 0
870 StrCpy $Search "ko_KR"
872 ${if} $Pointer != "-1"
873 IntOp $0 ${SF_SELECTED} | ${SF_RO}
874 SectionSetFlags ${SecDKorean} $0
875 SectionSetSize ${SecDKorean} 0
877 StrCpy $Search "la_LA"
879 ${if} $Pointer != "-1"
880 IntOp $0 ${SF_SELECTED} | ${SF_RO}
881 SectionSetFlags ${SecDLatin} $0
882 SectionSetSize ${SecDLatin} 0
884 StrCpy $Search "lt_LT"
886 ${if} $Pointer != "-1"
887 IntOp $0 ${SF_SELECTED} | ${SF_RO}
888 SectionSetFlags ${SecDLithuanian} $0
889 SectionSetSize ${SecDLithuanian} 0
891 StrCpy $Search "lv_LV"
893 ${if} $Pointer != "-1"
894 IntOp $0 ${SF_SELECTED} | ${SF_RO}
895 SectionSetFlags ${SecDLatvian} $0
896 SectionSetSize ${SecDLatvian} 0
898 StrCpy $Search "nl_NL"
900 ${if} $Pointer != "-1"
901 IntOp $0 ${SF_SELECTED} | ${SF_RO}
902 SectionSetFlags ${SecDDutch} $0
903 SectionSetSize ${SecDDutch} 0
905 StrCpy $Search "nb_NO"
907 ${if} $Pointer != "-1"
908 IntOp $0 ${SF_SELECTED} | ${SF_RO}
909 SectionSetFlags ${SecDNorwegianNB} $0
910 SectionSetSize ${SecDNorwegianNB} 0
912 StrCpy $Search "nn_NO"
914 ${if} $Pointer != "-1"
915 IntOp $0 ${SF_SELECTED} | ${SF_RO}
916 SectionSetFlags ${SecDNorwegianNN} $0
917 SectionSetSize ${SecDNorwegianNN} 0
919 StrCpy $Search "pl_PL"
921 ${if} $Pointer != "-1"
922 IntOp $0 ${SF_SELECTED} | ${SF_RO}
923 SectionSetFlags ${SecDPolish} $0
924 SectionSetSize ${SecDPolish} 0
926 StrCpy $Search "pt_BR"
928 ${if} $Pointer != "-1"
929 IntOp $0 ${SF_SELECTED} | ${SF_RO}
930 SectionSetFlags ${SecDPortugueseBR} $0
931 SectionSetSize ${SecDPortugueseBR} 0
933 StrCpy $Search "pt_PT"
935 ${if} $Pointer != "-1"
936 IntOp $0 ${SF_SELECTED} | ${SF_RO}
937 SectionSetFlags ${SecDPortuguesePT} $0
938 SectionSetSize ${SecDPortuguesePT} 0
940 StrCpy $Search "ro_RO"
942 ${if} $Pointer != "-1"
943 IntOp $0 ${SF_SELECTED} | ${SF_RO}
944 SectionSetFlags ${SecDRomanian} $0
945 SectionSetSize ${SecDRomanian} 0
947 StrCpy $Search "ru_RU"
949 ${if} $Pointer != "-1"
950 IntOp $0 ${SF_SELECTED} | ${SF_RO}
951 SectionSetFlags ${SecDRussian} $0
952 SectionSetSize ${SecDRussian} 0
954 StrCpy $Search "dsb_DE"
956 ${if} $Pointer != "-1"
957 IntOp $0 ${SF_SELECTED} | ${SF_RO}
958 SectionSetFlags ${SecDSorbianD} $0
959 SectionSetSize ${SecDSorbianD} 0
961 StrCpy $Search "hsb_DE"
963 ${if} $Pointer != "-1"
964 IntOp $0 ${SF_SELECTED} | ${SF_RO}
965 SectionSetFlags ${SecDSorbianH} $0
966 SectionSetSize ${SecDSorbianH} 0
968 StrCpy $Search "sq_AL"
970 ${if} $Pointer != "-1"
971 IntOp $0 ${SF_SELECTED} | ${SF_RO}
972 SectionSetFlags ${SecDAlbanian} $0
973 SectionSetSize ${SecDAlbanian} 0
975 StrCpy $Search "sl_SI"
977 ${if} $Pointer != "-1"
978 IntOp $0 ${SF_SELECTED} | ${SF_RO}
979 SectionSetFlags ${SecDSlowenian} $0
980 SectionSetSize ${SecDSlowenian} 0
982 StrCpy $Search "sk_SK"
984 ${if} $Pointer != "-1"
985 IntOp $0 ${SF_SELECTED} | ${SF_RO}
986 SectionSetFlags ${SecDSlowakian} $0
987 SectionSetSize ${SecDSlowakian} 0
989 StrCpy $Search "sr_RS"
991 ${if} $Pointer != "-1"
992 IntOp $0 ${SF_SELECTED} | ${SF_RO}
993 SectionSetFlags ${SecDSerbian} $0
994 SectionSetSize ${SecDSerbian} 0
996 StrCpy $Search "sv_SE"
998 ${if} $Pointer != "-1"
999 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1000 SectionSetFlags ${SecDSwedish} $0
1001 SectionSetSize ${SecDSwedish} 0
1003 StrCpy $Search "th_TH"
1005 ${if} $Pointer != "-1"
1006 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1007 SectionSetFlags ${SecDThai} $0
1008 SectionSetSize ${SecDThai} 0
1010 StrCpy $Search "uk_UA"
1012 ${if} $Pointer != "-1"
1013 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1014 SectionSetFlags ${SecDUkrainian} $0
1015 SectionSetSize ${SecDUkrainian} 0
1017 StrCpy $Search "vi_VN"
1019 ${if} $Pointer != "-1"
1020 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1021 SectionSetFlags ${SecDVietnamese} $0
1022 SectionSetSize ${SecDVietnamese} 0
1025 # select sections of already installed thesaurus dictionaries, make them read-only
1026 # and set the necessary size to 0 bytes
1027 StrCpy $String $FoundThes
1028 StrCpy $Search "bg_BG"
1029 Call StrPoint # function from LyXUtils.nsh
1030 ${if} $Pointer != "-1"
1031 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1032 SectionSetFlags ${SecTBulgarian} $0
1033 SectionSetSize ${SecTBulgarian} 0
1035 StrCpy $Search "ca_ES"
1037 ${if} $Pointer != "-1"
1038 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1039 SectionSetFlags ${SecTCatalan} $0
1040 SectionSetSize ${SecTCatalan} 0
1042 StrCpy $Search "cs_CZ"
1044 ${if} $Pointer != "-1"
1045 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1046 SectionSetFlags ${SecTCzech} $0
1047 SectionSetSize ${SecTCzech} 0
1049 StrCpy $Search "da_DK"
1051 ${if} $Pointer != "-1"
1052 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1053 SectionSetFlags ${SecTDanish} $0
1054 SectionSetSize ${SecTDanish} 0
1056 StrCpy $Search "de_DE"
1058 ${if} $Pointer != "-1"
1059 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1060 SectionSetFlags ${SecTGermanDA} $0
1061 SectionSetSize ${SecTGermanDA} 0
1063 StrCpy $Search "de_CH"
1065 ${if} $Pointer != "-1"
1066 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1067 SectionSetFlags ${SecTGermanCH} $0
1068 SectionSetSize ${SecTGermanCH} 0
1070 StrCpy $Search "en_GB"
1072 ${if} $Pointer != "-1"
1073 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1074 SectionSetFlags ${SecTEnglishGB} $0
1075 SectionSetSize ${SecTEnglishGB} 0
1077 StrCpy $Search "en_US"
1079 ${if} $Pointer != "-1"
1080 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1081 SectionSetFlags ${SecTEnglishUSAU} $0
1082 SectionSetSize ${SecTEnglishUSAU} 0
1084 StrCpy $Search "es_ES"
1086 ${if} $Pointer != "-1"
1087 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1088 SectionSetFlags ${SecTSpanish} $0
1089 SectionSetSize ${SecTSpanish} 0
1091 StrCpy $Search "fr_FR"
1093 ${if} $Pointer != "-1"
1094 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1095 SectionSetFlags ${SecTFrench} $0
1096 SectionSetSize ${SecTFrench} 0
1098 StrCpy $Search "ga_IR"
1100 ${if} $Pointer != "-1"
1101 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1102 SectionSetFlags ${SecTGaelic} $0
1103 SectionSetSize ${SecTGaelic} 0
1105 StrCpy $Search "el_GR"
1107 ${if} $Pointer != "-1"
1108 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1109 SectionSetFlags ${SecTGreek} $0
1110 SectionSetSize ${SecTGreek} 0
1112 StrCpy $Search "it_IT"
1114 ${if} $Pointer != "-1"
1115 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1116 SectionSetFlags ${SecTItalian} $0
1117 SectionSetSize ${SecTItalian} 0
1119 StrCpy $Search "hu_HU"
1121 ${if} $Pointer != "-1"
1122 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1123 SectionSetFlags ${SecTHungarian} $0
1124 SectionSetSize ${SecTHungarian} 0
1126 StrCpy $Search "no_NO"
1128 ${if} $Pointer != "-1"
1129 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1130 SectionSetFlags ${SecTNorwegian} $0
1131 SectionSetSize ${SecTNorwegian} 0
1133 StrCpy $Search "pl_PL"
1135 ${if} $Pointer != "-1"
1136 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1137 SectionSetFlags ${SecTPolish} $0
1138 SectionSetSize ${SecTPolish} 0
1140 StrCpy $Search "pt_PT"
1142 ${if} $Pointer != "-1"
1143 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1144 SectionSetFlags ${SecTPortuguese} $0
1145 SectionSetSize ${SecTPortuguese} 0
1147 StrCpy $Search "ro_RO"
1149 ${if} $Pointer != "-1"
1150 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1151 SectionSetFlags ${SecTRomanian} $0
1152 SectionSetSize ${SecTRomanian} 0
1154 StrCpy $Search "ru_RU"
1156 ${if} $Pointer != "-1"
1157 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1158 SectionSetFlags ${SecTRussian} $0
1159 SectionSetSize ${SecTRussian} 0
1161 StrCpy $Search "sl_SI"
1163 ${if} $Pointer != "-1"
1164 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1165 SectionSetFlags ${SecTSlowenian} $0
1166 SectionSetSize ${SecTSlowenian} 0
1168 StrCpy $Search "sk_SK"
1170 ${if} $Pointer != "-1"
1171 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1172 SectionSetFlags ${SecTSlowakian} $0
1173 SectionSetSize ${SecTSlowakian} 0
1175 StrCpy $Search "sv_SE"
1177 ${if} $Pointer != "-1"
1178 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1179 SectionSetFlags ${SecTSwedish} $0
1180 SectionSetSize ${SecTSwedish} 0
1189 # this function is called at first after starting the uninstaller
1192 !insertmacro PRINTER_INIT
1193 !insertmacro MULTIUSER_UNINIT
1195 # Check that LyX is not currently running
1196 FindProcDLL::FindProc "lyx.exe"
1198 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1202 # set registry root key
1203 ${if} $MultiUser.Privileges == "Admin"
1204 ${orif} $MultiUser.Privileges == "Power"
1205 SetShellVarContext all
1207 SetShellVarContext current
1210 # Ascertain whether the user has sufficient privileges to uninstall.
1211 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1212 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1214 ${andif} $MultiUser.Privileges != "Admin"
1215 ${andif} $MultiUser.Privileges != "Power"
1216 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1219 # abort when LyX couldn't be found in the registry
1220 ${if} $0 == "" # check in HKCU
1221 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1223 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1227 # Macro to investigate name of LyX's preferences folders to be able remove them
1228 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1230 # test if MiKTeX was installed together with LyX
1231 ReadRegStr $0 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1232 ${if} $0 == "Yes${APP_SERIES_KEY}"
1233 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1234 StrCpy $LaTeXInstalled "MiKTeX"
1235 DeleteRegValue HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1237 SectionSetText 2 "" # hides the corresponding uninstaller section
1240 # test if JabRef was installed together with LyX
1241 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1242 ${if} $0 == "Yes${APP_SERIES_KEY}"
1243 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1244 StrCpy $JabRefInstalled "Yes"
1245 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1247 SectionSetText 3 "" # hides the corresponding uninstaller section
1250 # question message if the user really wants to uninstall LyX
1251 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes