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
50 Section "$(SecFileAssocTitle)" SecFileAssoc
51 StrCpy $CreateFileAssociations "true"
53 Section "$(SecDesktopTitle)" SecDesktop
54 StrCpy $CreateDesktopIcon "true"
57 !if ${SETUPTYPE} == BUNDLE
58 Section /o "$(SecInstJabRefTitle)" SecInstJabRef
60 StrCpy $InstallJabRef "true"
64 SectionGroup "Dictionaries" SecDictionaries
66 Section /o "Afrikaans" SecDAfrikaans
67 StrCpy $DictCodes "af_ZA,$DictCodes"
71 Section /o "Arabic" SecDArabic
72 StrCpy $DictCodes "ar_DZ,$DictCodes"
76 Section /o "Armenian" SecDArmenian
77 StrCpy $DictCodes "hy_AM,$DictCodes"
81 Section /o "Bahasa Indonesia" SecDIndonesian
82 StrCpy $DictCodes "id_ID,$DictCodes"
86 Section /o "Bahasa Melayu" SecDMalayan
87 StrCpy $DictCodes "ms_MY,$DictCodes"
91 Section /o "Belarusian" SecDBelarusian
92 StrCpy $DictCodes "be_BY,$DictCodes"
96 Section /o "Brezhoneg" SecDBreton
97 StrCpy $DictCodes "br_FR,$DictCodes"
101 Section /o "Bulgarian" SecDBulgarian
102 StrCpy $DictCodes "bg_BG,$DictCodes"
106 Section /o "Català" SecDCatalanian
107 StrCpy $DictCodes "ca_ES,$DictCodes"
111 Section /o "Ce
\9atina" SecDCzech
112 StrCpy $DictCodes "cs_CZ,$DictCodes"
116 # enable this for LyX 2.1!
117 #Section /o "Coptic" SecDCoptic
118 # StrCpy $DictCodes "cop_EG,$DictCodes"
122 Section /o "Cymraeg" SecDWelsh
123 StrCpy $DictCodes "cy_GB,$DictCodes"
127 Section /o "Dansk" SecDDanish
128 StrCpy $DictCodes "da_DK,$DictCodes"
132 Section /o "German (A)" SecDGermanAT
133 StrCpy $DictCodes "de_AT,$DictCodes"
137 Section /o "German (CH)" SecDGermanCH
138 StrCpy $DictCodes "de_CH,$DictCodes"
142 Section "German (D)" SecDGermanD
143 # already installed by default
145 #StrCpy $DictCodes "de_DE,$DictCodes"
149 Section /o "Greek" SecDGreek
150 StrCpy $DictCodes "el_GR,$DictCodes"
154 Section /o "Eesti" SecDEstonian
155 StrCpy $DictCodes "et_EE,$DictCodes"
159 # enable this for LyX 2.1!
160 #Section /o "English (AU)" SecDEnglishAU
161 # StrCpy $DictCodes "en_AU,$DictCodes"
165 Section /o "English (CA)" SecDEnglishCA
166 StrCpy $DictCodes "en_CA,$DictCodes"
170 Section "English (GB)" SecDEnglishGB
171 # already installed by default
173 #StrCpy $DictCodes "en_GB,$DictCodes"
177 # enable this for LyX 2.1!
178 #Section /o "English (NZ)" SecDEnglishNZ
179 # StrCpy $DictCodes "en_NZ,$DictCodes"
183 Section "English (US)" SecDEnglishUS
184 # already installed by default
186 #StrCpy $DictCodes "en_US,$DictCodes"
190 Section "Español (ES)" SecDSpanishES
191 # already installed by default
193 #StrCpy $DictCodes "es_ES,$DictCodes"
197 Section "Español (MX)" SecDSpanishMX
198 # already installed by default
200 #StrCpy $DictCodes "es_MX,$DictCodes"
204 Section /o "Esperanto" SecDEsperanto
205 StrCpy $DictCodes "eo_EO,$DictCodes"
209 Section /o "Euskara" SecDBasque
210 StrCpy $DictCodes "eu_ES,$DictCodes"
214 Section /o "Farsi" SecDFarsi
215 StrCpy $DictCodes "fa_IR,$DictCodes"
219 Section "Français" SecDFrench
220 # already installed by default
222 #StrCpy $DictCodes "fr_FR,$DictCodes"
226 Section /o "Gaeilge" SecDGaelic
227 StrCpy $DictCodes "ga_IR,$DictCodes"
231 Section /o "Gàidhlig" SecDScottish
232 StrCpy $DictCodes "gd_GB,$DictCodes"
236 Section /o "Galego" SecDGalician
237 StrCpy $DictCodes "gl_ES,$DictCodes"
241 Section /o "Hebrew" SecDHebrew
242 StrCpy $DictCodes "he_IL,$DictCodes"
246 Section /o "Hrvatski" SecDCroatian
247 StrCpy $DictCodes "hr_HR,$DictCodes"
251 Section /o "Magyar" SecDHungarian
252 StrCpy $DictCodes "hu_HU,$DictCodes"
256 # enable this for LyX 2.1!
257 #Section /o "Hindi" SecDHindi
258 # StrCpy $DictCodes "hi_IN,$DictCodes"
262 Section /o "Interlingua" SecDInterlingua
263 StrCpy $DictCodes "ia_IA,$DictCodes"
267 Section /o "Íslenska" SecDIcelandic
268 StrCpy $DictCodes "is_IS,$DictCodes"
272 Section /o "Italiano" SecDItalian
273 StrCpy $DictCodes "it_IT,$DictCodes"
277 Section /o "Kazakh" SecDKazakh
278 StrCpy $DictCodes "kk_KZ,$DictCodes"
282 Section /o "Korean" SecDKorean
283 StrCpy $DictCodes "ko_KR,$DictCodes"
287 Section /o "Latina" SecDLatin
288 StrCpy $DictCodes "la_LA,$DictCodes"
292 Section /o "Lietuviu" SecDLithuanian
293 StrCpy $DictCodes "lt_LT,$DictCodes"
297 Section /o "Latvie
\9au" SecDLatvian
298 StrCpy $DictCodes "lv_LV,$DictCodes"
302 Section /o "Nederlands" SecDDutch
303 StrCpy $DictCodes "nl_NL,$DictCodes"
307 Section /o "Norsk (Bokmål)" SecDNorwegianNB
308 StrCpy $DictCodes "nb_NO,$DictCodes"
312 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
313 StrCpy $DictCodes "nn_NO,$DictCodes"
317 # enable this for LyX 2.1!
318 #Section /o "Occitan" SecDOccitan
319 # StrCpy $DictCodes "oc_FR,$DictCodes"
323 Section /o "Polski" SecDPolish
324 StrCpy $DictCodes "pl_PL,$DictCodes"
328 Section /o "Português (BR)" SecDPortugueseBR
329 StrCpy $DictCodes "pt_BR,$DictCodes"
333 Section /o "Português (PT)" SecDPortuguesePT
334 StrCpy $DictCodes "pt_PT,$DictCodes"
338 Section /o "Româna" SecDRomanian
339 StrCpy $DictCodes "ro_RO,$DictCodes"
343 Section /o "Russian" SecDRussian
344 StrCpy $DictCodes "ru_RU,$DictCodes"
348 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
349 StrCpy $DictCodes "dsb_DE,$DictCodes"
353 Section /o "Serb
\9acina (Horno)" SecDSorbianH
354 StrCpy $DictCodes "hsb_DE,$DictCodes"
358 Section /o "Shqipe" SecDAlbanian
359 StrCpy $DictCodes "sq_AL,$DictCodes"
363 Section /o "Sloven
\9acina" SecDSlowenian
364 StrCpy $DictCodes "sl_SI,$DictCodes"
368 Section /o "Slovenský" SecDSlowakian
369 StrCpy $DictCodes "sk_SK$ThesCodes"
373 Section /o "Srpski" SecDSerbian
374 StrCpy $DictCodes "sr_RS,$DictCodes"
378 Section /o "Svenska" SecDSwedish
379 StrCpy $DictCodes "sv_SE,$DictCodes"
383 # enable this for LyX 2.1!
384 #Section /o "Tamil" SecDTamil
385 # StrCpy $DictCodes "ta_IN,$DictCodes"
389 # enable this for LyX 2.1!
390 #Section /o "Telugu" SecDTelugu
391 # StrCpy $DictCodes "te_IN,$DictCodes"
395 Section /o "Thai" SecDThai
396 StrCpy $DictCodes "th_TH,$DictCodes"
400 Section /o "Ukrainian" SecDUkrainian
401 StrCpy $DictCodes "uk_UA,$DictCodes"
405 # enable this for LyX 2.1!
406 #Section /o "Urdu" SecDUrdu
407 # StrCpy $DictCodes "ur_PK,$DictCodes"
411 Section /o "Vietnamese" SecDVietnamese
412 StrCpy $DictCodes "vi_VN,$DictCodes"
419 SectionGroup "Thesaurus" SecThesaurus
421 Section /o "Bulgarian" SecTBulgarian
422 StrCpy $ThesCodes "bg_BG$ThesCodes"
426 Section /o "Català" SecTCatalan
427 StrCpy $ThesCodes "ca_ES$ThesCodes"
431 Section /o "Ce
\9atina" SecTCzech
432 StrCpy $ThesCodes "cs_CZ$ThesCodes"
436 Section /o "Dansk" SecTDanish
437 StrCpy $ThesCodes "da_DK$ThesCodes"
441 Section /o "Deutsch (D/A)" SecTGermanDA
442 StrCpy $ThesCodes "de_DE$ThesCodes"
446 Section /o "Deutsch (CH)" SecTGermanCH
447 StrCpy $ThesCodes "de_CH$ThesCodes"
451 Section /o "English (GB)" SecTEnglishGB
452 StrCpy $ThesCodes "en_GB$ThesCodes"
456 Section /o "English (US/AU)" SecTEnglishUSAU
457 StrCpy $ThesCodes "en_US$ThesCodes"
461 Section /o "Español" SecTSpanish
462 StrCpy $ThesCodes "es_ES$ThesCodes"
466 Section /o "Français" SecTFrench
467 StrCpy $ThesCodes "fr_FR$ThesCodes"
471 Section /o "Gaeilge" SecTGaelic
472 StrCpy $ThesCodes "ga_IR$ThesCodes"
476 Section /o "Greek" SecTGreek
477 StrCpy $ThesCodes "el_GR$ThesCodes"
481 Section /o "Italiano" SecTItalian
482 StrCpy $ThesCodes "it_IT$ThesCodes"
486 Section /o "Magyar" SecTHungarian
487 StrCpy $ThesCodes "hu_HU$ThesCodes"
491 Section /o "Norsk" SecTNorwegian
492 StrCpy $ThesCodes "no_NO$ThesCodes"
496 Section /o "Polski" SecTPolish
497 StrCpy $ThesCodes "pl_PL$ThesCodes"
501 Section /o "Português" SecTPortuguese
502 StrCpy $ThesCodes "pt_PT$ThesCodes"
506 Section /o "Româna" SecTRomanian
507 StrCpy $ThesCodes "ro_RO$ThesCodes"
511 Section /o "Russian" SecTRussian
512 StrCpy $ThesCodes "ru_RU$ThesCodes"
516 Section /o "Sloven
\9acina" SecTSlowenian
517 StrCpy $ThesCodes "sl_SI$ThesCodes"
521 Section /o "Slovenský" SecTSlowakian
522 StrCpy $ThesCodes "sk_SK$ThesCodes"
526 Section /o "Svenska" SecTSwedish
527 StrCpy $ThesCodes "sv_SE$ThesCodes"
533 # Section descriptions
534 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
535 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
536 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
537 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
538 !if ${SETUPTYPE} == BUNDLE
539 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
541 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
542 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
543 !insertmacro MUI_FUNCTION_DESCRIPTION_END
546 #--------------------------------
547 # Installer initialization
551 ${If} ${AtLeastWinVista}
552 StrCpy $PrinterConf "printui.exe"
554 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
559 # .onInit must be here after the section definition because we have to set
560 # the selection states of the dictionary sections
564 ${OrIfNot} ${AtLeastWinXP}
565 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
569 # check that the installer is not currently running
570 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
573 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
576 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
579 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
583 !insertmacro MULTIUSER_INIT
585 # check if this LyX version is already installed
586 ${if} $MultiUser.Privileges == "Admin"
587 ${orif} $MultiUser.Privileges == "Power"
588 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
590 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
591 # handle also the case that LyX is already installed in HKLM
593 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
597 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
601 # check if there is an existing LyX installation of the same LyX series
602 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
603 IntOp $4 ${APP_VERSION_REVISION} + 20
605 ${if} $MultiUser.Privileges == "Admin"
606 ${orif} $MultiUser.Privileges == "Power"
607 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
609 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
612 StrCpy $R5 $0 # store the read version number
613 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
614 # we don't stop here because we want the latest installed version
617 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
618 # store the version number and reformat it temporarily for the error message
619 StrCpy $R0 $OldVersionNumber
620 StrCpy $OldVersionNumber $R5
621 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
622 StrCpy $OldVersionNumber $R0
626 !insertmacro PRINTER_INIT
628 # this can be reset to "true" in section SecDesktop
629 StrCpy $CreateDesktopIcon "false"
630 StrCpy $CreateFileAssociations "false"
633 # Show banner while installer is intializating
634 Banner::show /NOUNLOAD "Checking system"
640 !if ${SETUPTYPE} == BUNDLE
641 # don't let the installer sections appear when the programs are already installed
642 ${if} $PathBibTeXEditor != ""
643 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
647 # select sections of already installed spell-checker dictionaries, make them read-only
648 # and set the necessary size to 0 bytes
649 StrCpy $String $FoundDict
650 StrCpy $Search "af_ZA"
651 Call StrPoint # function from LyXUtils.nsh
652 ${if} $Pointer != "-1"
653 IntOp $0 ${SF_SELECTED} | ${SF_RO}
654 SectionSetFlags ${SecDAfrikaans} $0
655 SectionSetSize ${SecDAfrikaans} 0
657 StrCpy $Search "ar_DZ"
659 ${if} $Pointer != "-1"
660 IntOp $0 ${SF_SELECTED} | ${SF_RO}
661 SectionSetFlags ${SecDArabic} $0
662 SectionSetSize ${SecDArabic} 0
664 StrCpy $Search "hy_AM"
666 ${if} $Pointer != "-1"
667 IntOp $0 ${SF_SELECTED} | ${SF_RO}
668 SectionSetFlags ${SecDArmenian} $0
669 SectionSetSize ${SecDArmenian} 0
671 StrCpy $Search "id_ID"
673 ${if} $Pointer != "-1"
674 IntOp $0 ${SF_SELECTED} | ${SF_RO}
675 SectionSetFlags ${SecDIndonesian} $0
676 SectionSetSize ${SecDIndonesian} 0
678 StrCpy $Search "ms_MY"
680 ${if} $Pointer != "-1"
681 IntOp $0 ${SF_SELECTED} | ${SF_RO}
682 SectionSetFlags ${SecDMalayan} $0
683 SectionSetSize ${SecDMalayan} 0
685 StrCpy $Search "be_BY"
687 ${if} $Pointer != "-1"
688 IntOp $0 ${SF_SELECTED} | ${SF_RO}
689 SectionSetFlags ${SecDBelarusian} $0
690 SectionSetSize ${SecDBelarusian} 0
692 StrCpy $Search "br_FR"
694 ${if} $Pointer != "-1"
695 IntOp $0 ${SF_SELECTED} | ${SF_RO}
696 SectionSetFlags ${SecDBreton} $0
697 SectionSetSize ${SecDBreton} 0
699 StrCpy $Search "bg_BG"
701 ${if} $Pointer != "-1"
702 IntOp $0 ${SF_SELECTED} | ${SF_RO}
703 SectionSetFlags ${SecDBulgarian} $0
704 SectionSetSize ${SecDBulgarian} 0
706 StrCpy $Search "ca_ES"
708 ${if} $Pointer != "-1"
709 IntOp $0 ${SF_SELECTED} | ${SF_RO}
710 SectionSetFlags ${SecDCatalanian} $0
711 SectionSetSize ${SecDCatalanian} 0
713 StrCpy $Search "cs_CZ"
715 ${if} $Pointer != "-1"
716 IntOp $0 ${SF_SELECTED} | ${SF_RO}
717 SectionSetFlags ${SecDCzech} $0
718 SectionSetSize ${SecDCzech} 0
721 StrCpy $Search "cop_EG"
723 ${if} $Pointer != "-1"
724 IntOp $0 ${SF_SELECTED} | ${SF_RO}
725 # enable this for LyX 2.1!
726 # SectionSetFlags ${SecDCoptic} $0
727 # SectionSetSize ${SecDCoptic} 0
729 StrCpy $Search "cy_GB"
731 ${if} $Pointer != "-1"
732 IntOp $0 ${SF_SELECTED} | ${SF_RO}
733 SectionSetFlags ${SecDWelsh} $0
734 SectionSetSize ${SecDWelsh} 0
736 StrCpy $Search "da_DK"
738 ${if} $Pointer != "-1"
739 IntOp $0 ${SF_SELECTED} | ${SF_RO}
740 SectionSetFlags ${SecDDanish} $0
741 SectionSetSize ${SecDDanish} 0
743 StrCpy $Search "de_AT"
745 ${if} $Pointer != "-1"
746 IntOp $0 ${SF_SELECTED} | ${SF_RO}
747 SectionSetFlags ${SecDGermanAT} $0
748 SectionSetSize ${SecDGermanAT} 0
750 StrCpy $Search "de_CH"
752 ${if} $Pointer != "-1"
753 IntOp $0 ${SF_SELECTED} | ${SF_RO}
754 SectionSetFlags ${SecDGermanCH} $0
755 SectionSetSize ${SecDGermanCH} 0
757 StrCpy $Search "de_DE"
759 ${if} $Pointer != "-1"
760 IntOp $0 ${SF_SELECTED} | ${SF_RO}
761 SectionSetFlags ${SecDGermanD} $0
762 SectionSetSize ${SecDGermanD} 0
764 StrCpy $Search "el_GR"
766 ${if} $Pointer != "-1"
767 IntOp $0 ${SF_SELECTED} | ${SF_RO}
768 SectionSetFlags ${SecDGreek} $0
769 SectionSetSize ${SecDGreek} 0
771 StrCpy $Search "et_EE"
773 ${if} $Pointer != "-1"
774 IntOp $0 ${SF_SELECTED} | ${SF_RO}
775 SectionSetFlags ${SecDEstonian} $0
776 SectionSetSize ${SecDEstonian} 0
778 StrCpy $Search "en_AU"
780 ${if} $Pointer != "-1"
781 IntOp $0 ${SF_SELECTED} | ${SF_RO}
782 # enable this for LyX 2.1!
783 # SectionSetFlags ${SecDEnglishAU} $0
784 # SectionSetSize ${SecDEnglishAU} 0
786 StrCpy $Search "en_CA"
788 ${if} $Pointer != "-1"
789 IntOp $0 ${SF_SELECTED} | ${SF_RO}
790 SectionSetFlags ${SecDEnglishCA} $0
791 SectionSetSize ${SecDEnglishCA} 0
793 StrCpy $Search "en_GB"
795 ${if} $Pointer != "-1"
796 IntOp $0 ${SF_SELECTED} | ${SF_RO}
797 SectionSetFlags ${SecDEnglishGB} $0
798 SectionSetSize ${SecDEnglishGB} 0
800 StrCpy $Search "en_NZ"
802 ${if} $Pointer != "-1"
803 IntOp $0 ${SF_SELECTED} | ${SF_RO}
804 # enable this for LyX 2.1!
805 # SectionSetFlags ${SecDEnglishNZ} $0
806 # SectionSetSize ${SecDEnglishNZ} 0
808 StrCpy $Search "en_US"
810 ${if} $Pointer != "-1"
811 IntOp $0 ${SF_SELECTED} | ${SF_RO}
812 SectionSetFlags ${SecDEnglishUS} $0
813 SectionSetSize ${SecDEnglishUS} 0
815 StrCpy $Search "es_ES"
817 ${if} $Pointer != "-1"
818 IntOp $0 ${SF_SELECTED} | ${SF_RO}
819 SectionSetFlags ${SecDSpanishES} $0
820 SectionSetSize ${SecDSpanishES} 0
822 StrCpy $Search "es_MX"
824 ${if} $Pointer != "-1"
825 IntOp $0 ${SF_SELECTED} | ${SF_RO}
826 SectionSetFlags ${SecDSpanishMX} $0
827 SectionSetSize ${SecDSpanishMX} 0
829 StrCpy $Search "eo_EO"
831 ${if} $Pointer != "-1"
832 IntOp $0 ${SF_SELECTED} | ${SF_RO}
833 SectionSetFlags ${SecDEsperanto} $0
834 SectionSetSize ${SecDEsperanto} 0
836 StrCpy $Search "eu_ES"
838 ${if} $Pointer != "-1"
839 IntOp $0 ${SF_SELECTED} | ${SF_RO}
840 SectionSetFlags ${SecDBasque} $0
841 SectionSetSize ${SecDBasque} 0
843 StrCpy $Search "fa_IR"
845 ${if} $Pointer != "-1"
846 IntOp $0 ${SF_SELECTED} | ${SF_RO}
847 SectionSetFlags ${SecDFarsi} $0
848 SectionSetSize ${SecDFarsi} 0
850 StrCpy $Search "fr_FR"
852 ${if} $Pointer != "-1"
853 IntOp $0 ${SF_SELECTED} | ${SF_RO}
854 SectionSetFlags ${SecDFrench} $0
855 SectionSetSize ${SecDFrench} 0
857 StrCpy $Search "ga_IR"
859 ${if} $Pointer != "-1"
860 IntOp $0 ${SF_SELECTED} | ${SF_RO}
861 SectionSetFlags ${SecDGaelic} $0
862 SectionSetSize ${SecDGaelic} 0
864 StrCpy $Search "gd_GB"
866 ${if} $Pointer != "-1"
867 IntOp $0 ${SF_SELECTED} | ${SF_RO}
868 SectionSetFlags ${SecDScottish} $0
869 SectionSetSize ${SecDScottish} 0
871 StrCpy $Search "gl_ES"
873 ${if} $Pointer != "-1"
874 IntOp $0 ${SF_SELECTED} | ${SF_RO}
875 SectionSetFlags ${SecDGalician} $0
876 SectionSetSize ${SecDGalician} 0
878 StrCpy $Search "he_IL"
880 ${if} $Pointer != "-1"
881 IntOp $0 ${SF_SELECTED} | ${SF_RO}
882 SectionSetFlags ${SecDHebrew} $0
883 SectionSetSize ${SecDHebrew} 0
885 StrCpy $Search "hi_IN"
887 ${if} $Pointer != "-1"
888 IntOp $0 ${SF_SELECTED} | ${SF_RO}
889 # enable this for LyX 2.1!
890 # SectionSetFlags ${SecDHindi} $0
891 # SectionSetSize ${SecDHindi} 0
893 StrCpy $Search "hr_HR"
895 ${if} $Pointer != "-1"
896 IntOp $0 ${SF_SELECTED} | ${SF_RO}
897 SectionSetFlags ${SecDCroatian} $0
898 SectionSetSize ${SecDCroatian} 0
900 StrCpy $Search "hu_HU"
902 ${if} $Pointer != "-1"
903 IntOp $0 ${SF_SELECTED} | ${SF_RO}
904 SectionSetFlags ${SecDHungarian} $0
905 SectionSetSize ${SecDHungarian} 0
907 StrCpy $Search "ia_IA"
909 ${if} $Pointer != "-1"
910 IntOp $0 ${SF_SELECTED} | ${SF_RO}
911 SectionSetFlags ${SecDInterlingua} $0
912 SectionSetSize ${SecDInterlingua} 0
914 StrCpy $Search "is_IS"
916 ${if} $Pointer != "-1"
917 IntOp $0 ${SF_SELECTED} | ${SF_RO}
918 SectionSetFlags ${SecDIcelandic} $0
919 SectionSetSize ${SecDIcelandic} 0
921 StrCpy $Search "it_IT"
923 ${if} $Pointer != "-1"
924 IntOp $0 ${SF_SELECTED} | ${SF_RO}
925 SectionSetFlags ${SecDItalian} $0
926 SectionSetSize ${SecDItalian} 0
928 StrCpy $Search "kk_KZ"
930 ${if} $Pointer != "-1"
931 IntOp $0 ${SF_SELECTED} | ${SF_RO}
932 SectionSetFlags ${SecDKazakh} $0
933 SectionSetSize ${SecDKazakh} 0
935 StrCpy $Search "ko_KR"
937 ${if} $Pointer != "-1"
938 IntOp $0 ${SF_SELECTED} | ${SF_RO}
939 SectionSetFlags ${SecDKorean} $0
940 SectionSetSize ${SecDKorean} 0
942 StrCpy $Search "la_LA"
944 ${if} $Pointer != "-1"
945 IntOp $0 ${SF_SELECTED} | ${SF_RO}
946 SectionSetFlags ${SecDLatin} $0
947 SectionSetSize ${SecDLatin} 0
949 StrCpy $Search "lt_LT"
951 ${if} $Pointer != "-1"
952 IntOp $0 ${SF_SELECTED} | ${SF_RO}
953 SectionSetFlags ${SecDLithuanian} $0
954 SectionSetSize ${SecDLithuanian} 0
956 StrCpy $Search "lv_LV"
958 ${if} $Pointer != "-1"
959 IntOp $0 ${SF_SELECTED} | ${SF_RO}
960 SectionSetFlags ${SecDLatvian} $0
961 SectionSetSize ${SecDLatvian} 0
963 StrCpy $Search "nl_NL"
965 ${if} $Pointer != "-1"
966 IntOp $0 ${SF_SELECTED} | ${SF_RO}
967 SectionSetFlags ${SecDDutch} $0
968 SectionSetSize ${SecDDutch} 0
970 StrCpy $Search "nb_NO"
972 ${if} $Pointer != "-1"
973 IntOp $0 ${SF_SELECTED} | ${SF_RO}
974 SectionSetFlags ${SecDNorwegianNB} $0
975 SectionSetSize ${SecDNorwegianNB} 0
977 StrCpy $Search "nn_NO"
979 ${if} $Pointer != "-1"
980 IntOp $0 ${SF_SELECTED} | ${SF_RO}
981 SectionSetFlags ${SecDNorwegianNN} $0
982 SectionSetSize ${SecDNorwegianNN} 0
984 StrCpy $Search "oc_FR"
986 ${if} $Pointer != "-1"
987 IntOp $0 ${SF_SELECTED} | ${SF_RO}
988 # enable this for LyX 2.1!
989 # SectionSetFlags ${SecDOccitan} $0
990 # SectionSetSize ${SecDOccitan} 0
992 StrCpy $Search "pl_PL"
994 ${if} $Pointer != "-1"
995 IntOp $0 ${SF_SELECTED} | ${SF_RO}
996 SectionSetFlags ${SecDPolish} $0
997 SectionSetSize ${SecDPolish} 0
999 StrCpy $Search "pt_BR"
1001 ${if} $Pointer != "-1"
1002 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1003 SectionSetFlags ${SecDPortugueseBR} $0
1004 SectionSetSize ${SecDPortugueseBR} 0
1006 StrCpy $Search "pt_PT"
1008 ${if} $Pointer != "-1"
1009 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1010 SectionSetFlags ${SecDPortuguesePT} $0
1011 SectionSetSize ${SecDPortuguesePT} 0
1013 StrCpy $Search "ro_RO"
1015 ${if} $Pointer != "-1"
1016 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1017 SectionSetFlags ${SecDRomanian} $0
1018 SectionSetSize ${SecDRomanian} 0
1020 StrCpy $Search "ru_RU"
1022 ${if} $Pointer != "-1"
1023 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1024 SectionSetFlags ${SecDRussian} $0
1025 SectionSetSize ${SecDRussian} 0
1027 StrCpy $Search "dsb_DE"
1029 ${if} $Pointer != "-1"
1030 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1031 SectionSetFlags ${SecDSorbianD} $0
1032 SectionSetSize ${SecDSorbianD} 0
1034 StrCpy $Search "hsb_DE"
1036 ${if} $Pointer != "-1"
1037 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1038 SectionSetFlags ${SecDSorbianH} $0
1039 SectionSetSize ${SecDSorbianH} 0
1041 StrCpy $Search "sq_AL"
1043 ${if} $Pointer != "-1"
1044 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1045 SectionSetFlags ${SecDAlbanian} $0
1046 SectionSetSize ${SecDAlbanian} 0
1048 StrCpy $Search "sl_SI"
1050 ${if} $Pointer != "-1"
1051 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1052 SectionSetFlags ${SecDSlowenian} $0
1053 SectionSetSize ${SecDSlowenian} 0
1055 StrCpy $Search "sk_SK"
1057 ${if} $Pointer != "-1"
1058 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1059 SectionSetFlags ${SecDSlowakian} $0
1060 SectionSetSize ${SecDSlowakian} 0
1062 StrCpy $Search "sr_RS"
1064 ${if} $Pointer != "-1"
1065 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1066 SectionSetFlags ${SecDSerbian} $0
1067 SectionSetSize ${SecDSerbian} 0
1069 StrCpy $Search "sv_SE"
1071 ${if} $Pointer != "-1"
1072 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1073 SectionSetFlags ${SecDSwedish} $0
1074 SectionSetSize ${SecDSwedish} 0
1076 StrCpy $Search "ta_IN"
1078 ${if} $Pointer != "-1"
1079 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1080 # enable this for LyX 2.1!
1081 # SectionSetFlags ${SecDTamil} $0
1082 # SectionSetSize ${SecDTamil} 0
1084 StrCpy $Search "te_IN"
1086 ${if} $Pointer != "-1"
1087 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1088 # enable this for LyX 2.1!
1089 # SectionSetFlags ${SecDTelugu} $0
1090 # SectionSetSize ${SecDTelugu} 0
1092 StrCpy $Search "th_TH"
1094 ${if} $Pointer != "-1"
1095 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1096 SectionSetFlags ${SecDThai} $0
1097 SectionSetSize ${SecDThai} 0
1099 StrCpy $Search "uk_UA"
1101 ${if} $Pointer != "-1"
1102 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1103 SectionSetFlags ${SecDUkrainian} $0
1104 SectionSetSize ${SecDUkrainian} 0
1106 StrCpy $Search "ur_PK"
1108 ${if} $Pointer != "-1"
1109 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1110 # enable this for LyX 2.1!
1111 # SectionSetFlags ${SecDUrdu} $0
1112 # SectionSetSize ${SecDUrdu} 0
1114 StrCpy $Search "vi_VN"
1116 ${if} $Pointer != "-1"
1117 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1118 SectionSetFlags ${SecDVietnamese} $0
1119 SectionSetSize ${SecDVietnamese} 0
1122 # select sections of already installed thesaurus dictionaries, make them read-only
1123 # and set the necessary size to 0 bytes
1124 StrCpy $String $FoundThes
1125 StrCpy $Search "bg_BG"
1126 Call StrPoint # function from LyXUtils.nsh
1127 ${if} $Pointer != "-1"
1128 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1129 SectionSetFlags ${SecTBulgarian} $0
1130 SectionSetSize ${SecTBulgarian} 0
1132 StrCpy $Search "ca_ES"
1134 ${if} $Pointer != "-1"
1135 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1136 SectionSetFlags ${SecTCatalan} $0
1137 SectionSetSize ${SecTCatalan} 0
1139 StrCpy $Search "cs_CZ"
1141 ${if} $Pointer != "-1"
1142 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1143 SectionSetFlags ${SecTCzech} $0
1144 SectionSetSize ${SecTCzech} 0
1146 StrCpy $Search "da_DK"
1148 ${if} $Pointer != "-1"
1149 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1150 SectionSetFlags ${SecTDanish} $0
1151 SectionSetSize ${SecTDanish} 0
1153 StrCpy $Search "de_DE"
1155 ${if} $Pointer != "-1"
1156 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1157 SectionSetFlags ${SecTGermanDA} $0
1158 SectionSetSize ${SecTGermanDA} 0
1160 StrCpy $Search "de_CH"
1162 ${if} $Pointer != "-1"
1163 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1164 SectionSetFlags ${SecTGermanCH} $0
1165 SectionSetSize ${SecTGermanCH} 0
1167 StrCpy $Search "en_GB"
1169 ${if} $Pointer != "-1"
1170 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1171 SectionSetFlags ${SecTEnglishGB} $0
1172 SectionSetSize ${SecTEnglishGB} 0
1174 StrCpy $Search "en_US"
1176 ${if} $Pointer != "-1"
1177 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1178 SectionSetFlags ${SecTEnglishUSAU} $0
1179 SectionSetSize ${SecTEnglishUSAU} 0
1181 StrCpy $Search "es_ES"
1183 ${if} $Pointer != "-1"
1184 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1185 SectionSetFlags ${SecTSpanish} $0
1186 SectionSetSize ${SecTSpanish} 0
1188 StrCpy $Search "fr_FR"
1190 ${if} $Pointer != "-1"
1191 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1192 SectionSetFlags ${SecTFrench} $0
1193 SectionSetSize ${SecTFrench} 0
1195 StrCpy $Search "ga_IR"
1197 ${if} $Pointer != "-1"
1198 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1199 SectionSetFlags ${SecTGaelic} $0
1200 SectionSetSize ${SecTGaelic} 0
1202 StrCpy $Search "el_GR"
1204 ${if} $Pointer != "-1"
1205 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1206 SectionSetFlags ${SecTGreek} $0
1207 SectionSetSize ${SecTGreek} 0
1209 StrCpy $Search "it_IT"
1211 ${if} $Pointer != "-1"
1212 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1213 SectionSetFlags ${SecTItalian} $0
1214 SectionSetSize ${SecTItalian} 0
1216 StrCpy $Search "hu_HU"
1218 ${if} $Pointer != "-1"
1219 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1220 SectionSetFlags ${SecTHungarian} $0
1221 SectionSetSize ${SecTHungarian} 0
1223 StrCpy $Search "no_NO"
1225 ${if} $Pointer != "-1"
1226 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1227 SectionSetFlags ${SecTNorwegian} $0
1228 SectionSetSize ${SecTNorwegian} 0
1230 StrCpy $Search "pl_PL"
1232 ${if} $Pointer != "-1"
1233 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1234 SectionSetFlags ${SecTPolish} $0
1235 SectionSetSize ${SecTPolish} 0
1237 StrCpy $Search "pt_PT"
1239 ${if} $Pointer != "-1"
1240 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1241 SectionSetFlags ${SecTPortuguese} $0
1242 SectionSetSize ${SecTPortuguese} 0
1244 StrCpy $Search "ro_RO"
1246 ${if} $Pointer != "-1"
1247 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1248 SectionSetFlags ${SecTRomanian} $0
1249 SectionSetSize ${SecTRomanian} 0
1251 StrCpy $Search "ru_RU"
1253 ${if} $Pointer != "-1"
1254 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1255 SectionSetFlags ${SecTRussian} $0
1256 SectionSetSize ${SecTRussian} 0
1258 StrCpy $Search "sl_SI"
1260 ${if} $Pointer != "-1"
1261 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1262 SectionSetFlags ${SecTSlowenian} $0
1263 SectionSetSize ${SecTSlowenian} 0
1265 StrCpy $Search "sk_SK"
1267 ${if} $Pointer != "-1"
1268 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1269 SectionSetFlags ${SecTSlowakian} $0
1270 SectionSetSize ${SecTSlowakian} 0
1272 StrCpy $Search "sv_SE"
1274 ${if} $Pointer != "-1"
1275 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1276 SectionSetFlags ${SecTSwedish} $0
1277 SectionSetSize ${SecTSwedish} 0
1286 # this function is called at first after starting the uninstaller
1289 !insertmacro PRINTER_INIT
1290 !insertmacro MULTIUSER_UNINIT
1292 # Check that LyX is not currently running
1293 FindProcDLL::FindProc "lyx.exe"
1295 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1299 # set registry root key
1300 ${if} $MultiUser.Privileges == "Admin"
1301 ${orif} $MultiUser.Privileges == "Power"
1302 SetShellVarContext all
1304 SetShellVarContext current
1307 # Ascertain whether the user has sufficient privileges to uninstall.
1308 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1309 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1311 ${andif} $MultiUser.Privileges != "Admin"
1312 ${andif} $MultiUser.Privileges != "Power"
1313 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1316 # warning when LyX couldn't be found in the registry
1317 ${if} $0 == "" # check in HKCU
1318 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1320 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1324 # Macro to investigate name of LyX's preferences folders to be able remove them
1325 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1327 # test if MiKTeX was installed together with LyX
1328 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1329 ${if} $0 == "Yes${APP_SERIES_KEY}"
1330 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1331 StrCpy $LaTeXInstalled "MiKTeX"
1333 SectionSetText 2 "" # hides the corresponding uninstaller section
1336 # test if JabRef was installed together with LyX
1337 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1338 ${if} $0 == "Yes${APP_SERIES_KEY}"
1339 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1340 StrCpy $JabRefInstalled "Yes"
1342 SectionSetText 3 "" # hides the corresponding uninstaller section
1345 # question message if the user really wants to uninstall LyX
1346 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes