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 # enable this for LyX 2.1!
122 #Section /o "Coptic" SecDCoptic
123 # StrCpy $DictCodes "cop_EG,$DictCodes"
127 Section /o "Cymraeg" SecDWelsh
128 StrCpy $DictCodes "cy_GB,$DictCodes"
132 Section /o "Dansk" SecDDanish
133 StrCpy $DictCodes "da_DK,$DictCodes"
137 Section /o "German (A)" SecDGermanAT
138 StrCpy $DictCodes "de_AT,$DictCodes"
142 Section /o "German (CH)" SecDGermanCH
143 StrCpy $DictCodes "de_CH,$DictCodes"
147 Section "German (D)" SecDGermanD
148 # already installed by default
150 #StrCpy $DictCodes "de_DE,$DictCodes"
154 Section /o "Greek" SecDGreek
155 StrCpy $DictCodes "el_GR,$DictCodes"
159 Section /o "Eesti" SecDEstonian
160 StrCpy $DictCodes "et_EE,$DictCodes"
164 # enable this for LyX 2.1!
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 # enable this for LyX 2.1!
183 #Section /o "English (NZ)" SecDEnglishNZ
184 # StrCpy $DictCodes "en_NZ,$DictCodes"
188 Section "English (US)" SecDEnglishUS
189 # already installed by default
191 #StrCpy $DictCodes "en_US,$DictCodes"
195 Section "Español (ES)" SecDSpanishES
196 # already installed by default
198 #StrCpy $DictCodes "es_ES,$DictCodes"
202 Section "Español (MX)" SecDSpanishMX
203 # already installed by default
205 #StrCpy $DictCodes "es_MX,$DictCodes"
209 Section /o "Esperanto" SecDEsperanto
210 StrCpy $DictCodes "eo_EO,$DictCodes"
214 Section /o "Euskara" SecDBasque
215 StrCpy $DictCodes "eu_ES,$DictCodes"
219 Section /o "Farsi" SecDFarsi
220 StrCpy $DictCodes "fa_IR,$DictCodes"
224 Section "Français" SecDFrench
225 # already installed by default
227 #StrCpy $DictCodes "fr_FR,$DictCodes"
231 Section /o "Gaeilge" SecDGaelic
232 StrCpy $DictCodes "ga_IR,$DictCodes"
236 Section /o "Gàidhlig" SecDScottish
237 StrCpy $DictCodes "gd_GB,$DictCodes"
241 Section /o "Galego" SecDGalician
242 StrCpy $DictCodes "gl_ES,$DictCodes"
246 Section /o "Hebrew" SecDHebrew
247 StrCpy $DictCodes "he_IL,$DictCodes"
251 Section /o "Hrvatski" SecDCroatian
252 StrCpy $DictCodes "hr_HR,$DictCodes"
256 Section /o "Magyar" SecDHungarian
257 StrCpy $DictCodes "hu_HU,$DictCodes"
261 # enable this for LyX 2.1!
262 #Section /o "Hindi" SecDHindi
263 # StrCpy $DictCodes "hi_IN,$DictCodes"
267 Section /o "Interlingua" SecDInterlingua
268 StrCpy $DictCodes "ia_IA,$DictCodes"
272 Section /o "Íslenska" SecDIcelandic
273 StrCpy $DictCodes "is_IS,$DictCodes"
277 Section /o "Italiano" SecDItalian
278 StrCpy $DictCodes "it_IT,$DictCodes"
282 Section /o "Kazakh" SecDKazakh
283 StrCpy $DictCodes "kk_KZ,$DictCodes"
287 Section /o "Korean" SecDKorean
288 StrCpy $DictCodes "ko_KR,$DictCodes"
292 Section /o "Latina" SecDLatin
293 StrCpy $DictCodes "la_LA,$DictCodes"
297 Section /o "Lietuviu" SecDLithuanian
298 StrCpy $DictCodes "lt_LT,$DictCodes"
302 Section /o "Latvie
\9au" SecDLatvian
303 StrCpy $DictCodes "lv_LV,$DictCodes"
307 Section /o "Nederlands" SecDDutch
308 StrCpy $DictCodes "nl_NL,$DictCodes"
312 Section /o "Norsk (Bokmål)" SecDNorwegianNB
313 StrCpy $DictCodes "nb_NO,$DictCodes"
317 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
318 StrCpy $DictCodes "nn_NO,$DictCodes"
322 # enable this for LyX 2.1!
323 #Section /o "Occitan" SecDOccitan
324 # StrCpy $DictCodes "oc_FR,$DictCodes"
328 Section /o "Polski" SecDPolish
329 StrCpy $DictCodes "pl_PL,$DictCodes"
333 Section /o "Português (BR)" SecDPortugueseBR
334 StrCpy $DictCodes "pt_BR,$DictCodes"
338 Section /o "Português (PT)" SecDPortuguesePT
339 StrCpy $DictCodes "pt_PT,$DictCodes"
343 Section /o "Româna" SecDRomanian
344 StrCpy $DictCodes "ro_RO,$DictCodes"
348 Section /o "Russian" SecDRussian
349 StrCpy $DictCodes "ru_RU,$DictCodes"
353 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
354 StrCpy $DictCodes "dsb_DE,$DictCodes"
358 Section /o "Serb
\9acina (Horno)" SecDSorbianH
359 StrCpy $DictCodes "hsb_DE,$DictCodes"
363 Section /o "Shqipe" SecDAlbanian
364 StrCpy $DictCodes "sq_AL,$DictCodes"
368 Section /o "Sloven
\9acina" SecDSlovenian
369 StrCpy $DictCodes "sl_SI,$DictCodes"
373 Section /o "Slovenský" SecDSlovakian
374 StrCpy $DictCodes "sk_SK,$DictCodes"
378 Section /o "Srpski" SecDSerbian
379 StrCpy $DictCodes "sr_RS,$DictCodes"
383 Section /o "Svenska" SecDSwedish
384 StrCpy $DictCodes "sv_SE,$DictCodes"
388 # enable this for LyX 2.1!
389 #Section /o "Tamil" SecDTamil
390 # StrCpy $DictCodes "ta_IN,$DictCodes"
394 # enable this for LyX 2.1!
395 #Section /o "Telugu" SecDTelugu
396 # StrCpy $DictCodes "te_IN,$DictCodes"
400 Section /o "Thai" SecDThai
401 StrCpy $DictCodes "th_TH,$DictCodes"
405 Section /o "Ukrainian" SecDUkrainian
406 StrCpy $DictCodes "uk_UA,$DictCodes"
410 # enable this for LyX 2.1!
411 #Section /o "Urdu" SecDUrdu
412 # StrCpy $DictCodes "ur_PK,$DictCodes"
416 Section /o "Vietnamese" SecDVietnamese
417 StrCpy $DictCodes "vi_VN,$DictCodes"
424 SectionGroup "Thesaurus" SecThesaurus
426 Section /o "Bulgarian" SecTBulgarian
427 StrCpy $ThesCodes "bg_BG,$ThesCodes"
431 Section /o "Català" SecTCatalan
432 StrCpy $ThesCodes "ca_ES,$ThesCodes"
436 Section /o "Ce
\9atina" SecTCzech
437 StrCpy $ThesCodes "cs_CZ,$ThesCodes"
441 Section /o "Dansk" SecTDanish
442 StrCpy $ThesCodes "da_DK,$ThesCodes"
446 Section /o "Deutsch (D/A)" SecTGermanDA
447 StrCpy $ThesCodes "de_DE,$ThesCodes"
451 Section /o "Deutsch (CH)" SecTGermanCH
452 StrCpy $ThesCodes "de_CH,$ThesCodes"
456 Section /o "English (GB)" SecTEnglishGB
457 StrCpy $ThesCodes "en_GB,$ThesCodes"
461 Section /o "English (US/AU)" SecTEnglishUSAU
462 StrCpy $ThesCodes "en_US,$ThesCodes"
466 Section /o "Español" SecTSpanish
467 StrCpy $ThesCodes "es_ES,$ThesCodes"
471 Section /o "Français" SecTFrench
472 StrCpy $ThesCodes "fr_FR,$ThesCodes"
476 Section /o "Gaeilge" SecTGaelic
477 StrCpy $ThesCodes "ga_IR,$ThesCodes"
481 Section /o "Greek" SecTGreek
482 StrCpy $ThesCodes "el_GR,$ThesCodes"
486 Section /o "Italiano" SecTItalian
487 StrCpy $ThesCodes "it_IT,$ThesCodes"
491 Section /o "Magyar" SecTHungarian
492 StrCpy $ThesCodes "hu_HU,$ThesCodes"
496 Section /o "Norsk" SecTNorwegian
497 StrCpy $ThesCodes "no_NO,$ThesCodes"
501 Section /o "Polski" SecTPolish
502 StrCpy $ThesCodes "pl_PL,$ThesCodes"
506 Section /o "Português" SecTPortuguese
507 StrCpy $ThesCodes "pt_PT,$ThesCodes"
511 Section /o "Româna" SecTRomanian
512 StrCpy $ThesCodes "ro_RO,$ThesCodes"
516 Section /o "Russian" SecTRussian
517 StrCpy $ThesCodes "ru_RU,$ThesCodes"
521 Section /o "Sloven
\9acina" SecTSlovenian
522 StrCpy $ThesCodes "sl_SI,$ThesCodes"
526 Section /o "Slovenský" SecTSlovakian
527 StrCpy $ThesCodes "sk_SK,$ThesCodes"
531 Section /o "Svenska" SecTSwedish
532 StrCpy $ThesCodes "sv_SE,$ThesCodes"
538 # Section descriptions
539 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
540 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
541 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
542 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
543 !if ${SETUPTYPE} == BUNDLE
544 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
546 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
547 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
548 !insertmacro MUI_FUNCTION_DESCRIPTION_END
551 #--------------------------------
552 # Installer initialization
556 ${If} ${AtLeastWinVista}
557 StrCpy $PrinterConf "printui.exe"
559 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
564 # .onInit must be here after the section definition because we have to set
565 # the selection states of the dictionary sections
569 ${OrIfNot} ${AtLeastWinXP}
570 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
574 # check that the installer is not currently running
575 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
578 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
581 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
584 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
588 !insertmacro MULTIUSER_INIT
590 # check if this LyX version is already installed
591 ${if} $MultiUser.Privileges == "Admin"
592 ${orif} $MultiUser.Privileges == "Power"
593 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
595 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
596 # handle also the case that LyX is already installed in HKLM
598 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
602 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
606 # check if there is an existing LyX installation of the same LyX series
607 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
608 IntOp $4 ${APP_VERSION_REVISION} + 20
610 ${if} $MultiUser.Privileges == "Admin"
611 ${orif} $MultiUser.Privileges == "Power"
612 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
614 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
617 StrCpy $R5 $0 # store the read version number
618 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
619 # we don't stop here because we want the latest installed version
622 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
623 # store the version number and reformat it temporarily for the error message
624 StrCpy $R0 $OldVersionNumber
625 StrCpy $OldVersionNumber $R5
626 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
627 StrCpy $OldVersionNumber $R0
631 !insertmacro PRINTER_INIT
633 # this can be reset to "true" in section SecDesktop
634 StrCpy $CreateDesktopIcon "false"
635 StrCpy $CreateFileAssociations "false"
638 # Show banner while installer is intializating
639 Banner::show /NOUNLOAD "Checking system"
644 !if ${SETUPTYPE} == BUNDLE
645 # don't let the installer sections appear when the programs are already installed
646 ${if} $PathBibTeXEditor != ""
647 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
651 # select sections of already installed spell-checker dictionaries, make them read-only
652 # and set the necessary size to 0 bytes
653 StrCpy $String $FoundDict
654 StrCpy $Search "af_ZA"
655 Call StrPoint # function from LyXUtils.nsh
656 ${if} $Pointer != "-1"
657 IntOp $0 ${SF_SELECTED} | ${SF_RO}
658 SectionSetFlags ${SecDAfrikaans} $0
659 SectionSetSize ${SecDAfrikaans} 0
661 StrCpy $Search "ar_DZ"
663 ${if} $Pointer != "-1"
664 IntOp $0 ${SF_SELECTED} | ${SF_RO}
665 SectionSetFlags ${SecDArabic} $0
666 SectionSetSize ${SecDArabic} 0
668 StrCpy $Search "hy_AM"
670 ${if} $Pointer != "-1"
671 IntOp $0 ${SF_SELECTED} | ${SF_RO}
672 SectionSetFlags ${SecDArmenian} $0
673 SectionSetSize ${SecDArmenian} 0
675 StrCpy $Search "id_ID"
677 ${if} $Pointer != "-1"
678 IntOp $0 ${SF_SELECTED} | ${SF_RO}
679 SectionSetFlags ${SecDIndonesian} $0
680 SectionSetSize ${SecDIndonesian} 0
682 StrCpy $Search "ms_MY"
684 ${if} $Pointer != "-1"
685 IntOp $0 ${SF_SELECTED} | ${SF_RO}
686 SectionSetFlags ${SecDMalayan} $0
687 SectionSetSize ${SecDMalayan} 0
689 StrCpy $Search "be_BY"
691 ${if} $Pointer != "-1"
692 IntOp $0 ${SF_SELECTED} | ${SF_RO}
693 SectionSetFlags ${SecDBelarusian} $0
694 SectionSetSize ${SecDBelarusian} 0
696 StrCpy $Search "br_FR"
698 ${if} $Pointer != "-1"
699 IntOp $0 ${SF_SELECTED} | ${SF_RO}
700 SectionSetFlags ${SecDBreton} $0
701 SectionSetSize ${SecDBreton} 0
703 StrCpy $Search "bg_BG"
705 ${if} $Pointer != "-1"
706 IntOp $0 ${SF_SELECTED} | ${SF_RO}
707 SectionSetFlags ${SecDBulgarian} $0
708 SectionSetSize ${SecDBulgarian} 0
710 StrCpy $Search "ca_ES"
712 ${if} $Pointer != "-1"
713 IntOp $0 ${SF_SELECTED} | ${SF_RO}
714 SectionSetFlags ${SecDCatalanian} $0
715 SectionSetSize ${SecDCatalanian} 0
717 StrCpy $Search "cs_CZ"
719 ${if} $Pointer != "-1"
720 IntOp $0 ${SF_SELECTED} | ${SF_RO}
721 SectionSetFlags ${SecDCzech} $0
722 SectionSetSize ${SecDCzech} 0
725 StrCpy $Search "cop_EG"
727 ${if} $Pointer != "-1"
728 IntOp $0 ${SF_SELECTED} | ${SF_RO}
729 # enable this for LyX 2.1!
730 # SectionSetFlags ${SecDCoptic} $0
731 # SectionSetSize ${SecDCoptic} 0
733 StrCpy $Search "cy_GB"
735 ${if} $Pointer != "-1"
736 IntOp $0 ${SF_SELECTED} | ${SF_RO}
737 SectionSetFlags ${SecDWelsh} $0
738 SectionSetSize ${SecDWelsh} 0
740 StrCpy $Search "da_DK"
742 ${if} $Pointer != "-1"
743 IntOp $0 ${SF_SELECTED} | ${SF_RO}
744 SectionSetFlags ${SecDDanish} $0
745 SectionSetSize ${SecDDanish} 0
747 StrCpy $Search "de_AT"
749 ${if} $Pointer != "-1"
750 IntOp $0 ${SF_SELECTED} | ${SF_RO}
751 SectionSetFlags ${SecDGermanAT} $0
752 SectionSetSize ${SecDGermanAT} 0
754 StrCpy $Search "de_CH"
756 ${if} $Pointer != "-1"
757 IntOp $0 ${SF_SELECTED} | ${SF_RO}
758 SectionSetFlags ${SecDGermanCH} $0
759 SectionSetSize ${SecDGermanCH} 0
761 StrCpy $Search "de_DE"
763 ${if} $Pointer != "-1"
764 IntOp $0 ${SF_SELECTED} | ${SF_RO}
765 SectionSetFlags ${SecDGermanD} $0
766 SectionSetSize ${SecDGermanD} 0
768 StrCpy $Search "el_GR"
770 ${if} $Pointer != "-1"
771 IntOp $0 ${SF_SELECTED} | ${SF_RO}
772 SectionSetFlags ${SecDGreek} $0
773 SectionSetSize ${SecDGreek} 0
775 StrCpy $Search "et_EE"
777 ${if} $Pointer != "-1"
778 IntOp $0 ${SF_SELECTED} | ${SF_RO}
779 SectionSetFlags ${SecDEstonian} $0
780 SectionSetSize ${SecDEstonian} 0
782 StrCpy $Search "en_AU"
784 ${if} $Pointer != "-1"
785 IntOp $0 ${SF_SELECTED} | ${SF_RO}
786 # enable this for LyX 2.1!
787 # SectionSetFlags ${SecDEnglishAU} $0
788 # SectionSetSize ${SecDEnglishAU} 0
790 StrCpy $Search "en_CA"
792 ${if} $Pointer != "-1"
793 IntOp $0 ${SF_SELECTED} | ${SF_RO}
794 SectionSetFlags ${SecDEnglishCA} $0
795 SectionSetSize ${SecDEnglishCA} 0
797 StrCpy $Search "en_GB"
799 ${if} $Pointer != "-1"
800 IntOp $0 ${SF_SELECTED} | ${SF_RO}
801 SectionSetFlags ${SecDEnglishGB} $0
802 SectionSetSize ${SecDEnglishGB} 0
804 StrCpy $Search "en_NZ"
806 ${if} $Pointer != "-1"
807 IntOp $0 ${SF_SELECTED} | ${SF_RO}
808 # enable this for LyX 2.1!
809 # SectionSetFlags ${SecDEnglishNZ} $0
810 # SectionSetSize ${SecDEnglishNZ} 0
812 StrCpy $Search "en_US"
814 ${if} $Pointer != "-1"
815 IntOp $0 ${SF_SELECTED} | ${SF_RO}
816 SectionSetFlags ${SecDEnglishUS} $0
817 SectionSetSize ${SecDEnglishUS} 0
819 StrCpy $Search "es_ES"
821 ${if} $Pointer != "-1"
822 IntOp $0 ${SF_SELECTED} | ${SF_RO}
823 SectionSetFlags ${SecDSpanishES} $0
824 SectionSetSize ${SecDSpanishES} 0
826 StrCpy $Search "es_MX"
828 ${if} $Pointer != "-1"
829 IntOp $0 ${SF_SELECTED} | ${SF_RO}
830 SectionSetFlags ${SecDSpanishMX} $0
831 SectionSetSize ${SecDSpanishMX} 0
833 StrCpy $Search "eo_EO"
835 ${if} $Pointer != "-1"
836 IntOp $0 ${SF_SELECTED} | ${SF_RO}
837 SectionSetFlags ${SecDEsperanto} $0
838 SectionSetSize ${SecDEsperanto} 0
840 StrCpy $Search "eu_ES"
842 ${if} $Pointer != "-1"
843 IntOp $0 ${SF_SELECTED} | ${SF_RO}
844 SectionSetFlags ${SecDBasque} $0
845 SectionSetSize ${SecDBasque} 0
847 StrCpy $Search "fa_IR"
849 ${if} $Pointer != "-1"
850 IntOp $0 ${SF_SELECTED} | ${SF_RO}
851 SectionSetFlags ${SecDFarsi} $0
852 SectionSetSize ${SecDFarsi} 0
854 StrCpy $Search "fr_FR"
856 ${if} $Pointer != "-1"
857 IntOp $0 ${SF_SELECTED} | ${SF_RO}
858 SectionSetFlags ${SecDFrench} $0
859 SectionSetSize ${SecDFrench} 0
861 StrCpy $Search "ga_IR"
863 ${if} $Pointer != "-1"
864 IntOp $0 ${SF_SELECTED} | ${SF_RO}
865 SectionSetFlags ${SecDGaelic} $0
866 SectionSetSize ${SecDGaelic} 0
868 StrCpy $Search "gd_GB"
870 ${if} $Pointer != "-1"
871 IntOp $0 ${SF_SELECTED} | ${SF_RO}
872 SectionSetFlags ${SecDScottish} $0
873 SectionSetSize ${SecDScottish} 0
875 StrCpy $Search "gl_ES"
877 ${if} $Pointer != "-1"
878 IntOp $0 ${SF_SELECTED} | ${SF_RO}
879 SectionSetFlags ${SecDGalician} $0
880 SectionSetSize ${SecDGalician} 0
882 StrCpy $Search "he_IL"
884 ${if} $Pointer != "-1"
885 IntOp $0 ${SF_SELECTED} | ${SF_RO}
886 SectionSetFlags ${SecDHebrew} $0
887 SectionSetSize ${SecDHebrew} 0
889 StrCpy $Search "hi_IN"
891 ${if} $Pointer != "-1"
892 IntOp $0 ${SF_SELECTED} | ${SF_RO}
893 # enable this for LyX 2.1!
894 # SectionSetFlags ${SecDHindi} $0
895 # SectionSetSize ${SecDHindi} 0
897 StrCpy $Search "hr_HR"
899 ${if} $Pointer != "-1"
900 IntOp $0 ${SF_SELECTED} | ${SF_RO}
901 SectionSetFlags ${SecDCroatian} $0
902 SectionSetSize ${SecDCroatian} 0
904 StrCpy $Search "hu_HU"
906 ${if} $Pointer != "-1"
907 IntOp $0 ${SF_SELECTED} | ${SF_RO}
908 SectionSetFlags ${SecDHungarian} $0
909 SectionSetSize ${SecDHungarian} 0
911 StrCpy $Search "ia_IA"
913 ${if} $Pointer != "-1"
914 IntOp $0 ${SF_SELECTED} | ${SF_RO}
915 SectionSetFlags ${SecDInterlingua} $0
916 SectionSetSize ${SecDInterlingua} 0
918 StrCpy $Search "is_IS"
920 ${if} $Pointer != "-1"
921 IntOp $0 ${SF_SELECTED} | ${SF_RO}
922 SectionSetFlags ${SecDIcelandic} $0
923 SectionSetSize ${SecDIcelandic} 0
925 StrCpy $Search "it_IT"
927 ${if} $Pointer != "-1"
928 IntOp $0 ${SF_SELECTED} | ${SF_RO}
929 SectionSetFlags ${SecDItalian} $0
930 SectionSetSize ${SecDItalian} 0
932 StrCpy $Search "kk_KZ"
934 ${if} $Pointer != "-1"
935 IntOp $0 ${SF_SELECTED} | ${SF_RO}
936 SectionSetFlags ${SecDKazakh} $0
937 SectionSetSize ${SecDKazakh} 0
939 StrCpy $Search "ko_KR"
941 ${if} $Pointer != "-1"
942 IntOp $0 ${SF_SELECTED} | ${SF_RO}
943 SectionSetFlags ${SecDKorean} $0
944 SectionSetSize ${SecDKorean} 0
946 StrCpy $Search "la_LA"
948 ${if} $Pointer != "-1"
949 IntOp $0 ${SF_SELECTED} | ${SF_RO}
950 SectionSetFlags ${SecDLatin} $0
951 SectionSetSize ${SecDLatin} 0
953 StrCpy $Search "lt_LT"
955 ${if} $Pointer != "-1"
956 IntOp $0 ${SF_SELECTED} | ${SF_RO}
957 SectionSetFlags ${SecDLithuanian} $0
958 SectionSetSize ${SecDLithuanian} 0
960 StrCpy $Search "lv_LV"
962 ${if} $Pointer != "-1"
963 IntOp $0 ${SF_SELECTED} | ${SF_RO}
964 SectionSetFlags ${SecDLatvian} $0
965 SectionSetSize ${SecDLatvian} 0
967 StrCpy $Search "nl_NL"
969 ${if} $Pointer != "-1"
970 IntOp $0 ${SF_SELECTED} | ${SF_RO}
971 SectionSetFlags ${SecDDutch} $0
972 SectionSetSize ${SecDDutch} 0
974 StrCpy $Search "nb_NO"
976 ${if} $Pointer != "-1"
977 IntOp $0 ${SF_SELECTED} | ${SF_RO}
978 SectionSetFlags ${SecDNorwegianNB} $0
979 SectionSetSize ${SecDNorwegianNB} 0
981 StrCpy $Search "nn_NO"
983 ${if} $Pointer != "-1"
984 IntOp $0 ${SF_SELECTED} | ${SF_RO}
985 SectionSetFlags ${SecDNorwegianNN} $0
986 SectionSetSize ${SecDNorwegianNN} 0
988 StrCpy $Search "oc_FR"
990 ${if} $Pointer != "-1"
991 IntOp $0 ${SF_SELECTED} | ${SF_RO}
992 # enable this for LyX 2.1!
993 # SectionSetFlags ${SecDOccitan} $0
994 # SectionSetSize ${SecDOccitan} 0
996 StrCpy $Search "pl_PL"
998 ${if} $Pointer != "-1"
999 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1000 SectionSetFlags ${SecDPolish} $0
1001 SectionSetSize ${SecDPolish} 0
1003 StrCpy $Search "pt_BR"
1005 ${if} $Pointer != "-1"
1006 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1007 SectionSetFlags ${SecDPortugueseBR} $0
1008 SectionSetSize ${SecDPortugueseBR} 0
1010 StrCpy $Search "pt_PT"
1012 ${if} $Pointer != "-1"
1013 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1014 SectionSetFlags ${SecDPortuguesePT} $0
1015 SectionSetSize ${SecDPortuguesePT} 0
1017 StrCpy $Search "ro_RO"
1019 ${if} $Pointer != "-1"
1020 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1021 SectionSetFlags ${SecDRomanian} $0
1022 SectionSetSize ${SecDRomanian} 0
1024 StrCpy $Search "ru_RU"
1026 ${if} $Pointer != "-1"
1027 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1028 SectionSetFlags ${SecDRussian} $0
1029 SectionSetSize ${SecDRussian} 0
1031 StrCpy $Search "dsb_DE"
1033 ${if} $Pointer != "-1"
1034 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1035 SectionSetFlags ${SecDSorbianD} $0
1036 SectionSetSize ${SecDSorbianD} 0
1038 StrCpy $Search "hsb_DE"
1040 ${if} $Pointer != "-1"
1041 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1042 SectionSetFlags ${SecDSorbianH} $0
1043 SectionSetSize ${SecDSorbianH} 0
1045 StrCpy $Search "sq_AL"
1047 ${if} $Pointer != "-1"
1048 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1049 SectionSetFlags ${SecDAlbanian} $0
1050 SectionSetSize ${SecDAlbanian} 0
1052 StrCpy $Search "sl_SI"
1054 ${if} $Pointer != "-1"
1055 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1056 SectionSetFlags ${SecDSlovenian} $0
1057 SectionSetSize ${SecDSlovenian} 0
1059 StrCpy $Search "sk_SK"
1061 ${if} $Pointer != "-1"
1062 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1063 SectionSetFlags ${SecDSlovakian} $0
1064 SectionSetSize ${SecDSlovakian} 0
1066 StrCpy $Search "sr_RS"
1068 ${if} $Pointer != "-1"
1069 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1070 SectionSetFlags ${SecDSerbian} $0
1071 SectionSetSize ${SecDSerbian} 0
1073 StrCpy $Search "sv_SE"
1075 ${if} $Pointer != "-1"
1076 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1077 SectionSetFlags ${SecDSwedish} $0
1078 SectionSetSize ${SecDSwedish} 0
1080 StrCpy $Search "ta_IN"
1082 ${if} $Pointer != "-1"
1083 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1084 # enable this for LyX 2.1!
1085 # SectionSetFlags ${SecDTamil} $0
1086 # SectionSetSize ${SecDTamil} 0
1088 StrCpy $Search "te_IN"
1090 ${if} $Pointer != "-1"
1091 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1092 # enable this for LyX 2.1!
1093 # SectionSetFlags ${SecDTelugu} $0
1094 # SectionSetSize ${SecDTelugu} 0
1096 StrCpy $Search "th_TH"
1098 ${if} $Pointer != "-1"
1099 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1100 SectionSetFlags ${SecDThai} $0
1101 SectionSetSize ${SecDThai} 0
1103 StrCpy $Search "uk_UA"
1105 ${if} $Pointer != "-1"
1106 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1107 SectionSetFlags ${SecDUkrainian} $0
1108 SectionSetSize ${SecDUkrainian} 0
1110 StrCpy $Search "ur_PK"
1112 ${if} $Pointer != "-1"
1113 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1114 # enable this for LyX 2.1!
1115 # SectionSetFlags ${SecDUrdu} $0
1116 # SectionSetSize ${SecDUrdu} 0
1118 StrCpy $Search "vi_VN"
1120 ${if} $Pointer != "-1"
1121 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1122 SectionSetFlags ${SecDVietnamese} $0
1123 SectionSetSize ${SecDVietnamese} 0
1126 # select sections of already installed thesaurus dictionaries, make them read-only
1127 # and set the necessary size to 0 bytes
1128 StrCpy $String $FoundThes
1129 StrCpy $Search "bg_BG"
1130 Call StrPoint # function from LyXUtils.nsh
1131 ${if} $Pointer != "-1"
1132 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1133 SectionSetFlags ${SecTBulgarian} $0
1134 SectionSetSize ${SecTBulgarian} 0
1136 StrCpy $Search "ca_ES"
1138 ${if} $Pointer != "-1"
1139 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1140 SectionSetFlags ${SecTCatalan} $0
1141 SectionSetSize ${SecTCatalan} 0
1143 StrCpy $Search "cs_CZ"
1145 ${if} $Pointer != "-1"
1146 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1147 SectionSetFlags ${SecTCzech} $0
1148 SectionSetSize ${SecTCzech} 0
1150 StrCpy $Search "da_DK"
1152 ${if} $Pointer != "-1"
1153 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1154 SectionSetFlags ${SecTDanish} $0
1155 SectionSetSize ${SecTDanish} 0
1157 StrCpy $Search "de_DE"
1159 ${if} $Pointer != "-1"
1160 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1161 SectionSetFlags ${SecTGermanDA} $0
1162 SectionSetSize ${SecTGermanDA} 0
1164 StrCpy $Search "de_CH"
1166 ${if} $Pointer != "-1"
1167 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1168 SectionSetFlags ${SecTGermanCH} $0
1169 SectionSetSize ${SecTGermanCH} 0
1171 StrCpy $Search "en_GB"
1173 ${if} $Pointer != "-1"
1174 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1175 SectionSetFlags ${SecTEnglishGB} $0
1176 SectionSetSize ${SecTEnglishGB} 0
1178 StrCpy $Search "en_US"
1180 ${if} $Pointer != "-1"
1181 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1182 SectionSetFlags ${SecTEnglishUSAU} $0
1183 SectionSetSize ${SecTEnglishUSAU} 0
1185 StrCpy $Search "es_ES"
1187 ${if} $Pointer != "-1"
1188 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1189 SectionSetFlags ${SecTSpanish} $0
1190 SectionSetSize ${SecTSpanish} 0
1192 StrCpy $Search "fr_FR"
1194 ${if} $Pointer != "-1"
1195 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1196 SectionSetFlags ${SecTFrench} $0
1197 SectionSetSize ${SecTFrench} 0
1199 StrCpy $Search "ga_IR"
1201 ${if} $Pointer != "-1"
1202 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1203 SectionSetFlags ${SecTGaelic} $0
1204 SectionSetSize ${SecTGaelic} 0
1206 StrCpy $Search "el_GR"
1208 ${if} $Pointer != "-1"
1209 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1210 SectionSetFlags ${SecTGreek} $0
1211 SectionSetSize ${SecTGreek} 0
1213 StrCpy $Search "it_IT"
1215 ${if} $Pointer != "-1"
1216 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1217 SectionSetFlags ${SecTItalian} $0
1218 SectionSetSize ${SecTItalian} 0
1220 StrCpy $Search "hu_HU"
1222 ${if} $Pointer != "-1"
1223 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1224 SectionSetFlags ${SecTHungarian} $0
1225 SectionSetSize ${SecTHungarian} 0
1227 StrCpy $Search "no_NO"
1229 ${if} $Pointer != "-1"
1230 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1231 SectionSetFlags ${SecTNorwegian} $0
1232 SectionSetSize ${SecTNorwegian} 0
1234 StrCpy $Search "pl_PL"
1236 ${if} $Pointer != "-1"
1237 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1238 SectionSetFlags ${SecTPolish} $0
1239 SectionSetSize ${SecTPolish} 0
1241 StrCpy $Search "pt_PT"
1243 ${if} $Pointer != "-1"
1244 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1245 SectionSetFlags ${SecTPortuguese} $0
1246 SectionSetSize ${SecTPortuguese} 0
1248 StrCpy $Search "ro_RO"
1250 ${if} $Pointer != "-1"
1251 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1252 SectionSetFlags ${SecTRomanian} $0
1253 SectionSetSize ${SecTRomanian} 0
1255 StrCpy $Search "ru_RU"
1257 ${if} $Pointer != "-1"
1258 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1259 SectionSetFlags ${SecTRussian} $0
1260 SectionSetSize ${SecTRussian} 0
1262 StrCpy $Search "sl_SI"
1264 ${if} $Pointer != "-1"
1265 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1266 SectionSetFlags ${SecTSlovenian} $0
1267 SectionSetSize ${SecTSlovenian} 0
1269 StrCpy $Search "sk_SK"
1271 ${if} $Pointer != "-1"
1272 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1273 SectionSetFlags ${SecTSlovakian} $0
1274 SectionSetSize ${SecTSlovakian} 0
1276 StrCpy $Search "sv_SE"
1278 ${if} $Pointer != "-1"
1279 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1280 SectionSetFlags ${SecTSwedish} $0
1281 SectionSetSize ${SecTSwedish} 0
1290 # this function is called at first after starting the uninstaller
1293 !insertmacro PRINTER_INIT
1294 !insertmacro MULTIUSER_UNINIT
1296 # Check that LyX is not currently running
1297 FindProcDLL::FindProc "lyx.exe"
1299 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1303 # set registry root key
1304 ${if} $MultiUser.Privileges == "Admin"
1305 ${orif} $MultiUser.Privileges == "Power"
1306 SetShellVarContext all
1308 SetShellVarContext current
1311 # Ascertain whether the user has sufficient privileges to uninstall.
1312 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1313 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1315 ${andif} $MultiUser.Privileges != "Admin"
1316 ${andif} $MultiUser.Privileges != "Power"
1317 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1320 # warning when LyX couldn't be found in the registry
1321 ${if} $0 == "" # check in HKCU
1322 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1324 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1328 # Macro to investigate name of LyX's preferences folders to be able remove them
1329 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1331 # test if MiKTeX was installed together with LyX
1332 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1333 ${if} $0 == "Yes${APP_SERIES_KEY}"
1334 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1335 StrCpy $LaTeXInstalled "MiKTeX"
1337 SectionSetText 2 "" # hides the corresponding uninstaller section
1340 # test if JabRef was installed together with LyX
1341 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1342 ${if} $0 == "Yes${APP_SERIES_KEY}"
1343 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1344 StrCpy $JabRefInstalled "Yes"
1346 SectionSetText 3 "" # hides the corresponding uninstaller section
1349 # question message if the user really wants to uninstall LyX
1350 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes