5 Initialization function
9 #--------------------------------
10 # Installer initialization
14 ${If} ${AtLeastWinVista}
15 StrCpy $PrinterConf "printui.exe"
17 StrCpy $PrinterConf "rundll32.exe printui.dll,PrintUIEntry"
25 ${OrIfNot} ${AtLeastWinXP}
26 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later."
30 # check that the installer is not currently running
31 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e'
34 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
37 System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e'
40 MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)"
44 # check if LyX is already installed
45 ${if} $MultiUser.Privileges == "Admin"
46 ${orif} $MultiUser.Privileges == "Power"
47 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
49 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
50 # handle also the case that LyX is already installed in HKLM
52 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
56 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
60 !insertmacro PRINTER_INIT
61 !insertmacro MULTIUSER_INIT
63 # this can be reset to "true" in section SecDesktop
64 StrCpy $CreateDesktopIcon "false"
65 StrCpy $CreateFileAssociations "false"
68 # Show banner while installer is intializating
69 Banner::show /NOUNLOAD "Checking system"
75 !if ${SETUPTYPE} == BUNDLE
76 # don't let the installer sections appear when the programs are already installed
77 ${if} $PathBibTeXEditor != ""
78 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
88 # this function is called at first after starting the uninstaller
91 !insertmacro PRINTER_INIT
92 !insertmacro MULTIUSER_UNINIT
94 # Check that LyX is not currently running
95 FindProcDLL::FindProc "lyx.exe"
97 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
101 # set registry root key
102 ${if} $MultiUser.Privileges == "Admin"
103 ${orif} $MultiUser.Privileges == "Power"
104 SetShellVarContext all
106 SetShellVarContext current
109 # Ascertain whether the user has sufficient privileges to uninstall.
110 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
111 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
113 ${andif} $MultiUser.Privileges != "Admin"
114 ${andif} $MultiUser.Privileges != "Power"
115 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
118 # abort when LyX couldn't be found in the registry
119 ${if} $0 == "" # check in HKCU
120 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
122 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
126 # Macro to investigate name of LyX's preferences folders to be able remove them
127 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
129 # test if MiKTeX was installed together with LyX
130 ReadRegStr $0 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
131 ${if} $0 == "Yes${APP_SERIES_KEY}"
132 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
133 StrCpy $LaTeXInstalled "MiKTeX"
134 DeleteRegValue HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
136 SectionSetText 2 "" # hides the corresponding uninstaller section
139 # test if JabRef was installed together with LyX
140 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
141 ${if} $0 == "Yes${APP_SERIES_KEY}"
142 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
143 StrCpy $JabRefInstalled "Yes"
144 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
146 SectionSetText 3 "" # hides the corresponding uninstaller section
149 # question message if the user really wants to uninstall LyX
150 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes
155 #--------------------------------
156 # User initialization
161 # COMPONENT can be LaTeX, ImageMagick and Ghostscript
162 !macro EXTERNAL_INIT COMPONENT
164 # APP_REGKEY_SETUP = "Software\${APP_NAME}${APP_SERIES_KEY}\Setup"
165 # where ${APP_NAME}${APP_SERIES_KEY} is something like LyX16
166 ReadRegStr $ComponentPath SHELL_CONTEXT "${APP_REGKEY_SETUP}" "${COMPONENT} Path"
168 # BIN_LATEX etc are defined in settings.nsh
169 ${If} ${FileExists} "$ComponentPath\${BIN_${COMPONENT}}"
170 # set variables like PathLaTeX
171 StrCpy $Path${COMPONENT} $ComponentPath
178 # Get directories of components from registry
180 !insertmacro EXTERNAL_INIT LaTeX
184 ReadRegStr $LyXLangName SHELL_CONTEXT "${APP_REGKEY_SETUP}" "LyX Language"
186 ${If} $LyXLangName != ""
187 StrCpy $LangName $LyXLangName
192 #--------------------------------
193 # visible installer sections
195 Section "!${APP_NAME}" SecCore
198 Section "$(SecFileAssocTitle)" SecFileAssoc
199 StrCpy $CreateFileAssociations "true"
201 Section "$(SecDesktopTitle)" SecDesktop
202 StrCpy $CreateDesktopIcon "true"
205 !if ${SETUPTYPE} == BUNDLE
206 Section /o "$(SecInstJabRefTitle)" SecInstJabRef
208 StrCpy $InstallJabRef "true"
212 SectionGroup "Dictionaries" SecDictionaries
214 Section /o "Afrikaans" SecDAfrikaans
215 StrCpy $DictCodes "af_ZA$DictCodes"
219 Section /o "Arabic" SecDArabic
220 StrCpy $DictCodes "ar_DZ$DictCodes"
224 Section /o "Armenian" SecDArmenian
225 StrCpy $DictCodes "hy_AM$DictCodes"
229 Section /o "Bahasa Indonesia" SecDIndonesian
230 StrCpy $DictCodes "id_ID$DictCodes"
234 Section /o "Bahasa Melayu" SecDMalayan
235 StrCpy $DictCodes "ms_MY$DictCodes"
239 Section /o "Belarusian" SecDBelarusian
240 StrCpy $DictCodes "be_BY$DictCodes"
244 Section /o "Brezhoneg" SecDBreton
245 StrCpy $DictCodes "br_FR$DictCodes"
249 Section /o "Bulgarian" SecDBulgarian
250 StrCpy $DictCodes "bg_BG$DictCodes"
254 Section /o "Català" SecDCatalanian
255 StrCpy $DictCodes "ca_ES$DictCodes"
259 Section /o "Ce
\9atina" SecDCzech
260 StrCpy $DictCodes "cs_CZ$DictCodes"
264 Section /o "Cymraeg" SecDWelsh
265 StrCpy $DictCodes "cy_GB$DictCodes"
269 Section /o "Dansk" SecDDanish
270 StrCpy $DictCodes "da_DK$DictCodes"
274 Section /o "German (A)" SecDGermanAT
275 StrCpy $DictCodes "de_AT$DictCodes"
279 Section /o "German (CH)" SecDGermanCH
280 StrCpy $DictCodes "de_CH$DictCodes"
284 Section "German (D)" SecDGermanD
285 # already installed by default
286 #StrCpy $DictCodes "de_DE$DictCodes"
290 Section /o "Greek" SecDGreek
291 StrCpy $DictCodes "el_GR$DictCodes"
295 Section /o "Eesti" SecDEstonian
296 StrCpy $DictCodes "et_EE$DictCodes"
300 # enable this for LyX 2.1!
301 #Section /o "English (AU)" SecDEnglishAU
302 # StrCpy $DictCodes "en_AU$DictCodes"
306 Section /o "English (CA)" SecDEnglishCA
307 StrCpy $DictCodes "en_CA$DictCodes"
311 Section "English (GB)" SecDEnglishGB
312 # already installed by default
313 #StrCpy $DictCodes "en_GB$DictCodes"
317 # enable this for LyX 2.1!
318 #Section /o "English (NZ)" SecDEnglishNZ
319 # StrCpy $DictCodes "en_NZ$DictCodes"
323 Section "English (US)" SecDEnglishUS
324 # already installed by default
325 #StrCpy $DictCodes "en_US$DictCodes"
329 Section "Español (ES)" SecDSpanishES
330 # already installed by default
331 #StrCpy $DictCodes "es_ES$DictCodes"
335 Section "Español (MX)" SecDSpanishMX
336 # already installed by default
337 #StrCpy $DictCodes "es_MX$DictCodes"
341 Section /o "Esperanto" SecDEsperanto
342 StrCpy $DictCodes "eo_EO$DictCodes"
346 Section /o "Euskara" SecDBasque
347 StrCpy $DictCodes "eu_ES$DictCodes"
351 Section /o "Farsi" SecDFarsi
352 StrCpy $DictCodes "fa_IR$DictCodes"
356 Section "Français" SecDFrench
357 # already installed by default
358 #StrCpy $DictCodes "fr_FR$DictCodes"
362 Section /o "Gaeilge" SecDGaelic
363 StrCpy $DictCodes "ga_IR$DictCodes"
367 Section /o "Gàidhlig" SecDScottish
368 StrCpy $DictCodes "gd_GB$DictCodes"
372 Section /o "Galego" SecDGalician
373 StrCpy $DictCodes "gl_ES$DictCodes"
377 Section /o "Hebrew" SecDHebrew
378 StrCpy $DictCodes "he_IL$DictCodes"
382 Section /o "Hrvatski" SecDCroatian
383 StrCpy $DictCodes "hr_HR$DictCodes"
387 Section /o "Magyar" SecDHungarian
388 StrCpy $DictCodes "hu_HU$DictCodes"
392 Section /o "Interlingua" SecDInterlingua
393 StrCpy $DictCodes "ia_IA$DictCodes"
397 Section /o "Íslenska" SecDIcelandic
398 StrCpy $DictCodes "is_IS$DictCodes"
402 Section /o "Italiano" SecDItalian
403 StrCpy $DictCodes "it_IT$DictCodes"
407 Section /o "Kazakh" SecDKazakh
408 StrCpy $DictCodes "kk_KZ$DictCodes"
412 Section /o "Korean" SecDKorean
413 StrCpy $DictCodes "ko_KR$DictCodes"
417 Section /o "Latina" SecDLatin
418 StrCpy $DictCodes "la_LA$DictCodes"
422 Section /o "Lietuviu" SecDLithuanian
423 StrCpy $DictCodes "lt_LT$DictCodes"
427 Section /o "Latvie
\9au" SecDLatvian
428 StrCpy $DictCodes "lv_LV$DictCodes"
432 Section /o "Nederlands" SecDDutch
433 StrCpy $DictCodes "nl_NL$DictCodes"
437 Section /o "Norsk (Bokmål)" SecDNorwegianNB
438 StrCpy $DictCodes "nb_NO$DictCodes"
442 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
443 StrCpy $DictCodes "nn_NO$DictCodes"
447 Section /o "Polski" SecDPolish
448 StrCpy $DictCodes "pl_PL$DictCodes"
452 Section /o "Português (BR)" SecDPortugueseBR
453 StrCpy $DictCodes "pt_BR$DictCodes"
457 Section /o "Português (PT)" SecDPortuguesePT
458 StrCpy $DictCodes "pt_PT$DictCodes"
462 Section /o "Româna" SecDRomanian
463 StrCpy $DictCodes "ro_RO$DictCodes"
467 Section "Russian" SecDRussian
468 # already installed by default
469 #StrCpy $DictCodes "ru_RU$DictCodes"
473 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
474 StrCpy $DictCodes "db_DE$DictCodes"
478 Section /o "Serb
\9acina (Horno)" SecDSorbianH
479 StrCpy $DictCodes "hb_DE$DictCodes"
483 Section /o "Shqipe" SecDAlbanian
484 StrCpy $DictCodes "sq_AL$DictCodes"
488 Section /o "Sloven
\9acina" SecDSlowenian
489 StrCpy $DictCodes "sl_SI$DictCodes"
493 Section /o "Slovenský" SecDSlowakian
494 StrCpy $DictCodes "sk_SK$ThesCodes"
498 Section /o "Srpski" SecDSerbian
499 StrCpy $DictCodes "sr_RS$DictCodes"
503 Section /o "Svenska" SecDSwedish
504 StrCpy $DictCodes "sv_SE$DictCodes"
508 Section /o "Thai" SecDThai
509 StrCpy $DictCodes "th_TH$DictCodes"
513 Section /o "Ukrainian" SecDUkrainian
514 StrCpy $DictCodes "uk_UA$DictCodes"
518 Section /o "Vietnamese" SecDVietnamese
519 StrCpy $DictCodes "vi_VN$DictCodes"
525 SectionGroup "Thesaurus" SecThesaurus
527 Section /o "Bulgarian" SecTBulgarian
528 StrCpy $ThesCodes "bg_BG$ThesCodes"
532 Section /o "Català" SecTCatalan
533 StrCpy $ThesCodes "ca_ES$ThesCodes"
537 Section /o "Ce
\9atina" SecTCzech
538 StrCpy $ThesCodes "cs_CZ$ThesCodes"
542 Section /o "Dansk" SecTDanish
543 StrCpy $ThesCodes "da_DK$ThesCodes"
547 Section /o "Deutsch (D/A)" SecTGermanDA
548 StrCpy $ThesCodes "de_DE$ThesCodes"
552 Section /o "Deutsch (CH)" SecTGermanCH
553 StrCpy $ThesCodes "de_CH$ThesCodes"
557 Section /o "English (GB)" SecTEnglishGB
558 StrCpy $ThesCodes "en_GB$ThesCodes"
562 Section /o "English (US/AU)" SecTEnglishUSAU
563 StrCpy $ThesCodes "en_US$ThesCodes"
567 Section /o "Español" SecTSpanish
568 StrCpy $ThesCodes "es_ES$ThesCodes"
572 Section /o "Français" SecTFrench
573 StrCpy $ThesCodes "fr_FR$ThesCodes"
577 Section /o "Gaeilge" SecTGaelic
578 StrCpy $ThesCodes "ga_IR$ThesCodes"
582 Section /o "Greek" SecTGreek
583 StrCpy $ThesCodes "el_GR$ThesCodes"
587 Section /o "Italiano" SecTItalian
588 StrCpy $ThesCodes "it_IT$ThesCodes"
592 Section /o "Magyar" SecTHungarian
593 StrCpy $ThesCodes "hu_HU$ThesCodes"
597 Section /o "Norsk" SecTNorwegian
598 StrCpy $ThesCodes "no_NO$ThesCodes"
602 Section /o "Polski" SecTPolish
603 StrCpy $ThesCodes "pl_PL$ThesCodes"
607 Section /o "Português" SecTPortuguese
608 StrCpy $ThesCodes "pt_PT$ThesCodes"
612 Section /o "Româna" SecTRomanian
613 StrCpy $ThesCodes "ro_RO$ThesCodes"
617 Section /o "Russian" SecTRussian
618 StrCpy $ThesCodes "ru_RU$ThesCodes"
622 Section /o "Sloven
\9acina" SecTSlowenian
623 StrCpy $ThesCodes "sl_SI$ThesCodes"
627 Section /o "Slovenský" SecTSlowakian
628 StrCpy $ThesCodes "sk_SK$ThesCodes"
632 Section /o "Svenska" SecTSwedish
633 StrCpy $ThesCodes "sv_SE$ThesCodes"
639 # Section descriptions
640 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
641 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
642 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
643 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
644 !if ${SETUPTYPE} == BUNDLE
645 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
647 !insertmacro MUI_FUNCTION_DESCRIPTION_END