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 "Français (Canada)" SecDFrenchCanada
232 StrCpy $DictCodes "fr_CA,$DictCodes"
236 Section /o "Gaeilge" SecDGaelic
237 StrCpy $DictCodes "ga_IR,$DictCodes"
241 Section /o "Gàidhlig" SecDScottish
242 StrCpy $DictCodes "gd_GB,$DictCodes"
246 Section /o "Galego" SecDGalician
247 StrCpy $DictCodes "gl_ES,$DictCodes"
251 Section /o "Hebrew" SecDHebrew
252 StrCpy $DictCodes "he_IL,$DictCodes"
256 Section /o "Hrvatski" SecDCroatian
257 StrCpy $DictCodes "hr_HR,$DictCodes"
261 Section /o "Magyar" SecDHungarian
262 StrCpy $DictCodes "hu_HU,$DictCodes"
266 # enable this for LyX 2.1!
267 #Section /o "Hindi" SecDHindi
268 # StrCpy $DictCodes "hi_IN,$DictCodes"
272 Section /o "Interlingua" SecDInterlingua
273 StrCpy $DictCodes "ia_IA,$DictCodes"
277 Section /o "Íslenska" SecDIcelandic
278 StrCpy $DictCodes "is_IS,$DictCodes"
282 Section /o "Italiano" SecDItalian
283 StrCpy $DictCodes "it_IT,$DictCodes"
287 Section /o "Kazakh" SecDKazakh
288 StrCpy $DictCodes "kk_KZ,$DictCodes"
292 Section /o "Korean" SecDKorean
293 StrCpy $DictCodes "ko_KR,$DictCodes"
297 Section /o "Latina" SecDLatin
298 StrCpy $DictCodes "la_LA,$DictCodes"
302 Section /o "Lietuviu" SecDLithuanian
303 StrCpy $DictCodes "lt_LT,$DictCodes"
307 Section /o "Latvie
\9au" SecDLatvian
308 StrCpy $DictCodes "lv_LV,$DictCodes"
312 # enable this for LyX 2.1!
313 #Section /o "Marathi" SecDMarathi
314 # StrCpy $DictCodes "mr_IN,$DictCodes"
318 Section /o "Nederlands" SecDDutch
319 StrCpy $DictCodes "nl_NL,$DictCodes"
323 Section /o "Norsk (Bokmål)" SecDNorwegianNB
324 StrCpy $DictCodes "nb_NO,$DictCodes"
328 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
329 StrCpy $DictCodes "nn_NO,$DictCodes"
333 # enable this for LyX 2.1!
334 #Section /o "Occitan" SecDOccitan
335 # StrCpy $DictCodes "oc_FR,$DictCodes"
339 Section /o "Polski" SecDPolish
340 StrCpy $DictCodes "pl_PL,$DictCodes"
344 Section /o "Português (BR)" SecDPortugueseBR
345 StrCpy $DictCodes "pt_BR,$DictCodes"
349 Section /o "Português (PT)" SecDPortuguesePT
350 StrCpy $DictCodes "pt_PT,$DictCodes"
354 Section /o "Româna" SecDRomanian
355 StrCpy $DictCodes "ro_RO,$DictCodes"
359 Section /o "Russian" SecDRussian
360 StrCpy $DictCodes "ru_RU,$DictCodes"
364 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
365 StrCpy $DictCodes "dsb_DE,$DictCodes"
369 Section /o "Serb
\9acina (Horno)" SecDSorbianH
370 StrCpy $DictCodes "hsb_DE,$DictCodes"
374 Section /o "Shqipe" SecDAlbanian
375 StrCpy $DictCodes "sq_AL,$DictCodes"
379 Section /o "Sloven
\9acina" SecDSlovenian
380 StrCpy $DictCodes "sl_SI,$DictCodes"
384 Section /o "Slovenský" SecDSlovakian
385 StrCpy $DictCodes "sk_SK,$DictCodes"
389 Section /o "Srpski (Cirilica)" SecDSerbianC
390 StrCpy $DictCodes "sr_RS,$DictCodes"
394 Section /o "Srpski (Latinica)" SecDSerbianL
395 StrCpy $DictCodes "sr_RS-Latin,$DictCodes"
399 Section /o "Svenska" SecDSwedish
400 StrCpy $DictCodes "sv_SE,$DictCodes"
404 # enable this for LyX 2.1!
405 #Section /o "Tamil" SecDTamil
406 # StrCpy $DictCodes "ta_IN,$DictCodes"
410 # enable this for LyX 2.1!
411 #Section /o "Telugu" SecDTelugu
412 # StrCpy $DictCodes "te_IN,$DictCodes"
416 Section /o "Thai" SecDThai
417 StrCpy $DictCodes "th_TH,$DictCodes"
421 Section /o "Ukrainian" SecDUkrainian
422 StrCpy $DictCodes "uk_UA,$DictCodes"
426 # enable this for LyX 2.1!
427 #Section /o "Urdu" SecDUrdu
428 # StrCpy $DictCodes "ur_PK,$DictCodes"
432 Section /o "Vietnamese" SecDVietnamese
433 StrCpy $DictCodes "vi_VN,$DictCodes"
440 SectionGroup "Thesaurus" SecThesaurus
442 Section /o "Bulgarian" SecTBulgarian
443 StrCpy $ThesCodes "bg_BG,$ThesCodes"
447 Section /o "Català" SecTCatalan
448 StrCpy $ThesCodes "ca_ES,$ThesCodes"
452 Section /o "Ce
\9atina" SecTCzech
453 StrCpy $ThesCodes "cs_CZ,$ThesCodes"
457 Section /o "Dansk" SecTDanish
458 StrCpy $ThesCodes "da_DK,$ThesCodes"
462 Section /o "Deutsch (D/A)" SecTGermanDA
463 StrCpy $ThesCodes "de_DE,$ThesCodes"
467 Section /o "Deutsch (CH)" SecTGermanCH
468 StrCpy $ThesCodes "de_CH,$ThesCodes"
472 Section /o "English (GB)" SecTEnglishGB
473 StrCpy $ThesCodes "en_GB,$ThesCodes"
477 Section /o "English (US/AU)" SecTEnglishUSAU
478 StrCpy $ThesCodes "en_US,$ThesCodes"
482 Section /o "Español" SecTSpanish
483 StrCpy $ThesCodes "es_ES,$ThesCodes"
487 Section /o "Français" SecTFrench
488 StrCpy $ThesCodes "fr_FR,$ThesCodes"
492 Section /o "Gaeilge" SecTGaelic
493 StrCpy $ThesCodes "ga_IR,$ThesCodes"
497 Section /o "Greek" SecTGreek
498 StrCpy $ThesCodes "el_GR,$ThesCodes"
502 Section /o "Italiano" SecTItalian
503 StrCpy $ThesCodes "it_IT,$ThesCodes"
507 Section /o "Magyar" SecTHungarian
508 StrCpy $ThesCodes "hu_HU,$ThesCodes"
512 Section /o "Norsk (Bokmål)" SecTNorwegianNB
513 StrCpy $ThesCodes "nb_NO,$ThesCodes"
517 Section /o "Polski" SecTPolish
518 StrCpy $ThesCodes "pl_PL,$ThesCodes"
522 Section /o "Português" SecTPortuguese
523 StrCpy $ThesCodes "pt_PT,$ThesCodes"
527 Section /o "Româna" SecTRomanian
528 StrCpy $ThesCodes "ro_RO,$ThesCodes"
532 Section /o "Russian" SecTRussian
533 StrCpy $ThesCodes "ru_RU,$ThesCodes"
537 Section /o "Sloven
\9acina" SecTSlovenian
538 StrCpy $ThesCodes "sl_SI,$ThesCodes"
542 Section /o "Slovenský" SecTSlovakian
543 StrCpy $ThesCodes "sk_SK,$ThesCodes"
547 Section /o "Svenska" SecTSwedish
548 StrCpy $ThesCodes "sv_SE,$ThesCodes"
554 # Section descriptions
555 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
556 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
557 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
558 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
559 !if ${SETUPTYPE} == BUNDLE
560 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
562 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
563 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
564 !insertmacro MUI_FUNCTION_DESCRIPTION_END
567 #--------------------------------
568 # Installer initialization
572 ${If} ${AtLeastWinVista}
573 StrCpy $PrinterConf "printui.exe"
575 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
580 # .onInit must be here after the section definition because we have to set
581 # the selection states of the dictionary sections
585 ${OrIfNot} ${AtLeastWinXP}
586 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
590 # check that the installer is not currently running
591 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
594 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
597 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
600 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
604 !insertmacro MULTIUSER_INIT
606 # check if this LyX version is already installed
607 ${if} $MultiUser.Privileges == "Admin"
608 ${orif} $MultiUser.Privileges == "Power"
609 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
611 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
612 # handle also the case that LyX is already installed in HKLM
614 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
618 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
622 # check if there is an existing LyX installation of the same LyX series
623 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
624 IntOp $4 ${APP_VERSION_REVISION} + 20
626 ${if} $MultiUser.Privileges == "Admin"
627 ${orif} $MultiUser.Privileges == "Power"
628 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
629 # also check for an emergency release
631 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
634 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
635 # also check for an emergency release
637 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
641 StrCpy $R5 $0 # store the read version number
642 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
643 # we don't stop here because we want the latest installed version
646 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
647 # store the version number and reformat it temporarily for the error message
648 StrCpy $R0 $OldVersionNumber
649 StrCpy $OldVersionNumber $R5
650 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
651 StrCpy $OldVersionNumber $R0
655 !insertmacro PRINTER_INIT
657 # this can be reset to "true" in section SecDesktop
658 StrCpy $CreateDesktopIcon "false"
659 StrCpy $CreateFileAssociations "false"
662 # Show banner while installer is intializating
663 Banner::show /NOUNLOAD "Checking system"
668 !if ${SETUPTYPE} == BUNDLE
669 # don't let the installer sections appear when the programs are already installed
670 ${if} $PathBibTeXEditor != ""
671 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
675 # select sections of already installed spell-checker dictionaries, make them read-only
676 # and set the necessary size to 0 bytes
677 StrCpy $String $FoundDict
678 StrCpy $Search "af_ZA"
679 Call StrPoint # function from LyXUtils.nsh
680 ${if} $Pointer != "-1"
681 IntOp $0 ${SF_SELECTED} | ${SF_RO}
682 SectionSetFlags ${SecDAfrikaans} $0
683 SectionSetSize ${SecDAfrikaans} 0
685 StrCpy $Search "ar_DZ"
687 ${if} $Pointer != "-1"
688 IntOp $0 ${SF_SELECTED} | ${SF_RO}
689 SectionSetFlags ${SecDArabic} $0
690 SectionSetSize ${SecDArabic} 0
692 StrCpy $Search "hy_AM"
694 ${if} $Pointer != "-1"
695 IntOp $0 ${SF_SELECTED} | ${SF_RO}
696 SectionSetFlags ${SecDArmenian} $0
697 SectionSetSize ${SecDArmenian} 0
699 StrCpy $Search "id_ID"
701 ${if} $Pointer != "-1"
702 IntOp $0 ${SF_SELECTED} | ${SF_RO}
703 SectionSetFlags ${SecDIndonesian} $0
704 SectionSetSize ${SecDIndonesian} 0
706 StrCpy $Search "ms_MY"
708 ${if} $Pointer != "-1"
709 IntOp $0 ${SF_SELECTED} | ${SF_RO}
710 SectionSetFlags ${SecDMalayan} $0
711 SectionSetSize ${SecDMalayan} 0
713 StrCpy $Search "be_BY"
715 ${if} $Pointer != "-1"
716 IntOp $0 ${SF_SELECTED} | ${SF_RO}
717 SectionSetFlags ${SecDBelarusian} $0
718 SectionSetSize ${SecDBelarusian} 0
720 StrCpy $Search "br_FR"
722 ${if} $Pointer != "-1"
723 IntOp $0 ${SF_SELECTED} | ${SF_RO}
724 SectionSetFlags ${SecDBreton} $0
725 SectionSetSize ${SecDBreton} 0
727 StrCpy $Search "bg_BG"
729 ${if} $Pointer != "-1"
730 IntOp $0 ${SF_SELECTED} | ${SF_RO}
731 SectionSetFlags ${SecDBulgarian} $0
732 SectionSetSize ${SecDBulgarian} 0
734 StrCpy $Search "ca_ES"
736 ${if} $Pointer != "-1"
737 IntOp $0 ${SF_SELECTED} | ${SF_RO}
738 SectionSetFlags ${SecDCatalanian} $0
739 SectionSetSize ${SecDCatalanian} 0
741 StrCpy $Search "cs_CZ"
743 ${if} $Pointer != "-1"
744 IntOp $0 ${SF_SELECTED} | ${SF_RO}
745 SectionSetFlags ${SecDCzech} $0
746 SectionSetSize ${SecDCzech} 0
749 StrCpy $Search "cop_EG"
751 ${if} $Pointer != "-1"
752 IntOp $0 ${SF_SELECTED} | ${SF_RO}
753 # enable this for LyX 2.1!
754 # SectionSetFlags ${SecDCoptic} $0
755 # SectionSetSize ${SecDCoptic} 0
757 StrCpy $Search "cy_GB"
759 ${if} $Pointer != "-1"
760 IntOp $0 ${SF_SELECTED} | ${SF_RO}
761 SectionSetFlags ${SecDWelsh} $0
762 SectionSetSize ${SecDWelsh} 0
764 StrCpy $Search "da_DK"
766 ${if} $Pointer != "-1"
767 IntOp $0 ${SF_SELECTED} | ${SF_RO}
768 SectionSetFlags ${SecDDanish} $0
769 SectionSetSize ${SecDDanish} 0
771 StrCpy $Search "de_AT"
773 ${if} $Pointer != "-1"
774 IntOp $0 ${SF_SELECTED} | ${SF_RO}
775 SectionSetFlags ${SecDGermanAT} $0
776 SectionSetSize ${SecDGermanAT} 0
778 StrCpy $Search "de_CH"
780 ${if} $Pointer != "-1"
781 IntOp $0 ${SF_SELECTED} | ${SF_RO}
782 SectionSetFlags ${SecDGermanCH} $0
783 SectionSetSize ${SecDGermanCH} 0
785 StrCpy $Search "de_DE"
787 ${if} $Pointer != "-1"
788 IntOp $0 ${SF_SELECTED} | ${SF_RO}
789 SectionSetFlags ${SecDGermanD} $0
790 SectionSetSize ${SecDGermanD} 0
792 StrCpy $Search "el_GR"
794 ${if} $Pointer != "-1"
795 IntOp $0 ${SF_SELECTED} | ${SF_RO}
796 SectionSetFlags ${SecDGreek} $0
797 SectionSetSize ${SecDGreek} 0
799 StrCpy $Search "et_EE"
801 ${if} $Pointer != "-1"
802 IntOp $0 ${SF_SELECTED} | ${SF_RO}
803 SectionSetFlags ${SecDEstonian} $0
804 SectionSetSize ${SecDEstonian} 0
806 StrCpy $Search "en_AU"
808 ${if} $Pointer != "-1"
809 IntOp $0 ${SF_SELECTED} | ${SF_RO}
810 # enable this for LyX 2.1!
811 # SectionSetFlags ${SecDEnglishAU} $0
812 # SectionSetSize ${SecDEnglishAU} 0
814 StrCpy $Search "en_CA"
816 ${if} $Pointer != "-1"
817 IntOp $0 ${SF_SELECTED} | ${SF_RO}
818 SectionSetFlags ${SecDEnglishCA} $0
819 SectionSetSize ${SecDEnglishCA} 0
821 StrCpy $Search "en_GB"
823 ${if} $Pointer != "-1"
824 IntOp $0 ${SF_SELECTED} | ${SF_RO}
825 SectionSetFlags ${SecDEnglishGB} $0
826 SectionSetSize ${SecDEnglishGB} 0
828 StrCpy $Search "en_NZ"
830 ${if} $Pointer != "-1"
831 IntOp $0 ${SF_SELECTED} | ${SF_RO}
832 # enable this for LyX 2.1!
833 # SectionSetFlags ${SecDEnglishNZ} $0
834 # SectionSetSize ${SecDEnglishNZ} 0
836 StrCpy $Search "en_US"
838 ${if} $Pointer != "-1"
839 IntOp $0 ${SF_SELECTED} | ${SF_RO}
840 SectionSetFlags ${SecDEnglishUS} $0
841 SectionSetSize ${SecDEnglishUS} 0
843 StrCpy $Search "es_ES"
845 ${if} $Pointer != "-1"
846 IntOp $0 ${SF_SELECTED} | ${SF_RO}
847 SectionSetFlags ${SecDSpanishES} $0
848 SectionSetSize ${SecDSpanishES} 0
850 StrCpy $Search "es_MX"
852 ${if} $Pointer != "-1"
853 IntOp $0 ${SF_SELECTED} | ${SF_RO}
854 SectionSetFlags ${SecDSpanishMX} $0
855 SectionSetSize ${SecDSpanishMX} 0
857 StrCpy $Search "eo_EO"
859 ${if} $Pointer != "-1"
860 IntOp $0 ${SF_SELECTED} | ${SF_RO}
861 SectionSetFlags ${SecDEsperanto} $0
862 SectionSetSize ${SecDEsperanto} 0
864 StrCpy $Search "eu_ES"
866 ${if} $Pointer != "-1"
867 IntOp $0 ${SF_SELECTED} | ${SF_RO}
868 SectionSetFlags ${SecDBasque} $0
869 SectionSetSize ${SecDBasque} 0
871 StrCpy $Search "fa_IR"
873 ${if} $Pointer != "-1"
874 IntOp $0 ${SF_SELECTED} | ${SF_RO}
875 SectionSetFlags ${SecDFarsi} $0
876 SectionSetSize ${SecDFarsi} 0
878 StrCpy $Search "fr_CA"
880 ${if} $Pointer != "-1"
881 IntOp $0 ${SF_SELECTED} | ${SF_RO}
882 SectionSetFlags ${SecDFrenchCanada} $0
883 SectionSetSize ${SecDFrenchCanada} 0
885 StrCpy $Search "fr_FR"
887 ${if} $Pointer != "-1"
888 IntOp $0 ${SF_SELECTED} | ${SF_RO}
889 SectionSetFlags ${SecDFrench} $0
890 SectionSetSize ${SecDFrench} 0
892 StrCpy $Search "ga_IR"
894 ${if} $Pointer != "-1"
895 IntOp $0 ${SF_SELECTED} | ${SF_RO}
896 SectionSetFlags ${SecDGaelic} $0
897 SectionSetSize ${SecDGaelic} 0
899 StrCpy $Search "gd_GB"
901 ${if} $Pointer != "-1"
902 IntOp $0 ${SF_SELECTED} | ${SF_RO}
903 SectionSetFlags ${SecDScottish} $0
904 SectionSetSize ${SecDScottish} 0
906 StrCpy $Search "gl_ES"
908 ${if} $Pointer != "-1"
909 IntOp $0 ${SF_SELECTED} | ${SF_RO}
910 SectionSetFlags ${SecDGalician} $0
911 SectionSetSize ${SecDGalician} 0
913 StrCpy $Search "he_IL"
915 ${if} $Pointer != "-1"
916 IntOp $0 ${SF_SELECTED} | ${SF_RO}
917 SectionSetFlags ${SecDHebrew} $0
918 SectionSetSize ${SecDHebrew} 0
920 StrCpy $Search "hi_IN"
922 ${if} $Pointer != "-1"
923 IntOp $0 ${SF_SELECTED} | ${SF_RO}
924 # enable this for LyX 2.1!
925 # SectionSetFlags ${SecDHindi} $0
926 # SectionSetSize ${SecDHindi} 0
928 StrCpy $Search "hr_HR"
930 ${if} $Pointer != "-1"
931 IntOp $0 ${SF_SELECTED} | ${SF_RO}
932 SectionSetFlags ${SecDCroatian} $0
933 SectionSetSize ${SecDCroatian} 0
935 StrCpy $Search "hu_HU"
937 ${if} $Pointer != "-1"
938 IntOp $0 ${SF_SELECTED} | ${SF_RO}
939 SectionSetFlags ${SecDHungarian} $0
940 SectionSetSize ${SecDHungarian} 0
942 StrCpy $Search "ia_IA"
944 ${if} $Pointer != "-1"
945 IntOp $0 ${SF_SELECTED} | ${SF_RO}
946 SectionSetFlags ${SecDInterlingua} $0
947 SectionSetSize ${SecDInterlingua} 0
949 StrCpy $Search "is_IS"
951 ${if} $Pointer != "-1"
952 IntOp $0 ${SF_SELECTED} | ${SF_RO}
953 SectionSetFlags ${SecDIcelandic} $0
954 SectionSetSize ${SecDIcelandic} 0
956 StrCpy $Search "it_IT"
958 ${if} $Pointer != "-1"
959 IntOp $0 ${SF_SELECTED} | ${SF_RO}
960 SectionSetFlags ${SecDItalian} $0
961 SectionSetSize ${SecDItalian} 0
963 StrCpy $Search "kk_KZ"
965 ${if} $Pointer != "-1"
966 IntOp $0 ${SF_SELECTED} | ${SF_RO}
967 SectionSetFlags ${SecDKazakh} $0
968 SectionSetSize ${SecDKazakh} 0
970 StrCpy $Search "ko_KR"
972 ${if} $Pointer != "-1"
973 IntOp $0 ${SF_SELECTED} | ${SF_RO}
974 SectionSetFlags ${SecDKorean} $0
975 SectionSetSize ${SecDKorean} 0
977 StrCpy $Search "la_LA"
979 ${if} $Pointer != "-1"
980 IntOp $0 ${SF_SELECTED} | ${SF_RO}
981 SectionSetFlags ${SecDLatin} $0
982 SectionSetSize ${SecDLatin} 0
984 StrCpy $Search "lt_LT"
986 ${if} $Pointer != "-1"
987 IntOp $0 ${SF_SELECTED} | ${SF_RO}
988 SectionSetFlags ${SecDLithuanian} $0
989 SectionSetSize ${SecDLithuanian} 0
991 StrCpy $Search "lv_LV"
993 ${if} $Pointer != "-1"
994 IntOp $0 ${SF_SELECTED} | ${SF_RO}
995 SectionSetFlags ${SecDLatvian} $0
996 SectionSetSize ${SecDLatvian} 0
998 StrCpy $Search "nl_NL"
1000 ${if} $Pointer != "-1"
1001 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1002 SectionSetFlags ${SecDDutch} $0
1003 SectionSetSize ${SecDDutch} 0
1005 StrCpy $Search "nb_NO"
1007 ${if} $Pointer != "-1"
1008 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1009 SectionSetFlags ${SecDNorwegianNB} $0
1010 SectionSetSize ${SecDNorwegianNB} 0
1012 StrCpy $Search "nn_NO"
1014 ${if} $Pointer != "-1"
1015 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1016 SectionSetFlags ${SecDNorwegianNN} $0
1017 SectionSetSize ${SecDNorwegianNN} 0
1019 StrCpy $Search "oc_FR"
1021 ${if} $Pointer != "-1"
1022 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1023 # enable this for LyX 2.1!
1024 # SectionSetFlags ${SecDOccitan} $0
1025 # SectionSetSize ${SecDOccitan} 0
1027 StrCpy $Search "pl_PL"
1029 ${if} $Pointer != "-1"
1030 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1031 SectionSetFlags ${SecDPolish} $0
1032 SectionSetSize ${SecDPolish} 0
1034 StrCpy $Search "pt_BR"
1036 ${if} $Pointer != "-1"
1037 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1038 SectionSetFlags ${SecDPortugueseBR} $0
1039 SectionSetSize ${SecDPortugueseBR} 0
1041 StrCpy $Search "pt_PT"
1043 ${if} $Pointer != "-1"
1044 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1045 SectionSetFlags ${SecDPortuguesePT} $0
1046 SectionSetSize ${SecDPortuguesePT} 0
1048 StrCpy $Search "ro_RO"
1050 ${if} $Pointer != "-1"
1051 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1052 SectionSetFlags ${SecDRomanian} $0
1053 SectionSetSize ${SecDRomanian} 0
1055 StrCpy $Search "ru_RU"
1057 ${if} $Pointer != "-1"
1058 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1059 SectionSetFlags ${SecDRussian} $0
1060 SectionSetSize ${SecDRussian} 0
1062 StrCpy $Search "dsb_DE"
1064 ${if} $Pointer != "-1"
1065 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1066 SectionSetFlags ${SecDSorbianD} $0
1067 SectionSetSize ${SecDSorbianD} 0
1069 StrCpy $Search "hsb_DE"
1071 ${if} $Pointer != "-1"
1072 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1073 SectionSetFlags ${SecDSorbianH} $0
1074 SectionSetSize ${SecDSorbianH} 0
1076 StrCpy $Search "sq_AL"
1078 ${if} $Pointer != "-1"
1079 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1080 SectionSetFlags ${SecDAlbanian} $0
1081 SectionSetSize ${SecDAlbanian} 0
1083 StrCpy $Search "sl_SI"
1085 ${if} $Pointer != "-1"
1086 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1087 SectionSetFlags ${SecDSlovenian} $0
1088 SectionSetSize ${SecDSlovenian} 0
1090 StrCpy $Search "sk_SK"
1092 ${if} $Pointer != "-1"
1093 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1094 SectionSetFlags ${SecDSlovakian} $0
1095 SectionSetSize ${SecDSlovakian} 0
1097 StrCpy $Search "sr_RS"
1099 ${if} $Pointer != "-1"
1100 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1101 SectionSetFlags ${SecDSerbianC} $0
1102 SectionSetSize ${SecDSerbianC} 0
1104 StrCpy $Search "sr_RS-Latin"
1106 ${if} $Pointer != "-1"
1107 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1108 SectionSetFlags ${SecDSerbianL} $0
1109 SectionSetSize ${SecDSerbianL} 0
1111 StrCpy $Search "sv_SE"
1113 ${if} $Pointer != "-1"
1114 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1115 SectionSetFlags ${SecDSwedish} $0
1116 SectionSetSize ${SecDSwedish} 0
1118 StrCpy $Search "ta_IN"
1120 ${if} $Pointer != "-1"
1121 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1122 # enable this for LyX 2.1!
1123 # SectionSetFlags ${SecDTamil} $0
1124 # SectionSetSize ${SecDTamil} 0
1126 StrCpy $Search "te_IN"
1128 ${if} $Pointer != "-1"
1129 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1130 # enable this for LyX 2.1!
1131 # SectionSetFlags ${SecDTelugu} $0
1132 # SectionSetSize ${SecDTelugu} 0
1134 StrCpy $Search "th_TH"
1136 ${if} $Pointer != "-1"
1137 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1138 SectionSetFlags ${SecDThai} $0
1139 SectionSetSize ${SecDThai} 0
1141 StrCpy $Search "uk_UA"
1143 ${if} $Pointer != "-1"
1144 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1145 SectionSetFlags ${SecDUkrainian} $0
1146 SectionSetSize ${SecDUkrainian} 0
1148 StrCpy $Search "ur_PK"
1150 ${if} $Pointer != "-1"
1151 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1152 # enable this for LyX 2.1!
1153 # SectionSetFlags ${SecDUrdu} $0
1154 # SectionSetSize ${SecDUrdu} 0
1156 StrCpy $Search "vi_VN"
1158 ${if} $Pointer != "-1"
1159 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1160 SectionSetFlags ${SecDVietnamese} $0
1161 SectionSetSize ${SecDVietnamese} 0
1164 # select sections of already installed thesaurus dictionaries, make them read-only
1165 # and set the necessary size to 0 bytes
1166 StrCpy $String $FoundThes
1167 StrCpy $Search "bg_BG"
1168 Call StrPoint # function from LyXUtils.nsh
1169 ${if} $Pointer != "-1"
1170 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1171 SectionSetFlags ${SecTBulgarian} $0
1172 SectionSetSize ${SecTBulgarian} 0
1174 StrCpy $Search "ca_ES"
1176 ${if} $Pointer != "-1"
1177 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1178 SectionSetFlags ${SecTCatalan} $0
1179 SectionSetSize ${SecTCatalan} 0
1181 StrCpy $Search "cs_CZ"
1183 ${if} $Pointer != "-1"
1184 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1185 SectionSetFlags ${SecTCzech} $0
1186 SectionSetSize ${SecTCzech} 0
1188 StrCpy $Search "da_DK"
1190 ${if} $Pointer != "-1"
1191 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1192 SectionSetFlags ${SecTDanish} $0
1193 SectionSetSize ${SecTDanish} 0
1195 StrCpy $Search "de_DE"
1197 ${if} $Pointer != "-1"
1198 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1199 SectionSetFlags ${SecTGermanDA} $0
1200 SectionSetSize ${SecTGermanDA} 0
1202 StrCpy $Search "de_CH"
1204 ${if} $Pointer != "-1"
1205 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1206 SectionSetFlags ${SecTGermanCH} $0
1207 SectionSetSize ${SecTGermanCH} 0
1209 StrCpy $Search "en_GB"
1211 ${if} $Pointer != "-1"
1212 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1213 SectionSetFlags ${SecTEnglishGB} $0
1214 SectionSetSize ${SecTEnglishGB} 0
1216 StrCpy $Search "en_US"
1218 ${if} $Pointer != "-1"
1219 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1220 SectionSetFlags ${SecTEnglishUSAU} $0
1221 SectionSetSize ${SecTEnglishUSAU} 0
1223 StrCpy $Search "es_ES"
1225 ${if} $Pointer != "-1"
1226 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1227 SectionSetFlags ${SecTSpanish} $0
1228 SectionSetSize ${SecTSpanish} 0
1230 StrCpy $Search "fr_FR"
1232 ${if} $Pointer != "-1"
1233 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1234 SectionSetFlags ${SecTFrench} $0
1235 SectionSetSize ${SecTFrench} 0
1237 StrCpy $Search "ga_IR"
1239 ${if} $Pointer != "-1"
1240 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1241 SectionSetFlags ${SecTGaelic} $0
1242 SectionSetSize ${SecTGaelic} 0
1244 StrCpy $Search "el_GR"
1246 ${if} $Pointer != "-1"
1247 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1248 SectionSetFlags ${SecTGreek} $0
1249 SectionSetSize ${SecTGreek} 0
1251 StrCpy $Search "it_IT"
1253 ${if} $Pointer != "-1"
1254 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1255 SectionSetFlags ${SecTItalian} $0
1256 SectionSetSize ${SecTItalian} 0
1258 StrCpy $Search "hu_HU"
1260 ${if} $Pointer != "-1"
1261 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1262 SectionSetFlags ${SecTHungarian} $0
1263 SectionSetSize ${SecTHungarian} 0
1265 StrCpy $Search "nb_NO"
1267 ${if} $Pointer != "-1"
1268 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1269 SectionSetFlags ${SecTNorwegianNB} $0
1270 SectionSetSize ${SecTNorwegianNB} 0
1272 StrCpy $Search "pl_PL"
1274 ${if} $Pointer != "-1"
1275 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1276 SectionSetFlags ${SecTPolish} $0
1277 SectionSetSize ${SecTPolish} 0
1279 StrCpy $Search "pt_PT"
1281 ${if} $Pointer != "-1"
1282 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1283 SectionSetFlags ${SecTPortuguese} $0
1284 SectionSetSize ${SecTPortuguese} 0
1286 StrCpy $Search "ro_RO"
1288 ${if} $Pointer != "-1"
1289 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1290 SectionSetFlags ${SecTRomanian} $0
1291 SectionSetSize ${SecTRomanian} 0
1293 StrCpy $Search "ru_RU"
1295 ${if} $Pointer != "-1"
1296 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1297 SectionSetFlags ${SecTRussian} $0
1298 SectionSetSize ${SecTRussian} 0
1300 StrCpy $Search "sl_SI"
1302 ${if} $Pointer != "-1"
1303 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1304 SectionSetFlags ${SecTSlovenian} $0
1305 SectionSetSize ${SecTSlovenian} 0
1307 StrCpy $Search "sk_SK"
1309 ${if} $Pointer != "-1"
1310 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1311 SectionSetFlags ${SecTSlovakian} $0
1312 SectionSetSize ${SecTSlovakian} 0
1314 StrCpy $Search "sv_SE"
1316 ${if} $Pointer != "-1"
1317 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1318 SectionSetFlags ${SecTSwedish} $0
1319 SectionSetSize ${SecTSwedish} 0
1328 # this function is called at first after starting the uninstaller
1331 !insertmacro PRINTER_INIT
1332 !insertmacro MULTIUSER_UNINIT
1334 # Check that LyX is not currently running
1335 FindProcDLL::FindProc "lyx.exe"
1337 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
1341 # set registry root key
1342 ${if} $MultiUser.Privileges == "Admin"
1343 ${orif} $MultiUser.Privileges == "Power"
1344 SetShellVarContext all
1346 SetShellVarContext current
1349 # Ascertain whether the user has sufficient privileges to uninstall.
1350 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1351 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1353 ${andif} $MultiUser.Privileges != "Admin"
1354 ${andif} $MultiUser.Privileges != "Power"
1355 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
1358 # warning when LyX couldn't be found in the registry
1359 ${if} $0 == "" # check in HKCU
1360 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1362 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
1366 # Macro to investigate name of LyX's preferences folders to be able remove them
1367 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1369 # test if MiKTeX was installed together with LyX
1370 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1371 ${if} $0 == "Yes${APP_SERIES_KEY}"
1372 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1373 StrCpy $LaTeXInstalled "MiKTeX"
1375 SectionSetText 2 "" # hides the corresponding uninstaller section
1378 # test if JabRef was installed together with LyX
1379 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1380 ${if} $0 == "Yes${APP_SERIES_KEY}"
1381 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1382 StrCpy $JabRefInstalled "Yes"
1384 SectionSetText 3 "" # hides the corresponding uninstaller section
1387 # question message if the user really wants to uninstall LyX
1388 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes