]> git.lyx.org Git - lyx.git/blob - development/Win32/packaging/installer/include/gui.nsh
lots of installer improvements:
[lyx.git] / development / Win32 / packaging / installer / include / gui.nsh
1 /*
2
3 gui.nsh
4
5 Installer user interface settings
6
7 */
8
9 #--------------------------------
10 # General
11
12 Name "${APP_NAME} ${APP_VERSION}"
13 BrandingText " "
14
15 # Default installation folder
16 InstallDir "${SETUP_DEFAULT_DIRECTORY}"
17
18 #--------------------------------
19 # Interface settings
20
21 !define MUI_ABORTWARNING
22 !define MUI_ICON "${SETUP_ICON}"
23 !define MUI_UNICON "${SETUP_ICON}"
24 !define MUI_HEADERIMAGE
25 !define MUI_HEADERIMAGE_BITMAP "${SETUP_HEADERIMAGE}"
26 !define MUI_HEADERIMAGE_RIGHT
27 !define MUI_WELCOMEFINISHPAGE_BITMAP "${SETUP_WIZARDIMAGE}"
28 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${SETUP_WIZARDIMAGE}"
29 !define MUI_CUSTOMFUNCTION_GUIINIT InitInterface
30 !define MUI_COMPONENTSPAGE_NODESC
31
32 #--------------------------------
33 # Pages
34
35 # Installer
36
37 !define MUI_WELCOMEPAGE_TITLE_3LINES
38 !define MUI_WELCOMEPAGE_TEXT $(TEXT_WELCOME_${SETUPTYPE_NAME})
39 !insertmacro MUI_PAGE_WELCOME
40 !insertmacro MUI_PAGE_LICENSE "${FILES_LICENSE}"
41 !insertmacro MULTIUSER_PAGE_INSTALLMODE
42
43 Page custom PageReinstall PageReinstallValidate
44 Page custom PageExternalLaTeX PageExternalLaTeXValidate
45 Page custom PageExternalImageMagick PageExternalImageMagickValidate
46 Page custom PageExternalGhostscript PageExternalGhostscriptValidate
47 Page custom PageLanguage PageLanguageValidate
48
49 !define MUI_PAGE_HEADER_TEXT $(TEXT_DICT_TITLE)
50 !define MUI_PAGE_HEADER_SUBTEXT $(TEXT_DICT_SUBTITLE)
51 !define MUI_COMPONENTSPAGE_TEXT_TOP $(TEXT_DICT_TOP)
52 !define MUI_COMPONENTSPAGE_TEXT_COMPLIST $(TEXT_DICT_LIST)
53 !insertmacro MUI_PAGE_COMPONENTS # For spell checker dictionaries
54
55 !insertmacro MUI_PAGE_DIRECTORY
56 !insertmacro MUI_PAGE_INSTFILES
57
58 !define MUI_FINISHPAGE_RUN "$INSTDIR\${APP_RUN}"
59 !define MUI_FINISHPAGE_SHOWREADME
60 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
61 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateDesktopShortcut
62 !define MUI_FINISHPAGE_SHOWREADME_TEXT $(TEXT_FINISH_DESKTOP)
63 !define MUI_FINISHPAGE_LINK $(TEXT_FINISH_WEBSITE)
64 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.lyx.org/"
65 !define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckDesktopShortcut
66 !insertmacro MUI_PAGE_FINISH
67
68 # Uninstaller
69
70 !define MUI_WELCOMEPAGE_TITLE_3LINES
71 !define MUI_WELCOMEPAGE_TEXT $(UNTEXT_WELCOME)
72 !insertmacro MUI_UNPAGE_WELCOME
73 !insertmacro MUI_UNPAGE_CONFIRM
74 !insertmacro MUI_UNPAGE_COMPONENTS
75 !insertmacro MUI_UNPAGE_INSTFILES
76
77 !insertmacro MUI_UNPAGE_FINISH
78
79 #--------------------------------
80 # Installer Languages
81
82 !macro LANG LANG_NAME
83   # NSIS language file
84   !insertmacro MUI_LANGUAGE "${LANG_NAME}"
85   # LyX language file
86   !insertmacro LANGFILE_INCLUDE_WITHDEFAULT "lang\${LANG_NAME}.nsh" "lang\English.nsh"
87 !macroend
88
89 !insertmacro LANG "english"
90 !insertmacro LANG "french"
91 !insertmacro LANG "german"
92 !insertmacro LANG "italian"
93
94 #--------------------------------
95 # Version information
96
97 VIProductVersion "${APP_VERSION_NUMBER}"
98 VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APP_NAME}"
99 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APP_INFO}"
100 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APP_VERSION}"
101 VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "${APP_COPYRIGHT}"
102
103 Function InitInterface
104
105   # Warn the user when no Administrator or Power user privileges are available
106   # These privileges are required to install ImageMagick or Ghostscript
107
108   ${If} $MultiUser.Privileges != "Admin"
109   ${andif} $MultiUser.Privileges != "Power"
110     MessageBox MB_OK|MB_ICONEXCLAMATION $(TEXT_NO_PRIVILEDGES)
111   ${EndIf}
112
113 FunctionEnd