]> git.lyx.org Git - features.git/blobdiff - development/Win32/packaging/installer/include/gui.nsh
Consider inset strings in simple find/replaceAll (#12049)
[features.git] / development / Win32 / packaging / installer / include / gui.nsh
index d3b9d7da7bd42419e52c69320fb4aafe4d0ac203..0e744636a501653f27165e5b2111a6dcfa6df9fd 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/*
 
 gui.nsh
 
@@ -12,9 +12,6 @@ Installer user interface settings
 Name "${APP_NAME} ${APP_VERSION}"
 BrandingText " "
 
-# Default installation folder
-InstallDir "${SETUP_DEFAULT_DIRECTORY}"
-
 #--------------------------------
 # Interface settings
 
@@ -26,49 +23,59 @@ InstallDir "${SETUP_DEFAULT_DIRECTORY}"
 !define MUI_HEADERIMAGE_RIGHT
 !define MUI_WELCOMEFINISHPAGE_BITMAP "${SETUP_WIZARDIMAGE}"
 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${SETUP_WIZARDIMAGE}"
-!define MUI_CUSTOMFUNCTION_GUIINIT InitInterface
-!define MUI_COMPONENTSPAGE_NODESC
 
 #--------------------------------
 # Pages
 
 # Installer
 
-!define MUI_WELCOMEPAGE_TITLE_3LINES
-!define MUI_WELCOMEPAGE_TEXT $(TEXT_WELCOME_${SETUPTYPE_NAME})
+# Welcome page
+!define MUI_WELCOMEPAGE_TEXT $(TEXT_WELCOME)
 !insertmacro MUI_PAGE_WELCOME
+
+# Show the license.
 !insertmacro MUI_PAGE_LICENSE "${FILES_LICENSE}"
-!insertmacro MULTIUSER_PAGE_INSTALLMODE
 
-Page custom PageReinstall PageReinstallValidate
-Page custom PageExternalLaTeX PageExternalLaTeXValidate
-Page custom PageExternalImageMagick PageExternalImageMagickValidate
-Page custom PageExternalGhostscript PageExternalGhostscriptValidate
-Page custom PageLanguage PageLanguageValidate
+# Decision if it should be installed as admin or not
+!insertmacro MULTIUSER_PAGE_INSTALLMODE
 
-!define MUI_PAGE_HEADER_TEXT $(TEXT_DICT_TITLE)
-!define MUI_PAGE_HEADER_SUBTEXT $(TEXT_DICT_SUBTITLE)
-!define MUI_COMPONENTSPAGE_TEXT_TOP $(TEXT_DICT_TOP)
-!define MUI_COMPONENTSPAGE_TEXT_COMPLIST $(TEXT_DICT_LIST)
-!insertmacro MUI_PAGE_COMPONENTS # For spell checker dictionaries
+#Page custom PageExternalLaTeX PageExternalLaTeXValidate
 
+# Specify the installation directory.
 !insertmacro MUI_PAGE_DIRECTORY
+
+# Define which components to install.
+!insertmacro MUI_PAGE_COMPONENTS
+
+# Specify where to install program shortcuts.
+!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
+!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${APP_NAME} ${APP_SERIES_NAME}"
+!insertmacro MUI_PAGE_STARTMENU ${APP_NAME} $StartmenuFolder
+
+# Select latex.exe manually
+Page custom LatexFolder LatexFolder_LeaveFunction
+
+# Watch the components being installed.
 !insertmacro MUI_PAGE_INSTFILES
 
-!define MUI_FINISHPAGE_RUN "$INSTDIR\${APP_RUN}"
-!define MUI_FINISHPAGE_SHOWREADME
-!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
-!define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateDesktopShortcut
-!define MUI_FINISHPAGE_SHOWREADME_TEXT $(TEXT_FINISH_DESKTOP)
+# The option to run LyX from the finish page is currently disabled because
+# it may run with Administrator priviledges, therefore causing a different
+# user directory to be used. This could be fixed by creating a separate
+# process without UAC elevation.
+# !define MUI_FINISHPAGE_RUN_TEXT "$(FinishPageRun)"
+# !define MUI_FINISHPAGE_RUN "$INSTDIR\${APP_RUN}"
+
+#!define MUI_FINISHPAGE_SHOWREADME
+#!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
+#!define MUI_FINISHPAGE_SHOWREADME_FUNCTION StartLyX
+#!define MUI_FINISHPAGE_SHOWREADME_TEXT $(FinishPageRun)
 !define MUI_FINISHPAGE_LINK $(TEXT_FINISH_WEBSITE)
-!define MUI_FINISHPAGE_LINK_LOCATION "http://www.lyx.org/"
-!define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckDesktopShortcut
+!define MUI_FINISHPAGE_LINK_LOCATION "https://www.lyx.org/"
+#!define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckDesktopShortcut
 !insertmacro MUI_PAGE_FINISH
 
 # Uninstaller
 
-!define MUI_WELCOMEPAGE_TITLE_3LINES
-!define MUI_WELCOMEPAGE_TEXT $(UNTEXT_WELCOME)
 !insertmacro MUI_UNPAGE_WELCOME
 !insertmacro MUI_UNPAGE_CONFIRM
 !insertmacro MUI_UNPAGE_COMPONENTS
@@ -79,35 +86,17 @@ Page custom PageLanguage PageLanguageValidate
 #--------------------------------
 # Installer Languages
 
-!macro LANG LANG_NAME
-  # NSIS language file
-  !insertmacro MUI_LANGUAGE "${LANG_NAME}"
-  # LyX language file
-  !insertmacro LANGFILE_INCLUDE_WITHDEFAULT "lang\${LANG_NAME}.nsh" "lang\English.nsh"
-!macroend
-
-!insertmacro LANG "english"
-!insertmacro LANG "french"
-!insertmacro LANG "german"
-!insertmacro LANG "italian"
+!include lang\TranslatedLanguages.nsh
 
 #--------------------------------
 # Version information
 
 VIProductVersion "${APP_VERSION_NUMBER}"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APP_NAME}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${APP_NAME} ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_REVISION} ${APP_SETUPTYPE} installer"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APP_INFO}"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APP_VERSION}"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "${APP_COPYRIGHT}"
-
-Function InitInterface
-
-  # Warn the user when no Administrator or Power user privileges are available
-  # These privileges are required to install ImageMagick or Ghostscript
-
-  ${If} $MultiUser.Privileges != "Admin"
-  ${andif} $MultiUser.Privileges != "Power"
-    MessageBox MB_OK|MB_ICONEXCLAMATION $(TEXT_NO_PRIVILEDGES)
-  ${EndIf}
-
-FunctionEnd
+VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${APP_NAME} Team"
+# Fixme: LyX should register the name "LyX" as trademark
+VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" ""