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 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
47 MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
51 !insertmacro PRINTER_INIT
52 !insertmacro MULTIUSER_INIT
54 # this can be reset to "true" in section SecDesktop
55 StrCpy $CreateDesktopIcon "false"
56 StrCpy $CreateFileAssociations "false"
60 !ifndef BUNDLE_IMAGEMAGICK & BUNDLE_GHOSTSCRIPT
61 # Warn the user when no Administrator or Power user privileges are available
62 # These privileges are required to install ImageMagick or Ghostscript
63 ${If} $MultiUser.Privileges != "Admin"
64 ${AndIf} $MultiUser.Privileges != "Power"
65 MessageBox MB_OK|MB_ICONEXCLAMATION $(TEXT_NO_PRIVILEDGES)
69 # Show banner while installer is intializating
70 Banner::show /NOUNLOAD "Checking system"
76 !if ${SETUPTYPE} == BUNDLE
77 # don't let the installer sections appear when the programs are already installed
78 ${if} $PathBibTeXEditor != ""
79 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
89 # this function is called at first after starting the uninstaller
92 !insertmacro PRINTER_INIT
93 !insertmacro MULTIUSER_UNINIT
95 # Check that LyX is not currently running
96 FindProcDLL::FindProc "lyx.exe"
98 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
102 # set registry root key
103 ${if} $MultiUser.Privileges == "Admin"
104 ${orif} $MultiUser.Privileges == "Power"
105 SetShellVarContext all
107 SetShellVarContext current
110 # Ascertain whether the user has sufficient privileges to uninstall.
111 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
112 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
114 ${andif} $MultiUser.Privileges != "Admin"
115 ${andif} $MultiUser.Privileges != "Power"
116 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
119 # abort when LyX couldn't be found in the registry
120 ${if} $0 == "" # check in HKCU
121 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
123 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
127 # Macro to investigate name of LyX's preferences folders to be able remove them
128 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
130 # test if MiKTeX was installed together with LyX
131 ReadRegStr $0 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
132 ${if} $0 == "Yes${APP_SERIES_KEY}"
133 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
134 StrCpy $LaTeXInstalled "MiKTeX"
135 DeleteRegValue HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
137 SectionSetText 2 "" # hides the corresponding uninstaller section
140 # test if JabRef was installed together with LyX
141 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
142 ${if} $0 == "Yes${APP_SERIES_KEY}"
143 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
144 StrCpy $JabRefInstalled "Yes"
145 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
147 SectionSetText 3 "" # hides the corresponding uninstaller section
150 # question message if the user really wants to uninstall LyX
151 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes
156 #--------------------------------
157 # User initialization
162 # COMPONENT can be LaTeX, ImageMagick and Ghostscript
163 !macro EXTERNAL_INIT COMPONENT
165 # APP_REGKEY_SETUP = "Software\${APP_NAME}${APP_SERIES_KEY}\Setup"
166 # where ${APP_NAME}${APP_SERIES_KEY} is something like LyX16
167 ReadRegStr $ComponentPath SHELL_CONTEXT "${APP_REGKEY_SETUP}" "${COMPONENT} Path"
169 # BIN_LATEX etc are defined in settings.nsh
170 ${If} ${FileExists} "$ComponentPath\${BIN_${COMPONENT}}"
171 # set variables like PathLaTeX
172 StrCpy $Path${COMPONENT} $ComponentPath
179 # Get directories of components from registry
181 !insertmacro EXTERNAL_INIT LaTeX
185 ReadRegStr $LyXLangName SHELL_CONTEXT "${APP_REGKEY_SETUP}" "LyX Language"
187 ${If} $LyXLangName != ""
188 StrCpy $LangName $LyXLangName
193 #--------------------------------
194 # visible installer sections
196 Section "!${APP_NAME}" SecCore
199 Section "$(SecFileAssocTitle)" SecFileAssoc
200 StrCpy $CreateFileAssociations "true"
202 Section "$(SecDesktopTitle)" SecDesktop
203 StrCpy $CreateDesktopIcon "true"
206 !if ${SETUPTYPE} == BUNDLE
207 Section /o "$(SecInstJabRefTitle)" SecInstJabRef
209 StrCpy $InstallJabRef "true"
213 SectionGroup "Dictionaries" SecDictionaries
215 Section /o "Afrikaans" SecDAfrikaans
216 StrCpy $DictCodes "af_ZA$DictCodes"
220 Section /o "Arabic" SecDArabic
221 StrCpy $DictCodes "ar_DZ$DictCodes"
225 Section /o "Armenian" SecDArmenian
226 StrCpy $DictCodes "hy_AM$DictCodes"
230 Section /o "Bahasa Indonesia" SecDIndonesian
231 StrCpy $DictCodes "id_ID$DictCodes"
235 Section /o "Bahasa Melayu" SecDMalayan
236 StrCpy $DictCodes "ms_MY$DictCodes"
240 Section /o "Belarusian" SecDBelarusian
241 StrCpy $DictCodes "be_BY$DictCodes"
245 Section /o "Brezhoneg" SecDBreton
246 StrCpy $DictCodes "br_FR$DictCodes"
250 Section /o "Bulgarian" SecDBulgarian
251 StrCpy $DictCodes "bg_BG$DictCodes"
255 Section /o "Català" SecDCatalanian
256 StrCpy $DictCodes "ca_ES$DictCodes"
260 Section /o "Ce
\9atina" SecDCzech
261 StrCpy $DictCodes "cs_CZ$DictCodes"
265 Section /o "Cymraeg" SecDWelsh
266 StrCpy $DictCodes "cy_GB$DictCodes"
270 Section /o "Dansk" SecDDanish
271 StrCpy $DictCodes "da_DK$DictCodes"
275 Section /o "German (A)" SecDGermanAT
276 StrCpy $DictCodes "de_AT$DictCodes"
280 Section /o "German (CH)" SecDGermanCH
281 StrCpy $DictCodes "de_CH$DictCodes"
285 Section "German (D)" SecDGermanD
286 # already installed by default
287 #StrCpy $DictCodes "de_DE$DictCodes"
291 Section /o "Greek" SecDGreek
292 StrCpy $DictCodes "el_GR$DictCodes"
296 Section /o "Eesti" SecDEstonian
297 StrCpy $DictCodes "et_EE$DictCodes"
301 # enable this for LyX 2.1!
302 #Section /o "English (AU)" SecDEnglishAU
303 # StrCpy $DictCodes "en_AU$DictCodes"
307 Section /o "English (CA)" SecDEnglishCA
308 StrCpy $DictCodes "en_CA$DictCodes"
312 Section "English (GB)" SecDEnglishGB
313 # already installed by default
314 #StrCpy $DictCodes "en_GB$DictCodes"
318 # enable this for LyX 2.1!
319 #Section /o "English (NZ)" SecDEnglishNZ
320 # StrCpy $DictCodes "en_NZ$DictCodes"
324 Section "English (US)" SecDEnglishUS
325 # already installed by default
326 #StrCpy $DictCodes "en_US$DictCodes"
330 Section "Español (ES)" SecDSpanishES
331 # already installed by default
332 #StrCpy $DictCodes "es_ES$DictCodes"
336 Section "Español (MX)" SecDSpanishMX
337 # already installed by default
338 #StrCpy $DictCodes "es_MX$DictCodes"
342 Section /o "Esperanto" SecDEsperanto
343 StrCpy $DictCodes "eo_EO$DictCodes"
347 Section /o "Euskara" SecDBasque
348 StrCpy $DictCodes "eu_ES$DictCodes"
352 Section /o "Farsi" SecDFarsi
353 StrCpy $DictCodes "fa_IR$DictCodes"
357 Section "Français" SecDFrench
358 # already installed by default
359 #StrCpy $DictCodes "fr_FR$DictCodes"
363 Section /o "Gaeilge" SecDGaelic
364 StrCpy $DictCodes "ga_IR$DictCodes"
368 Section /o "Gàidhlig" SecDScottish
369 StrCpy $DictCodes "gd_GB$DictCodes"
373 Section /o "Galego" SecDGalician
374 StrCpy $DictCodes "gl_ES$DictCodes"
378 Section /o "Hebrew" SecDHebrew
379 StrCpy $DictCodes "he_IL$DictCodes"
383 Section /o "Hrvatski" SecDCroatian
384 StrCpy $DictCodes "hr_HR$DictCodes"
388 Section /o "Magyar" SecDHungarian
389 StrCpy $DictCodes "hu_HU$DictCodes"
393 Section /o "Interlingua" SecDInterlingua
394 StrCpy $DictCodes "ia_IA$DictCodes"
398 Section /o "Íslenska" SecDIcelandic
399 StrCpy $DictCodes "is_IS$DictCodes"
403 Section /o "Italiano" SecDItalian
404 StrCpy $DictCodes "it_IT$DictCodes"
408 Section /o "Kazakh" SecDKazakh
409 StrCpy $DictCodes "kk_KZ$DictCodes"
413 Section /o "Korean" SecDKorean
414 StrCpy $DictCodes "ko_KR$DictCodes"
418 Section /o "Latina" SecDLatin
419 StrCpy $DictCodes "la_LA$DictCodes"
423 Section /o "Lietuviu" SecDLithuanian
424 StrCpy $DictCodes "lt_LT$DictCodes"
428 Section /o "Latvie
\9au" SecDLatvian
429 StrCpy $DictCodes "lv_LV$DictCodes"
433 Section /o "Nederlands" SecDDutch
434 StrCpy $DictCodes "nl_NL$DictCodes"
438 Section /o "Norsk (Bokmål)" SecDNorwegianNB
439 StrCpy $DictCodes "nb_NO$DictCodes"
443 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
444 StrCpy $DictCodes "nn_NO$DictCodes"
448 Section /o "Polski" SecDPolish
449 StrCpy $DictCodes "pl_PL$DictCodes"
453 Section /o "Português (BR)" SecDPortugueseBR
454 StrCpy $DictCodes "pt_BR$DictCodes"
458 Section /o "Português (PT)" SecDPortuguesePT
459 StrCpy $DictCodes "pt_PT$DictCodes"
463 Section /o "Româna" SecDRomanian
464 StrCpy $DictCodes "ro_RO$DictCodes"
468 Section "Russian" SecDRussian
469 # already installed by default
470 #StrCpy $DictCodes "ru_RU$DictCodes"
474 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
475 StrCpy $DictCodes "db_DE$DictCodes"
479 Section /o "Serb
\9acina (Horno)" SecDSorbianH
480 StrCpy $DictCodes "hb_DE$DictCodes"
484 Section /o "Shqipe" SecDAlbanian
485 StrCpy $DictCodes "sq_AL$DictCodes"
489 Section /o "Sloven
\9acina" SecDSlowenian
490 StrCpy $DictCodes "sl_SI$DictCodes"
494 Section /o "Slovenský" SecDSlowakian
495 StrCpy $DictCodes "sk_SK$ThesCodes"
499 Section /o "Srpski" SecDSerbian
500 StrCpy $DictCodes "sr_RS$DictCodes"
504 Section /o "Svenska" SecDSwedish
505 StrCpy $DictCodes "sv_SE$DictCodes"
509 Section /o "Thai" SecDThai
510 StrCpy $DictCodes "th_TH$DictCodes"
514 Section /o "Ukrainian" SecDUkrainian
515 StrCpy $DictCodes "uk_UA$DictCodes"
519 Section /o "Vietnamese" SecDVietnamese
520 StrCpy $DictCodes "vi_VN$DictCodes"
526 SectionGroup "Thesaurus" SecThesaurus
528 Section /o "Bulgarian" SecTBulgarian
529 StrCpy $ThesCodes "bg_BG$ThesCodes"
533 Section /o "Català" SecTCatalan
534 StrCpy $ThesCodes "ca_ES$ThesCodes"
538 Section /o "Ce
\9atina" SecTCzech
539 StrCpy $ThesCodes "cs_CZ$ThesCodes"
543 Section /o "Dansk" SecTDanish
544 StrCpy $ThesCodes "da_DK$ThesCodes"
548 Section /o "Deutsch (D/A)" SecTGermanDA
549 StrCpy $ThesCodes "de_DE$ThesCodes"
553 Section /o "Deutsch (CH)" SecTGermanCH
554 StrCpy $ThesCodes "de_CH$ThesCodes"
558 Section /o "English (GB)" SecTEnglishGB
559 StrCpy $ThesCodes "en_GB$ThesCodes"
563 Section /o "English (US/AU)" SecTEnglishUSAU
564 StrCpy $ThesCodes "en_US$ThesCodes"
568 Section /o "Español" SecTSpanish
569 StrCpy $ThesCodes "es_ES$ThesCodes"
573 Section /o "Français" SecTFrench
574 StrCpy $ThesCodes "fr_FR$ThesCodes"
578 Section /o "Gaeilge" SecTGaelic
579 StrCpy $ThesCodes "ga_IR$ThesCodes"
583 Section /o "Greek" SecTGreek
584 StrCpy $ThesCodes "el_GR$ThesCodes"
588 Section /o "Italiano" SecTItalian
589 StrCpy $ThesCodes "it_IT$ThesCodes"
593 Section /o "Magyar" SecTHungarian
594 StrCpy $ThesCodes "hu_HU$ThesCodes"
598 Section /o "Norsk" SecTNorwegian
599 StrCpy $ThesCodes "no_NO$ThesCodes"
603 Section /o "Polski" SecTPolish
604 StrCpy $ThesCodes "pl_PL$ThesCodes"
608 Section /o "Português" SecTPortuguese
609 StrCpy $ThesCodes "pt_PT$ThesCodes"
613 Section /o "Româna" SecTRomanian
614 StrCpy $ThesCodes "ro_RO$ThesCodes"
618 Section /o "Russian" SecTRussian
619 StrCpy $ThesCodes "ru_RU$ThesCodes"
623 Section /o "Sloven
\9acina" SecTSlowenian
624 StrCpy $ThesCodes "sl_SI$ThesCodes"
628 Section /o "Slovenský" SecTSlowakian
629 StrCpy $ThesCodes "sk_SK$ThesCodes"
633 Section /o "Svenska" SecTSwedish
634 StrCpy $ThesCodes "sv_SE$ThesCodes"
640 # Section descriptions
641 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
642 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
643 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
644 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
645 !if ${SETUPTYPE} == BUNDLE
646 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
648 !insertmacro MUI_FUNCTION_DESCRIPTION_END