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 # FIXME: set this to true when LyX 2.2.0 final is released
52 Section "$(SecFileAssocTitle)" SecFileAssoc
54 StrCpy $CreateFileAssociations "false"
57 Section "$(SecDesktopTitle)" SecDesktop
59 StrCpy $CreateDesktopIcon "false"
62 !if ${SETUPTYPE} == BUNDLE
63 Section /o "$(SecInstJabRefTitle)" SecInstJabRef
64 AddSize ${SIZE_JABREF}
65 StrCpy $InstallJabRef "true"
69 # Expand the list of dictionaries by default as this was requested by several
70 # users. For the thesaurus this is was not requested because this section
71 # is by default empty.
72 SectionGroup /e "Dictionaries" SecDictionaries
74 Section /o "Afrikaans" SecDAfrikaans
75 StrCpy $DictCodes "af_ZA,$DictCodes"
79 Section /o "Arabic" SecDArabic
80 StrCpy $DictCodes "ar_DZ,$DictCodes"
84 Section /o "Armenian" SecDArmenian
85 StrCpy $DictCodes "hy_AM,$DictCodes"
89 Section /o "Bahasa Indonesia" SecDIndonesian
90 StrCpy $DictCodes "id_ID,$DictCodes"
94 Section /o "Bahasa Melayu" SecDMalayan
95 StrCpy $DictCodes "ms_MY,$DictCodes"
99 Section /o "Belarusian" SecDBelarusian
100 StrCpy $DictCodes "be_BY,$DictCodes"
104 Section /o "Brezhoneg" SecDBreton
105 StrCpy $DictCodes "br_FR,$DictCodes"
109 Section /o "Bulgarian" SecDBulgarian
110 StrCpy $DictCodes "bg_BG,$DictCodes"
114 Section /o "Català" SecDCatalanian
115 StrCpy $DictCodes "ca_ES,$DictCodes"
119 Section /o "Ce
\9atina" SecDCzech
120 StrCpy $DictCodes "cs_CZ,$DictCodes"
124 Section /o "Coptic" SecDCoptic
125 StrCpy $DictCodes "cop_EG,$DictCodes"
129 Section /o "Cymraeg" SecDWelsh
130 StrCpy $DictCodes "cy_GB,$DictCodes"
134 Section /o "Dansk" SecDDanish
135 StrCpy $DictCodes "da_DK,$DictCodes"
139 Section /o "German (A)" SecDGermanAT
140 StrCpy $DictCodes "de_AT,$DictCodes"
144 Section /o "German (CH)" SecDGermanCH
145 StrCpy $DictCodes "de_CH,$DictCodes"
149 Section "German (D)" SecDGermanD
150 # already installed by default
152 #StrCpy $DictCodes "de_DE,$DictCodes"
156 Section /o "Greek" SecDGreek
157 StrCpy $DictCodes "el_GR,$DictCodes"
161 Section /o "Eesti" SecDEstonian
162 StrCpy $DictCodes "et_EE,$DictCodes"
166 Section /o "English (AU)" SecDEnglishAU
167 StrCpy $DictCodes "en_AU,$DictCodes"
171 Section /o "English (CA)" SecDEnglishCA
172 StrCpy $DictCodes "en_CA,$DictCodes"
176 Section "English (GB)" SecDEnglishGB
177 # already installed by default
179 #StrCpy $DictCodes "en_GB,$DictCodes"
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 Section /o "Hindi" SecDHindi
267 StrCpy $DictCodes "hi_IN,$DictCodes"
271 Section /o "Interlingua" SecDInterlingua
272 StrCpy $DictCodes "ia_IA,$DictCodes"
276 Section /o "Íslenska" SecDIcelandic
277 StrCpy $DictCodes "is_IS,$DictCodes"
281 Section /o "Italiano" SecDItalian
282 StrCpy $DictCodes "it_IT,$DictCodes"
286 Section /o "Kazakh" SecDKazakh
287 StrCpy $DictCodes "kk_KZ,$DictCodes"
291 Section /o "Korean" SecDKorean
292 StrCpy $DictCodes "ko_KR,$DictCodes"
296 Section /o "Latina" SecDLatin
297 StrCpy $DictCodes "la_LA,$DictCodes"
301 Section /o "Lietuviu" SecDLithuanian
302 StrCpy $DictCodes "lt_LT,$DictCodes"
306 Section /o "Latvie
\9au" SecDLatvian
307 StrCpy $DictCodes "lv_LV,$DictCodes"
311 Section /o "Marathi" SecDMarathi
312 StrCpy $DictCodes "mr_IN,$DictCodes"
316 Section /o "Nederlands" SecDDutch
317 StrCpy $DictCodes "nl_NL,$DictCodes"
321 Section /o "Norsk (Bokmål)" SecDNorwegianNB
322 StrCpy $DictCodes "nb_NO,$DictCodes"
326 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
327 StrCpy $DictCodes "nn_NO,$DictCodes"
331 Section /o "Occitan" SecDOccitan
332 StrCpy $DictCodes "oc_FR,$DictCodes"
336 Section /o "Polski" SecDPolish
337 StrCpy $DictCodes "pl_PL,$DictCodes"
341 Section /o "Português (BR)" SecDPortugueseBR
342 StrCpy $DictCodes "pt_BR,$DictCodes"
346 Section /o "Português (PT)" SecDPortuguesePT
347 StrCpy $DictCodes "pt_PT,$DictCodes"
351 Section /o "Româna" SecDRomanian
352 StrCpy $DictCodes "ro_RO,$DictCodes"
356 Section /o "Russian" SecDRussian
357 StrCpy $DictCodes "ru_RU,$DictCodes"
361 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
362 StrCpy $DictCodes "dsb_DE,$DictCodes"
366 Section /o "Serb
\9acina (Horno)" SecDSorbianH
367 StrCpy $DictCodes "hsb_DE,$DictCodes"
371 Section /o "Shqipe" SecDAlbanian
372 StrCpy $DictCodes "sq_AL,$DictCodes"
376 Section /o "Sloven
\9acina" SecDSlovenian
377 StrCpy $DictCodes "sl_SI,$DictCodes"
381 Section /o "Slovenský" SecDSlovakian
382 StrCpy $DictCodes "sk_SK,$DictCodes"
386 Section /o "Srpski (Cirilica)" SecDSerbianC
387 StrCpy $DictCodes "sr_RS,$DictCodes"
391 Section /o "Srpski (Latinica)" SecDSerbianL
392 StrCpy $DictCodes "sr_RS-Latin,$DictCodes"
396 Section /o "Svenska" SecDSwedish
397 StrCpy $DictCodes "sv_SE,$DictCodes"
401 Section /o "Tamil" SecDTamil
402 StrCpy $DictCodes "ta_IN,$DictCodes"
406 Section /o "Telugu" SecDTelugu
407 StrCpy $DictCodes "te_IN,$DictCodes"
411 Section /o "Thai" SecDThai
412 StrCpy $DictCodes "th_TH,$DictCodes"
416 Section /o "Türkmençe" SecDTurkmen
417 StrCpy $DictCodes "tk_TM,$DictCodes"
421 Section /o "Türkçe" SecDTurkish
422 StrCpy $DictCodes "tr_TR,$DictCodes"
426 Section /o "Ukrainian" SecDUkrainian
427 StrCpy $DictCodes "uk_UA,$DictCodes"
431 Section /o "Urdu" SecDUrdu
432 StrCpy $DictCodes "ur_PK,$DictCodes"
436 Section /o "Vietnamese" SecDVietnamese
437 StrCpy $DictCodes "vi_VN,$DictCodes"
444 SectionGroup "Thesaurus" SecThesaurus
446 Section /o "Bulgarian" SecTBulgarian
447 StrCpy $ThesCodes "bg_BG,$ThesCodes"
451 Section /o "Català" SecTCatalan
452 StrCpy $ThesCodes "ca_ES,$ThesCodes"
456 Section /o "Ce
\9atina" SecTCzech
457 StrCpy $ThesCodes "cs_CZ,$ThesCodes"
461 Section /o "Dansk" SecTDanish
462 StrCpy $ThesCodes "da_DK,$ThesCodes"
466 Section /o "Deutsch (D/A)" SecTGermanDA
467 StrCpy $ThesCodes "de_DE,$ThesCodes"
471 Section /o "Deutsch (CH)" SecTGermanCH
472 StrCpy $ThesCodes "de_CH,$ThesCodes"
476 Section /o "English (GB)" SecTEnglishGB
477 StrCpy $ThesCodes "en_GB,$ThesCodes"
481 Section /o "English (US/AU)" SecTEnglishUSAU
482 StrCpy $ThesCodes "en_US,$ThesCodes"
486 Section /o "Español" SecTSpanish
487 StrCpy $ThesCodes "es_ES,$ThesCodes"
491 Section /o "Français" SecTFrench
492 StrCpy $ThesCodes "fr_FR,$ThesCodes"
496 Section /o "Gaeilge" SecTGaelic
497 StrCpy $ThesCodes "ga_IR,$ThesCodes"
501 Section /o "Galego" SecTGalician
502 StrCpy $ThesCodes "gl_ES,$ThesCodes"
506 Section /o "Greek" SecTGreek
507 StrCpy $ThesCodes "el_GR,$ThesCodes"
511 Section /o "Íslenska" SecTIcelandic
512 StrCpy $ThesCodes "is_IS,$ThesCodes"
516 Section /o "Italiano" SecTItalian
517 StrCpy $ThesCodes "it_IT,$ThesCodes"
521 Section /o "Magyar" SecTHungarian
522 StrCpy $ThesCodes "hu_HU,$ThesCodes"
526 Section /o "Norsk (Bokmål)" SecTNorwegianNB
527 StrCpy $ThesCodes "nb_NO,$ThesCodes"
531 Section /o "Polski" SecTPolish
532 StrCpy $ThesCodes "pl_PL,$ThesCodes"
536 Section /o "Português" SecTPortuguese
537 StrCpy $ThesCodes "pt_PT,$ThesCodes"
541 Section /o "Româna" SecTRomanian
542 StrCpy $ThesCodes "ro_RO,$ThesCodes"
546 Section /o "Russian" SecTRussian
547 StrCpy $ThesCodes "ru_RU,$ThesCodes"
551 Section /o "Sloven
\9acina" SecTSlovenian
552 StrCpy $ThesCodes "sl_SI,$ThesCodes"
556 Section /o "Slovenský" SecTSlovakian
557 StrCpy $ThesCodes "sk_SK,$ThesCodes"
561 Section /o "Svenska" SecTSwedish
562 StrCpy $ThesCodes "sv_SE,$ThesCodes"
566 Section /o "Ukrainian" SecTUkrainian
567 StrCpy $ThesCodes "uk_UA,$ThesCodes"
573 # Section descriptions
574 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
575 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
576 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
577 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
578 !if ${SETUPTYPE} == BUNDLE
579 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
581 !insertmacro MUI_DESCRIPTION_TEXT ${SecDictionaries} "$(SecDictionariesDescription)"
582 !insertmacro MUI_DESCRIPTION_TEXT ${SecThesaurus} "$(SecThesaurusDescription)"
583 !insertmacro MUI_FUNCTION_DESCRIPTION_END
586 # .onInit must be here after the section definition because we have to set
587 # the selection states of the dictionary sections
590 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
591 ${if} $R0 == "5.0" # 2000
592 ${orif} $R0 == "5.1" # XP
593 ${orif} $R0 == "5.2" # 2003
594 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows Vista or newer." /SD IDOK
598 # check that the installer is not currently running
599 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
602 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK
605 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
608 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK
612 # FIXME: check that LyX is not currently running
613 #System::Call 'kernel32::CreateMutexA(i 0, i 0, t "LyX.exe.Instance") i .r1 ?e'
615 #MessageBox MB_OK "$R0"
617 # MessageBox MB_OK|MB_ICONSTOP "$(LyXRunning)"
621 # read the user and computer name
622 ReadRegStr $ComputerName HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName"
623 System::Call "advapi32::GetUserName(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2"
626 !insertmacro MULTIUSER_INIT
628 # check if this LyX version is already installed
629 ${if} $MultiUser.Privileges == "Admin"
630 ${orif} $MultiUser.Privileges == "Power"
631 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayIcon"
633 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayIcon"
634 # handle also the case that LyX is already installed in HKLM
636 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayIcon"
640 # check if the uninstaller was acidentally deleted
641 # if so don't bother the user if he realy wants to install a new LyX over an existing one
642 # because he won't have a chance to deny this
643 StrCpy $4 $0 -10 # remove '\bin\lyx,0'
644 # (for FileCheck the variables $0 and $1 cannot be used)
645 !insertmacro FileCheck $5 "Uninstall-LyX.exe" "$4" # macro from LyXUtils.nsh
647 Goto ForceInstallation
649 # installing over an existing installation of the same LyX release is not necessary
650 # if the users does this he most probably has a problem with LyX that can better be solved
651 # by reinstalling LyX
652 # for beta and other test releases over-installing can even cause errors
653 MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONEXCLAMATION "$(AlreadyInstalled)" /SD IDNO IDYES ForceInstallation
658 # check if there is an existing LyX installation of the same LyX series
659 # we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
660 IntOp $4 ${APP_VERSION_REVISION} + 20
662 ${if} $MultiUser.Privileges == "Admin"
663 ${orif} $MultiUser.Privileges == "Power"
664 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
665 # also check for an emergency release
667 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
670 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
671 # also check for an emergency release
673 ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$51" "DisplayVersion"
677 StrCpy $R5 $0 # store the read version number
678 StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
679 # we don't stop here because we want the latest installed version
683 ${if} $OldVersionNumber > ${APP_SERIES_KEY}
684 # store the version number and reformat it temporarily for the error message
685 StrCpy $R0 $OldVersionNumber
686 StrCpy $OldVersionNumber $R5
687 MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)" /SD IDOK
688 StrCpy $OldVersionNumber $R0
692 # this can be reset to "true" in section SecDesktop
693 StrCpy $CreateDesktopIcon "false"
694 StrCpy $CreateFileAssociations "false"
697 # Show banner while installer is intializating
698 Banner::show /NOUNLOAD "Checking system"
703 !if ${SETUPTYPE} == BUNDLE
704 # don't let the installer sections appear when the programs are already installed
705 ${if} $PathBibTeXEditor != ""
706 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
710 # select sections of already installed spell-checker dictionaries, make them read-only
711 # and set the necessary size to 0 bytes
712 StrCpy $String $FoundDict
713 StrCpy $Search "af_ZA"
714 Call StrPoint # function from LyXUtils.nsh
715 ${if} $Pointer != "-1"
716 IntOp $0 ${SF_SELECTED} | ${SF_RO}
717 SectionSetFlags ${SecDAfrikaans} $0
718 SectionSetSize ${SecDAfrikaans} 0
720 StrCpy $Search "ar_DZ"
722 ${if} $Pointer != "-1"
723 IntOp $0 ${SF_SELECTED} | ${SF_RO}
724 SectionSetFlags ${SecDArabic} $0
725 SectionSetSize ${SecDArabic} 0
727 StrCpy $Search "hy_AM"
729 ${if} $Pointer != "-1"
730 IntOp $0 ${SF_SELECTED} | ${SF_RO}
731 SectionSetFlags ${SecDArmenian} $0
732 SectionSetSize ${SecDArmenian} 0
734 StrCpy $Search "id_ID"
736 ${if} $Pointer != "-1"
737 IntOp $0 ${SF_SELECTED} | ${SF_RO}
738 SectionSetFlags ${SecDIndonesian} $0
739 SectionSetSize ${SecDIndonesian} 0
741 StrCpy $Search "ms_MY"
743 ${if} $Pointer != "-1"
744 IntOp $0 ${SF_SELECTED} | ${SF_RO}
745 SectionSetFlags ${SecDMalayan} $0
746 SectionSetSize ${SecDMalayan} 0
748 StrCpy $Search "be_BY"
750 ${if} $Pointer != "-1"
751 IntOp $0 ${SF_SELECTED} | ${SF_RO}
752 SectionSetFlags ${SecDBelarusian} $0
753 SectionSetSize ${SecDBelarusian} 0
755 StrCpy $Search "br_FR"
757 ${if} $Pointer != "-1"
758 IntOp $0 ${SF_SELECTED} | ${SF_RO}
759 SectionSetFlags ${SecDBreton} $0
760 SectionSetSize ${SecDBreton} 0
762 StrCpy $Search "bg_BG"
764 ${if} $Pointer != "-1"
765 IntOp $0 ${SF_SELECTED} | ${SF_RO}
766 SectionSetFlags ${SecDBulgarian} $0
767 SectionSetSize ${SecDBulgarian} 0
769 StrCpy $Search "ca_ES"
771 ${if} $Pointer != "-1"
772 IntOp $0 ${SF_SELECTED} | ${SF_RO}
773 SectionSetFlags ${SecDCatalanian} $0
774 SectionSetSize ${SecDCatalanian} 0
776 StrCpy $Search "cs_CZ"
778 ${if} $Pointer != "-1"
779 IntOp $0 ${SF_SELECTED} | ${SF_RO}
780 SectionSetFlags ${SecDCzech} $0
781 SectionSetSize ${SecDCzech} 0
784 StrCpy $Search "cop_EG"
786 ${if} $Pointer != "-1"
787 IntOp $0 ${SF_SELECTED} | ${SF_RO}
788 SectionSetFlags ${SecDCoptic} $0
789 SectionSetSize ${SecDCoptic} 0
791 StrCpy $Search "cy_GB"
793 ${if} $Pointer != "-1"
794 IntOp $0 ${SF_SELECTED} | ${SF_RO}
795 SectionSetFlags ${SecDWelsh} $0
796 SectionSetSize ${SecDWelsh} 0
798 StrCpy $Search "da_DK"
800 ${if} $Pointer != "-1"
801 IntOp $0 ${SF_SELECTED} | ${SF_RO}
802 SectionSetFlags ${SecDDanish} $0
803 SectionSetSize ${SecDDanish} 0
805 StrCpy $Search "de_AT"
807 ${if} $Pointer != "-1"
808 IntOp $0 ${SF_SELECTED} | ${SF_RO}
809 SectionSetFlags ${SecDGermanAT} $0
810 SectionSetSize ${SecDGermanAT} 0
812 StrCpy $Search "de_CH"
814 ${if} $Pointer != "-1"
815 IntOp $0 ${SF_SELECTED} | ${SF_RO}
816 SectionSetFlags ${SecDGermanCH} $0
817 SectionSetSize ${SecDGermanCH} 0
819 StrCpy $Search "de_DE"
821 ${if} $Pointer != "-1"
822 IntOp $0 ${SF_SELECTED} | ${SF_RO}
823 SectionSetFlags ${SecDGermanD} $0
824 SectionSetSize ${SecDGermanD} 0
826 StrCpy $Search "el_GR"
828 ${if} $Pointer != "-1"
829 IntOp $0 ${SF_SELECTED} | ${SF_RO}
830 SectionSetFlags ${SecDGreek} $0
831 SectionSetSize ${SecDGreek} 0
833 StrCpy $Search "et_EE"
835 ${if} $Pointer != "-1"
836 IntOp $0 ${SF_SELECTED} | ${SF_RO}
837 SectionSetFlags ${SecDEstonian} $0
838 SectionSetSize ${SecDEstonian} 0
840 StrCpy $Search "en_AU"
842 ${if} $Pointer != "-1"
843 IntOp $0 ${SF_SELECTED} | ${SF_RO}
844 SectionSetFlags ${SecDEnglishAU} $0
845 SectionSetSize ${SecDEnglishAU} 0
847 StrCpy $Search "en_CA"
849 ${if} $Pointer != "-1"
850 IntOp $0 ${SF_SELECTED} | ${SF_RO}
851 SectionSetFlags ${SecDEnglishCA} $0
852 SectionSetSize ${SecDEnglishCA} 0
854 StrCpy $Search "en_GB"
856 ${if} $Pointer != "-1"
857 IntOp $0 ${SF_SELECTED} | ${SF_RO}
858 SectionSetFlags ${SecDEnglishGB} $0
859 SectionSetSize ${SecDEnglishGB} 0
861 StrCpy $Search "en_NZ"
863 ${if} $Pointer != "-1"
864 IntOp $0 ${SF_SELECTED} | ${SF_RO}
865 SectionSetFlags ${SecDEnglishNZ} $0
866 SectionSetSize ${SecDEnglishNZ} 0
868 StrCpy $Search "en_US"
870 ${if} $Pointer != "-1"
871 IntOp $0 ${SF_SELECTED} | ${SF_RO}
872 SectionSetFlags ${SecDEnglishUS} $0
873 SectionSetSize ${SecDEnglishUS} 0
875 StrCpy $Search "es_ES"
877 ${if} $Pointer != "-1"
878 IntOp $0 ${SF_SELECTED} | ${SF_RO}
879 SectionSetFlags ${SecDSpanishES} $0
880 SectionSetSize ${SecDSpanishES} 0
882 StrCpy $Search "es_MX"
884 ${if} $Pointer != "-1"
885 IntOp $0 ${SF_SELECTED} | ${SF_RO}
886 SectionSetFlags ${SecDSpanishMX} $0
887 SectionSetSize ${SecDSpanishMX} 0
889 StrCpy $Search "eo_EO"
891 ${if} $Pointer != "-1"
892 IntOp $0 ${SF_SELECTED} | ${SF_RO}
893 SectionSetFlags ${SecDEsperanto} $0
894 SectionSetSize ${SecDEsperanto} 0
896 StrCpy $Search "eu_ES"
898 ${if} $Pointer != "-1"
899 IntOp $0 ${SF_SELECTED} | ${SF_RO}
900 SectionSetFlags ${SecDBasque} $0
901 SectionSetSize ${SecDBasque} 0
903 StrCpy $Search "fa_IR"
905 ${if} $Pointer != "-1"
906 IntOp $0 ${SF_SELECTED} | ${SF_RO}
907 SectionSetFlags ${SecDFarsi} $0
908 SectionSetSize ${SecDFarsi} 0
910 StrCpy $Search "fr_CA"
912 ${if} $Pointer != "-1"
913 IntOp $0 ${SF_SELECTED} | ${SF_RO}
914 SectionSetFlags ${SecDFrenchCanada} $0
915 SectionSetSize ${SecDFrenchCanada} 0
917 StrCpy $Search "fr_FR"
919 ${if} $Pointer != "-1"
920 IntOp $0 ${SF_SELECTED} | ${SF_RO}
921 SectionSetFlags ${SecDFrench} $0
922 SectionSetSize ${SecDFrench} 0
924 StrCpy $Search "ga_IR"
926 ${if} $Pointer != "-1"
927 IntOp $0 ${SF_SELECTED} | ${SF_RO}
928 SectionSetFlags ${SecDGaelic} $0
929 SectionSetSize ${SecDGaelic} 0
931 StrCpy $Search "gd_GB"
933 ${if} $Pointer != "-1"
934 IntOp $0 ${SF_SELECTED} | ${SF_RO}
935 SectionSetFlags ${SecDScottish} $0
936 SectionSetSize ${SecDScottish} 0
938 StrCpy $Search "gl_ES"
940 ${if} $Pointer != "-1"
941 IntOp $0 ${SF_SELECTED} | ${SF_RO}
942 SectionSetFlags ${SecDGalician} $0
943 SectionSetSize ${SecDGalician} 0
945 StrCpy $Search "he_IL"
947 ${if} $Pointer != "-1"
948 IntOp $0 ${SF_SELECTED} | ${SF_RO}
949 SectionSetFlags ${SecDHebrew} $0
950 SectionSetSize ${SecDHebrew} 0
952 StrCpy $Search "hi_IN"
954 ${if} $Pointer != "-1"
955 IntOp $0 ${SF_SELECTED} | ${SF_RO}
956 SectionSetFlags ${SecDHindi} $0
957 SectionSetSize ${SecDHindi} 0
959 StrCpy $Search "hr_HR"
961 ${if} $Pointer != "-1"
962 IntOp $0 ${SF_SELECTED} | ${SF_RO}
963 SectionSetFlags ${SecDCroatian} $0
964 SectionSetSize ${SecDCroatian} 0
966 StrCpy $Search "hu_HU"
968 ${if} $Pointer != "-1"
969 IntOp $0 ${SF_SELECTED} | ${SF_RO}
970 SectionSetFlags ${SecDHungarian} $0
971 SectionSetSize ${SecDHungarian} 0
973 StrCpy $Search "ia_IA"
975 ${if} $Pointer != "-1"
976 IntOp $0 ${SF_SELECTED} | ${SF_RO}
977 SectionSetFlags ${SecDInterlingua} $0
978 SectionSetSize ${SecDInterlingua} 0
980 StrCpy $Search "is_IS"
982 ${if} $Pointer != "-1"
983 IntOp $0 ${SF_SELECTED} | ${SF_RO}
984 SectionSetFlags ${SecDIcelandic} $0
985 SectionSetSize ${SecDIcelandic} 0
987 StrCpy $Search "it_IT"
989 ${if} $Pointer != "-1"
990 IntOp $0 ${SF_SELECTED} | ${SF_RO}
991 SectionSetFlags ${SecDItalian} $0
992 SectionSetSize ${SecDItalian} 0
994 StrCpy $Search "kk_KZ"
996 ${if} $Pointer != "-1"
997 IntOp $0 ${SF_SELECTED} | ${SF_RO}
998 SectionSetFlags ${SecDKazakh} $0
999 SectionSetSize ${SecDKazakh} 0
1001 StrCpy $Search "ko_KR"
1003 ${if} $Pointer != "-1"
1004 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1005 SectionSetFlags ${SecDKorean} $0
1006 SectionSetSize ${SecDKorean} 0
1008 StrCpy $Search "la_LA"
1010 ${if} $Pointer != "-1"
1011 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1012 SectionSetFlags ${SecDLatin} $0
1013 SectionSetSize ${SecDLatin} 0
1015 StrCpy $Search "lt_LT"
1017 ${if} $Pointer != "-1"
1018 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1019 SectionSetFlags ${SecDLithuanian} $0
1020 SectionSetSize ${SecDLithuanian} 0
1022 StrCpy $Search "lv_LV"
1024 ${if} $Pointer != "-1"
1025 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1026 SectionSetFlags ${SecDLatvian} $0
1027 SectionSetSize ${SecDLatvian} 0
1029 StrCpy $Search "mr_IN"
1031 ${if} $Pointer != "-1"
1032 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1033 SectionSetFlags ${SecDMarathi} $0
1034 SectionSetSize ${SecDMarathi} 0
1036 StrCpy $Search "nl_NL"
1038 ${if} $Pointer != "-1"
1039 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1040 SectionSetFlags ${SecDDutch} $0
1041 SectionSetSize ${SecDDutch} 0
1043 StrCpy $Search "nb_NO"
1045 ${if} $Pointer != "-1"
1046 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1047 SectionSetFlags ${SecDNorwegianNB} $0
1048 SectionSetSize ${SecDNorwegianNB} 0
1050 StrCpy $Search "nn_NO"
1052 ${if} $Pointer != "-1"
1053 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1054 SectionSetFlags ${SecDNorwegianNN} $0
1055 SectionSetSize ${SecDNorwegianNN} 0
1057 StrCpy $Search "oc_FR"
1059 ${if} $Pointer != "-1"
1060 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1061 SectionSetFlags ${SecDOccitan} $0
1062 SectionSetSize ${SecDOccitan} 0
1064 StrCpy $Search "pl_PL"
1066 ${if} $Pointer != "-1"
1067 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1068 SectionSetFlags ${SecDPolish} $0
1069 SectionSetSize ${SecDPolish} 0
1071 StrCpy $Search "pt_BR"
1073 ${if} $Pointer != "-1"
1074 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1075 SectionSetFlags ${SecDPortugueseBR} $0
1076 SectionSetSize ${SecDPortugueseBR} 0
1078 StrCpy $Search "pt_PT"
1080 ${if} $Pointer != "-1"
1081 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1082 SectionSetFlags ${SecDPortuguesePT} $0
1083 SectionSetSize ${SecDPortuguesePT} 0
1085 StrCpy $Search "ro_RO"
1087 ${if} $Pointer != "-1"
1088 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1089 SectionSetFlags ${SecDRomanian} $0
1090 SectionSetSize ${SecDRomanian} 0
1092 StrCpy $Search "ru_RU"
1094 ${if} $Pointer != "-1"
1095 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1096 SectionSetFlags ${SecDRussian} $0
1097 SectionSetSize ${SecDRussian} 0
1099 StrCpy $Search "dsb_DE"
1101 ${if} $Pointer != "-1"
1102 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1103 SectionSetFlags ${SecDSorbianD} $0
1104 SectionSetSize ${SecDSorbianD} 0
1106 StrCpy $Search "hsb_DE"
1108 ${if} $Pointer != "-1"
1109 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1110 SectionSetFlags ${SecDSorbianH} $0
1111 SectionSetSize ${SecDSorbianH} 0
1113 StrCpy $Search "sq_AL"
1115 ${if} $Pointer != "-1"
1116 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1117 SectionSetFlags ${SecDAlbanian} $0
1118 SectionSetSize ${SecDAlbanian} 0
1120 StrCpy $Search "sl_SI"
1122 ${if} $Pointer != "-1"
1123 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1124 SectionSetFlags ${SecDSlovenian} $0
1125 SectionSetSize ${SecDSlovenian} 0
1127 StrCpy $Search "sk_SK"
1129 ${if} $Pointer != "-1"
1130 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1131 SectionSetFlags ${SecDSlovakian} $0
1132 SectionSetSize ${SecDSlovakian} 0
1134 StrCpy $Search "sr_RS"
1136 ${if} $Pointer != "-1"
1137 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1138 SectionSetFlags ${SecDSerbianC} $0
1139 SectionSetSize ${SecDSerbianC} 0
1141 StrCpy $Search "sr_RS-Latin"
1143 ${if} $Pointer != "-1"
1144 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1145 SectionSetFlags ${SecDSerbianL} $0
1146 SectionSetSize ${SecDSerbianL} 0
1148 StrCpy $Search "sv_SE"
1150 ${if} $Pointer != "-1"
1151 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1152 SectionSetFlags ${SecDSwedish} $0
1153 SectionSetSize ${SecDSwedish} 0
1155 StrCpy $Search "ta_IN"
1157 ${if} $Pointer != "-1"
1158 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1159 SectionSetFlags ${SecDTamil} $0
1160 SectionSetSize ${SecDTamil} 0
1162 StrCpy $Search "te_IN"
1164 ${if} $Pointer != "-1"
1165 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1166 SectionSetFlags ${SecDTelugu} $0
1167 SectionSetSize ${SecDTelugu} 0
1169 StrCpy $Search "th_TH"
1171 ${if} $Pointer != "-1"
1172 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1173 SectionSetFlags ${SecDThai} $0
1174 SectionSetSize ${SecDThai} 0
1176 StrCpy $Search "tk_TM"
1178 ${if} $Pointer != "-1"
1179 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1180 SectionSetFlags ${SecDTurkmen} $0
1181 SectionSetSize ${SecDTurkmen} 0
1183 StrCpy $Search "tr_TR"
1185 ${if} $Pointer != "-1"
1186 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1187 SectionSetFlags ${SecDTurkish} $0
1188 SectionSetSize ${SecDTurkish} 0
1190 StrCpy $Search "uk_UA"
1192 ${if} $Pointer != "-1"
1193 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1194 SectionSetFlags ${SecDUkrainian} $0
1195 SectionSetSize ${SecDUkrainian} 0
1197 StrCpy $Search "ur_PK"
1199 ${if} $Pointer != "-1"
1200 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1201 SectionSetFlags ${SecDUrdu} $0
1202 SectionSetSize ${SecDUrdu} 0
1204 StrCpy $Search "vi_VN"
1206 ${if} $Pointer != "-1"
1207 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1208 SectionSetFlags ${SecDVietnamese} $0
1209 SectionSetSize ${SecDVietnamese} 0
1212 # select sections of already installed thesaurus dictionaries, make them read-only
1213 # and set the necessary size to 0 bytes
1214 StrCpy $String $FoundThes
1215 StrCpy $Search "bg_BG"
1216 Call StrPoint # function from LyXUtils.nsh
1217 ${if} $Pointer != "-1"
1218 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1219 SectionSetFlags ${SecTBulgarian} $0
1220 SectionSetSize ${SecTBulgarian} 0
1222 StrCpy $Search "ca_ES"
1224 ${if} $Pointer != "-1"
1225 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1226 SectionSetFlags ${SecTCatalan} $0
1227 SectionSetSize ${SecTCatalan} 0
1229 StrCpy $Search "cs_CZ"
1231 ${if} $Pointer != "-1"
1232 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1233 SectionSetFlags ${SecTCzech} $0
1234 SectionSetSize ${SecTCzech} 0
1236 StrCpy $Search "da_DK"
1238 ${if} $Pointer != "-1"
1239 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1240 SectionSetFlags ${SecTDanish} $0
1241 SectionSetSize ${SecTDanish} 0
1243 StrCpy $Search "de_DE"
1245 ${if} $Pointer != "-1"
1246 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1247 SectionSetFlags ${SecTGermanDA} $0
1248 SectionSetSize ${SecTGermanDA} 0
1250 StrCpy $Search "de_CH"
1252 ${if} $Pointer != "-1"
1253 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1254 SectionSetFlags ${SecTGermanCH} $0
1255 SectionSetSize ${SecTGermanCH} 0
1257 StrCpy $Search "en_GB"
1259 ${if} $Pointer != "-1"
1260 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1261 SectionSetFlags ${SecTEnglishGB} $0
1262 SectionSetSize ${SecTEnglishGB} 0
1264 StrCpy $Search "en_US"
1266 ${if} $Pointer != "-1"
1267 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1268 SectionSetFlags ${SecTEnglishUSAU} $0
1269 SectionSetSize ${SecTEnglishUSAU} 0
1271 StrCpy $Search "es_ES"
1273 ${if} $Pointer != "-1"
1274 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1275 SectionSetFlags ${SecTSpanish} $0
1276 SectionSetSize ${SecTSpanish} 0
1278 StrCpy $Search "fr_FR"
1280 ${if} $Pointer != "-1"
1281 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1282 SectionSetFlags ${SecTFrench} $0
1283 SectionSetSize ${SecTFrench} 0
1285 StrCpy $Search "ga_IR"
1287 ${if} $Pointer != "-1"
1288 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1289 SectionSetFlags ${SecTGaelic} $0
1290 SectionSetSize ${SecTGaelic} 0
1292 StrCpy $Search "gl_ES"
1294 ${if} $Pointer != "-1"
1295 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1296 SectionSetFlags ${SecTGalician} $0
1297 SectionSetSize ${SecTGalician} 0
1299 StrCpy $Search "el_GR"
1301 ${if} $Pointer != "-1"
1302 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1303 SectionSetFlags ${SecTGreek} $0
1304 SectionSetSize ${SecTGreek} 0
1306 StrCpy $Search "is_IS"
1308 ${if} $Pointer != "-1"
1309 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1310 SectionSetFlags ${SecTIcelandic} $0
1311 SectionSetSize ${SecTIcelandic} 0
1313 StrCpy $Search "it_IT"
1315 ${if} $Pointer != "-1"
1316 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1317 SectionSetFlags ${SecTItalian} $0
1318 SectionSetSize ${SecTItalian} 0
1320 StrCpy $Search "hu_HU"
1322 ${if} $Pointer != "-1"
1323 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1324 SectionSetFlags ${SecTHungarian} $0
1325 SectionSetSize ${SecTHungarian} 0
1327 StrCpy $Search "nb_NO"
1329 ${if} $Pointer != "-1"
1330 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1331 SectionSetFlags ${SecTNorwegianNB} $0
1332 SectionSetSize ${SecTNorwegianNB} 0
1334 StrCpy $Search "pl_PL"
1336 ${if} $Pointer != "-1"
1337 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1338 SectionSetFlags ${SecTPolish} $0
1339 SectionSetSize ${SecTPolish} 0
1341 StrCpy $Search "pt_PT"
1343 ${if} $Pointer != "-1"
1344 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1345 SectionSetFlags ${SecTPortuguese} $0
1346 SectionSetSize ${SecTPortuguese} 0
1348 StrCpy $Search "ro_RO"
1350 ${if} $Pointer != "-1"
1351 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1352 SectionSetFlags ${SecTRomanian} $0
1353 SectionSetSize ${SecTRomanian} 0
1355 StrCpy $Search "ru_RU"
1357 ${if} $Pointer != "-1"
1358 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1359 SectionSetFlags ${SecTRussian} $0
1360 SectionSetSize ${SecTRussian} 0
1362 StrCpy $Search "sl_SI"
1364 ${if} $Pointer != "-1"
1365 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1366 SectionSetFlags ${SecTSlovenian} $0
1367 SectionSetSize ${SecTSlovenian} 0
1369 StrCpy $Search "sk_SK"
1371 ${if} $Pointer != "-1"
1372 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1373 SectionSetFlags ${SecTSlovakian} $0
1374 SectionSetSize ${SecTSlovakian} 0
1376 StrCpy $Search "sv_SE"
1378 ${if} $Pointer != "-1"
1379 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1380 SectionSetFlags ${SecTSwedish} $0
1381 SectionSetSize ${SecTSwedish} 0
1383 StrCpy $Search "uk_UA"
1385 ${if} $Pointer != "-1"
1386 IntOp $0 ${SF_SELECTED} | ${SF_RO}
1387 SectionSetFlags ${SecTUkrainian} $0
1388 SectionSetSize ${SecTUkrainian} 0
1397 # this function is called at first after starting the uninstaller
1400 !insertmacro MULTIUSER_UNINIT
1402 # Check that LyX is not currently running
1403 FindProcDLL::FindProc "lyx.exe"
1405 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)" /SD IDOK
1409 # set registry root key
1410 ${if} $MultiUser.Privileges == "Admin"
1411 ${orif} $MultiUser.Privileges == "Power"
1412 SetShellVarContext all
1414 SetShellVarContext current
1417 # Ascertain whether the user has sufficient privileges to uninstall.
1418 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
1419 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
1421 ${andif} $MultiUser.Privileges != "Admin"
1422 ${andif} $MultiUser.Privileges != "Power"
1423 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)" /SD IDOK
1426 # warning when LyX couldn't be found in the registry
1427 ${if} $0 == "" # check in HKCU
1428 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
1430 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)" /SD IDOK
1434 # Macro to investigate name of LyX's preferences folders to be able remove them
1435 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
1437 # test if MiKTeX was installed together with LyX
1438 ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
1439 ${if} $0 == "Yes${APP_SERIES_KEY}"
1440 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
1441 StrCpy $LaTeXInstalled "MiKTeX"
1443 SectionSetText 2 "" # hides the corresponding uninstaller section
1446 # test if JabRef was installed together with LyX
1447 ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
1448 ${if} $0 == "Yes${APP_SERIES_KEY}"
1449 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
1450 StrCpy $JabRefInstalled "Yes"
1452 SectionSetText 3 "" # hides the corresponding uninstaller section
1455 # question message if the user really wants to uninstall LyX
1456 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" /SD IDYES IDYES +2 # continue if yes