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 SHCTX "${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"
59 # Show banner while installer is intializating
60 Banner::show /NOUNLOAD "Checking system"
66 !if ${SETUPTYPE} == BUNDLE
67 # don't let the installer sections appear when the programs are already installed
68 ${if} $PathBibTeXEditor != ""
69 SectionSetText 3 "" # hides the corresponding uninstaller section, ${SecInstJabRef}
79 # this function is called at first after starting the uninstaller
82 !insertmacro PRINTER_INIT
83 !insertmacro MULTIUSER_UNINIT
85 # Check that LyX is not currently running
86 FindProcDLL::FindProc "lyx.exe"
88 MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
92 # set registry root key
93 ${if} $MultiUser.Privileges == "Admin"
94 ${orif} $MultiUser.Privileges == "Power"
95 SetShellVarContext all
97 SetShellVarContext current
100 # Ascertain whether the user has sufficient privileges to uninstall.
101 # abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
102 ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayVersion"
104 ${andif} $MultiUser.Privileges != "Admin"
105 ${andif} $MultiUser.Privileges != "Power"
106 MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
109 # abort when LyX couldn't be found in the registry
110 ${if} $0 == "" # check in HKCU
111 ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion"
113 MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
117 # Macro to investigate name of LyX's preferences folders to be able remove them
118 !insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
120 # test if MiKTeX was installed together with LyX
121 ReadRegStr $0 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
122 ${if} $0 == "Yes${APP_SERIES_KEY}"
123 SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
124 StrCpy $LaTeXInstalled "MiKTeX"
125 DeleteRegValue HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
127 SectionSetText 2 "" # hides the corresponding uninstaller section
130 # test if JabRef was installed together with LyX
131 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
132 ${if} $0 == "Yes${APP_SERIES_KEY}"
133 SectionSetText 3 "JabRef" # names the corersponding uninstaller section
134 StrCpy $JabRefInstalled "Yes"
135 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
137 SectionSetText 3 "" # hides the corresponding uninstaller section
140 # question message if the user really wants to uninstall LyX
141 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes
146 #--------------------------------
147 # User initialization
152 # COMPONENT can be LaTeX, ImageMagick and Ghostscript
153 !macro EXTERNAL_INIT COMPONENT
155 # APP_REGKEY_SETUP = "Software\${APP_NAME}${APP_SERIES_KEY}\Setup"
156 # where ${APP_NAME}${APP_SERIES_KEY} is something like LyX16
157 ReadRegStr $ComponentPath SHELL_CONTEXT "${APP_REGKEY_SETUP}" "${COMPONENT} Path"
159 # BIN_LATEX etc are defined in settings.nsh
160 ${If} ${FileExists} "$ComponentPath\${BIN_${COMPONENT}}"
161 # set variables like PathLaTeX
162 StrCpy $Path${COMPONENT} $ComponentPath
169 # Get directories of components from registry
171 !insertmacro EXTERNAL_INIT LaTeX
175 ReadRegStr $LyXLangName SHELL_CONTEXT "${APP_REGKEY_SETUP}" "LyX Language"
177 ${If} $LyXLangName != ""
178 StrCpy $LangName $LyXLangName
183 #--------------------------------
184 # visible installer sections
186 Section "!${APP_NAME}" SecCore
189 Section "$(SecFileAssocTitle)" SecFileAssoc
190 StrCpy $CreateFileAssociations "true"
192 Section "$(SecDesktopTitle)" SecDesktop
193 StrCpy $CreateDesktopIcon "true"
196 !if ${SETUPTYPE} == BUNDLE
197 Section /o "$(SecInstJabRefTitle)" SecInstJabRef
199 StrCpy $InstallJabRef "true"
203 SectionGroup "Dictionaries" SecDictionaries
205 Section /o "Afrikaans" SecDAfrikaans
206 StrCpy $DictCodes "af_ZA$DictCodes"
210 Section /o "Arabic" SecDArabic
211 StrCpy $DictCodes "ar_DZ$DictCodes"
215 Section /o "Armenian" SecDArmenian
216 StrCpy $DictCodes "hy_AM$DictCodes"
220 Section /o "Bahasa Indonesia" SecDIndonesian
221 StrCpy $DictCodes "id_ID$DictCodes"
225 Section /o "Bahasa Melayu" SecDMalayan
226 StrCpy $DictCodes "ms_MY$DictCodes"
230 Section /o "Belarusian" SecDBelarusian
231 StrCpy $DictCodes "be_BY$DictCodes"
235 Section /o "Brezhoneg" SecDBreton
236 StrCpy $DictCodes "br_FR$DictCodes"
240 Section /o "Bulgarian" SecDBulgarian
241 StrCpy $DictCodes "bg_BG$DictCodes"
245 Section /o "Català" SecDCatalanian
246 StrCpy $DictCodes "ca_ES$DictCodes"
250 Section /o "Ce
\9atina" SecDCzech
251 StrCpy $DictCodes "cs_CZ$DictCodes"
255 Section /o "Cymraeg" SecDWelsh
256 StrCpy $DictCodes "cy_GB$DictCodes"
260 Section /o "Dansk" SecDDanish
261 StrCpy $DictCodes "da_DK$DictCodes"
265 Section /o "German (A)" SecDGermanAT
266 StrCpy $DictCodes "de_AT$DictCodes"
270 Section /o "German (CH)" SecDGermanCH
271 StrCpy $DictCodes "de_CH$DictCodes"
275 Section "German (D)" SecDGermanD
276 # already installed by default
277 #StrCpy $DictCodes "de_DE$DictCodes"
281 Section /o "Greek" SecDGreek
282 StrCpy $DictCodes "el_GR$DictCodes"
286 Section /o "Eesti" SecDEstonian
287 StrCpy $DictCodes "et_EE$DictCodes"
291 # enable this for LyX 2.1!
292 #Section /o "English (AU)" SecDEnglishAU
293 # StrCpy $DictCodes "en_AU$DictCodes"
297 Section /o "English (CA)" SecDEnglishCA
298 StrCpy $DictCodes "en_CA$DictCodes"
302 Section "English (GB)" SecDEnglishGB
303 # already installed by default
304 #StrCpy $DictCodes "en_GB$DictCodes"
308 # enable this for LyX 2.1!
309 #Section /o "English (NZ)" SecDEnglishNZ
310 # StrCpy $DictCodes "en_NZ$DictCodes"
314 Section "English (US)" SecDEnglishUS
315 # already installed by default
316 #StrCpy $DictCodes "en_US$DictCodes"
320 Section "Español (ES)" SecDSpanishES
321 # already installed by default
322 #StrCpy $DictCodes "es_ES$DictCodes"
326 Section "Español (MX)" SecDSpanishMX
327 # already installed by default
328 #StrCpy $DictCodes "es_MX$DictCodes"
332 Section /o "Esperanto" SecDEsperanto
333 StrCpy $DictCodes "eo_EO$DictCodes"
337 Section /o "Euskara" SecDBasque
338 StrCpy $DictCodes "eu_ES$DictCodes"
342 Section /o "Farsi" SecDFarsi
343 StrCpy $DictCodes "fa_IR$DictCodes"
347 Section "Français" SecDFrench
348 # already installed by default
349 #StrCpy $DictCodes "fr_FR$DictCodes"
353 Section /o "Gaeilge" SecDGaelic
354 StrCpy $DictCodes "ga_IR$DictCodes"
358 Section /o "Gàidhlig" SecDScottish
359 StrCpy $DictCodes "gd_GB$DictCodes"
363 Section /o "Galego" SecDGalician
364 StrCpy $DictCodes "gl_ES$DictCodes"
368 Section /o "Hebrew" SecDHebrew
369 StrCpy $DictCodes "he_IL$DictCodes"
373 Section /o "Hrvatski" SecDCroatian
374 StrCpy $DictCodes "hr_HR$DictCodes"
378 Section /o "Magyar" SecDHungarian
379 StrCpy $DictCodes "hu_HU$DictCodes"
383 Section /o "Interlingua" SecDInterlingua
384 StrCpy $DictCodes "ia_IA$DictCodes"
388 Section /o "Íslenska" SecDIcelandic
389 StrCpy $DictCodes "is_IS$DictCodes"
393 Section /o "Italiano" SecDItalian
394 StrCpy $DictCodes "it_IT$DictCodes"
398 Section /o "Kazakh" SecDKazakh
399 StrCpy $DictCodes "kk_KZ$DictCodes"
403 Section /o "Korean" SecDKorean
404 StrCpy $DictCodes "ko_KR$DictCodes"
408 Section /o "Latina" SecDLatin
409 StrCpy $DictCodes "la_LA$DictCodes"
413 Section /o "Lietuviu" SecDLithuanian
414 StrCpy $DictCodes "lt_LT$DictCodes"
418 Section /o "Latvie
\9au" SecDLatvian
419 StrCpy $DictCodes "lv_LV$DictCodes"
423 Section /o "Nederlands" SecDDutch
424 StrCpy $DictCodes "nl_NL$DictCodes"
428 Section /o "Norsk (Bokmål)" SecDNorwegianNB
429 StrCpy $DictCodes "nb_NO$DictCodes"
433 Section /o "Norsk (Nynorsk)" SecDNorwegianNN
434 StrCpy $DictCodes "nn_NO$DictCodes"
438 Section /o "Polski" SecDPolish
439 StrCpy $DictCodes "pl_PL$DictCodes"
443 Section /o "Português (BR)" SecDPortugueseBR
444 StrCpy $DictCodes "pt_BR$DictCodes"
448 Section /o "Português (PT)" SecDPortuguesePT
449 StrCpy $DictCodes "pt_PT$DictCodes"
453 Section /o "Româna" SecDRomanian
454 StrCpy $DictCodes "ro_RO$DictCodes"
458 Section "Russian" SecDRussian
459 # already installed by default
460 #StrCpy $DictCodes "ru_RU$DictCodes"
464 Section /o "Serb
\9acina (Dolno)" SecDSorbianD
465 StrCpy $DictCodes "db_DE$DictCodes"
469 Section /o "Serb
\9acina (Horno)" SecDSorbianH
470 StrCpy $DictCodes "hb_DE$DictCodes"
474 Section /o "Shqipe" SecDAlbanian
475 StrCpy $DictCodes "sq_AL$DictCodes"
479 Section /o "Sloven
\9acina" SecDSlowenian
480 StrCpy $DictCodes "sl_SI$DictCodes"
484 Section /o "Slovenský" SecDSlowakian
485 StrCpy $DictCodes "sk_SK$ThesCodes"
489 Section /o "Srpski" SecDSerbian
490 StrCpy $DictCodes "sr_RS$DictCodes"
494 Section /o "Svenska" SecDSwedish
495 StrCpy $DictCodes "sv_SE$DictCodes"
499 Section /o "Thai" SecDThai
500 StrCpy $DictCodes "th_TH$DictCodes"
504 Section /o "Ukrainian" SecDUkrainian
505 StrCpy $DictCodes "uk_UA$DictCodes"
509 Section /o "Vietnamese" SecDVietnamese
510 StrCpy $DictCodes "vi_VN$DictCodes"
516 SectionGroup "Thesaurus" SecThesaurus
518 Section /o "Bulgarian" SecTBulgarian
519 StrCpy $ThesCodes "bg_BG$ThesCodes"
523 Section /o "Català" SecTCatalan
524 StrCpy $ThesCodes "ca_ES$ThesCodes"
528 Section /o "Ce
\9atina" SecTCzech
529 StrCpy $ThesCodes "cs_CZ$ThesCodes"
533 Section /o "Dansk" SecTDanish
534 StrCpy $ThesCodes "da_DK$ThesCodes"
538 Section /o "Deutsch (D/A)" SecTGermanDA
539 StrCpy $ThesCodes "de_DE$ThesCodes"
543 Section /o "Deutsch (CH)" SecTGermanCH
544 StrCpy $ThesCodes "de_CH$ThesCodes"
548 Section /o "English (GB)" SecTEnglishGB
549 StrCpy $ThesCodes "en_GB$ThesCodes"
553 Section /o "English (US/AU)" SecTEnglishUSAU
554 StrCpy $ThesCodes "en_US$ThesCodes"
558 Section /o "Español" SecTSpanish
559 StrCpy $ThesCodes "es_ES$ThesCodes"
563 Section /o "Français" SecTFrench
564 StrCpy $ThesCodes "fr_FR$ThesCodes"
568 Section /o "Gaeilge" SecTGaelic
569 StrCpy $ThesCodes "ga_IR$ThesCodes"
573 Section /o "Greek" SecTGreek
574 StrCpy $ThesCodes "el_GR$ThesCodes"
578 Section /o "Italiano" SecTItalian
579 StrCpy $ThesCodes "it_IT$ThesCodes"
583 Section /o "Magyar" SecTHungarian
584 StrCpy $ThesCodes "hu_HU$ThesCodes"
588 Section /o "Norsk" SecTNorwegian
589 StrCpy $ThesCodes "no_NO$ThesCodes"
593 Section /o "Polski" SecTPolish
594 StrCpy $ThesCodes "pl_PL$ThesCodes"
598 Section /o "Português" SecTPortuguese
599 StrCpy $ThesCodes "pt_PT$ThesCodes"
603 Section /o "Româna" SecTRomanian
604 StrCpy $ThesCodes "ro_RO$ThesCodes"
608 Section /o "Russian" SecTRussian
609 StrCpy $ThesCodes "ru_RU$ThesCodes"
613 Section /o "Sloven
\9acina" SecTSlowenian
614 StrCpy $ThesCodes "sl_SI$ThesCodes"
618 Section /o "Slovenský" SecTSlowakian
619 StrCpy $ThesCodes "sk_SK$ThesCodes"
623 Section /o "Svenska" SecTSwedish
624 StrCpy $ThesCodes "sv_SE$ThesCodes"
630 # Section descriptions
631 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
632 !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
633 !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
634 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
635 !if ${SETUPTYPE} == BUNDLE
636 !insertmacro MUI_DESCRIPTION_TEXT ${SecInstJabRef} "$(SecInstJabRefDescription)"
638 !insertmacro MUI_FUNCTION_DESCRIPTION_END