mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Win installer: code review
- use https in URLs - remove unused code - use variables if possible - LyX 2.3.x won't support Windows Vista because Qt 5.9 does not and other third-party programs will follow soon
This commit is contained in:
parent
7e34e65943
commit
851782953b
@ -44,7 +44,7 @@ Configuration of LyX installer
|
||||
|
||||
!define APP_NAME "LyX"
|
||||
!define APP_VERSION_NUMBER "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_REVISION}.${APP_VERSION_BUILD}"
|
||||
# for the proposed install folder we use the scheme "LyX 2.1" while we need for the registry the scheme "LyX 2.1.4"
|
||||
# for the proposed install folder we use the scheme "LyX 2.2" while we need for the registry the scheme "LyX 2.1.4"
|
||||
# to check if it is exactly this version (to support side by side installations)
|
||||
!define APP_SERIES_NAME "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}"
|
||||
!define APP_SERIES_KEY "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}"
|
||||
@ -53,11 +53,11 @@ Configuration of LyX installer
|
||||
!define APP_DIR "${APP_NAME} ${APP_SERIES_NAME}"
|
||||
!define APP_DIR_USERDATA "${APP_NAME}${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}"
|
||||
!define APP_INFO "${APP_NAME} - The Document Processor"
|
||||
!define APP_WEBPAGE "http://www.lyx.org/"
|
||||
!define APP_WEBPAGE "https://www.lyx.org/"
|
||||
!define APP_WEBPAGE_INFO "${APP_NAME} Website"
|
||||
!define APP_WIKI "http://wiki.lyx.org"
|
||||
!define APP_WIKI "https://wiki.lyx.org"
|
||||
!define APP_WIKI_INFO "${APP_NAME} Wiki"
|
||||
!define APP_COPYRIGHT "LyX is Copyright © 1995 by Matthias Ettrich, 1995-${COPYRIGHT_YEAR} by the LyX Team"
|
||||
!define APP_COPYRIGHT "${APP_NAME} is Copyright © 1995 by Matthias Ettrich, 1995-${COPYRIGHT_YEAR} by the ${APP_NAME} Team"
|
||||
!if ${SETUPTYPE} == STANDARD
|
||||
!define APP_SETUPTYPE "Standard"
|
||||
!else if ${SETUPTYPE} == BUNDLE
|
||||
|
@ -47,7 +47,7 @@ BrandingText " "
|
||||
|
||||
# Specify where to install program shortcuts.
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
||||
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "LyX ${APP_SERIES_NAME}"
|
||||
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${APP_NAME} ${APP_SERIES_NAME}"
|
||||
!insertmacro MUI_PAGE_STARTMENU ${APP_NAME} $StartmenuFolder
|
||||
|
||||
!if ${SETUPTYPE} != BUNDLE
|
||||
@ -70,7 +70,7 @@ BrandingText " "
|
||||
!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_FINISHPAGE_LINK_LOCATION "https://www.lyx.org/"
|
||||
#!define MUI_PAGE_CUSTOMFUNCTION_SHOW CheckDesktopShortcut
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
@ -97,6 +97,6 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${APP_NAME} ${APP_VERSIO
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APP_INFO}"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APP_VERSION}"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "${APP_COPYRIGHT}"
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "LyX Team"
|
||||
# Fixme: LyX should register the name LyX as trademark
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${APP_NAME} Team"
|
||||
# Fixme: LyX should register the name "LyX" as trademark
|
||||
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" ""
|
||||
|
@ -599,7 +599,8 @@ Function .onInit
|
||||
${if} $R0 == "5.0" # 2000
|
||||
${orif} $R0 == "5.1" # XP
|
||||
${orif} $R0 == "5.2" # 2003
|
||||
MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows Vista or newer." /SD IDOK
|
||||
${orif} $R0 == "6.0" # Vista
|
||||
MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows 7 or newer." /SD IDOK
|
||||
Quit
|
||||
${endif}
|
||||
|
||||
@ -620,7 +621,7 @@ Function .onInit
|
||||
!endif
|
||||
|
||||
# Check that LyX is not currently running
|
||||
FindProcDLL::FindProc "lyx.exe"
|
||||
FindProcDLL::FindProc "${BIN_LYX}"
|
||||
${if} $R0 == "1"
|
||||
MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)" /SD IDOK
|
||||
Abort
|
||||
@ -650,7 +651,7 @@ Function .onInit
|
||||
# because he won't have a chance to deny this
|
||||
StrCpy $4 $0 -10 # remove '\bin\lyx,0'
|
||||
# (for FileCheck the variables $0 and $1 cannot be used)
|
||||
!insertmacro FileCheck $5 "Uninstall-LyX.exe" "$4" # macro from LyXUtils.nsh
|
||||
!insertmacro FileCheck $5 "Uninstall-${APP_NAME}.exe" "$4" # macro from LyXUtils.nsh
|
||||
${if} $5 == "False"
|
||||
Goto ForceInstallation
|
||||
${endif}
|
||||
@ -1429,7 +1430,7 @@ Function un.onInit
|
||||
!insertmacro MULTIUSER_UNINIT
|
||||
|
||||
# Check that LyX is not currently running
|
||||
FindProcDLL::FindProc "lyx.exe"
|
||||
FindProcDLL::FindProc "${BIN_LYX}"
|
||||
${if} $R0 == "1"
|
||||
MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)" /SD IDOK
|
||||
Abort
|
||||
|
@ -26,10 +26,10 @@ These typically need to be modified for each LyX release
|
||||
# Typical names for the release are "LyX-211-Installer-1.exe" etc.
|
||||
|
||||
!ifndef ExeFile
|
||||
!define ExeFile "LyX-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}-Installer-${APP_VERSION_BUILD}.exe"
|
||||
!define ExeFile "${APP_NAME}-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}-Installer-${APP_VERSION_BUILD}.exe"
|
||||
!endif
|
||||
!ifndef BundleExeFile
|
||||
!define BundleExeFile "LyX-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}-Bundle-${APP_VERSION_BUILD}.exe"
|
||||
!define BundleExeFile "${APP_NAME}-${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}-Bundle-${APP_VERSION_BUILD}.exe"
|
||||
!endif
|
||||
|
||||
#--------------------------------
|
||||
|
@ -48,9 +48,9 @@ Section -InstallData
|
||||
WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayVersion" "${APP_VERSION}"
|
||||
WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayIcon" "$INSTDIR\bin\lyx,0"
|
||||
WriteRegStr SHCTX ${APP_UNINST_KEY} "URLUpdateInfo" "${APP_WEBPAGE}"
|
||||
WriteRegStr SHCTX ${APP_UNINST_KEY} "URLInfoAbout" "http://www.lyx.org/AboutLyX"
|
||||
WriteRegStr SHCTX ${APP_UNINST_KEY} "Publisher" "LyX Team"
|
||||
WriteRegStr SHCTX ${APP_UNINST_KEY} "HelpLink" "http://www.lyx.org/MailingLists"
|
||||
WriteRegStr SHCTX ${APP_UNINST_KEY} "URLInfoAbout" "https://www.lyx.org/AboutLyX"
|
||||
WriteRegStr SHCTX ${APP_UNINST_KEY} "Publisher" "${APP_NAME} Team"
|
||||
WriteRegStr SHCTX ${APP_UNINST_KEY} "HelpLink" "https://www.lyx.org/MailingLists"
|
||||
WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoModify" 0x00000001
|
||||
WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoRepair" 0x00000001
|
||||
WriteRegStr SHCTX ${APP_UNINST_KEY} "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
|
||||
@ -265,34 +265,13 @@ Section -ConfigureScript
|
||||
SectionEnd
|
||||
|
||||
#--------------------------------
|
||||
# Desktop shortcut
|
||||
#
|
||||
|
||||
Function StartLyX
|
||||
|
||||
# run LyX in a command line window to give the users feedback about
|
||||
# the time consuming LaTeX package installation
|
||||
|
||||
#Exec 'cmd /K " "$INSTDIR\bin\lyx.exe""'
|
||||
Exec "$INSTDIR\${APP_RUN}"
|
||||
|
||||
FunctionEnd
|
||||
|
||||
/*Function CheckDesktopShortcut
|
||||
|
||||
# Enable desktop icon creation when there is an icon already
|
||||
# Old shortcuts need to be updated
|
||||
|
||||
${If} ${FileExists} "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
|
||||
${NSD_SetState} $mui.FinishPage.ShowReadme ${BST_CHECKED}
|
||||
${EndIf}
|
||||
|
||||
FunctionEnd
|
||||
|
||||
Function CreateDesktopShortcut
|
||||
|
||||
# Desktop icon creation is an option on the finish page
|
||||
SetOutPath "$INSTDIR\bin"
|
||||
CreateShortCut "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"
|
||||
|
||||
FunctionEnd*/
|
||||
|
||||
|
@ -161,125 +161,3 @@ Section -ProgramFiles SecProgramFiles
|
||||
WriteUninstaller "$INSTDIR\${SETUP_UNINSTALLER}"
|
||||
|
||||
SectionEnd
|
||||
|
||||
#--------------------------------
|
||||
# Support code for file downloads
|
||||
|
||||
!macro DOWNLOAD_FILE RET ID FILENAME APPEND
|
||||
|
||||
# Downloads a file
|
||||
|
||||
# RET = Return value (OK if succesful)
|
||||
# ID = Name of the download in settings.nsh
|
||||
# FILENAME = Location to store file
|
||||
# APPEND = Filename to append to server location in settings.nsh
|
||||
|
||||
# Try first time
|
||||
NSISdl::download "${DOWNLOAD_${ID}}${APPEND}" "$PLUGINSDIR\${FILENAME}"
|
||||
Pop ${RET} # Return value (OK if succesful)
|
||||
|
||||
${If} ${RET} != "success"
|
||||
${AndIf} ${RET} != "cancel"
|
||||
# Download failed, try once again before giving up
|
||||
# (usally we get a different mirror)
|
||||
NSISdl::download "${DOWNLOAD_${ID}}${APPEND}" "$PLUGINSDIR\${FILENAME}"
|
||||
Pop ${RET}
|
||||
${EndIf}
|
||||
|
||||
!macroend
|
||||
|
||||
#--------------------------------
|
||||
# External components
|
||||
|
||||
#Var PathAllUsers
|
||||
#Var PathCurrentUser
|
||||
|
||||
!macro EXTERNAL COMPONENT
|
||||
|
||||
# Download/Install the component
|
||||
|
||||
${If} $Setup${COMPONENT} == ${TRUE}
|
||||
|
||||
StrCpy $Path${COMPONENT} "" ;A new one will be installed
|
||||
|
||||
!ifndef BUNDLESETUP_${COMPONENT}
|
||||
!insertmacro EXTERNAL_DOWNLOAD ${COMPONENT}
|
||||
!else
|
||||
!insertmacro EXTERNAL_INSTALL ${COMPONENT}
|
||||
!endif
|
||||
|
||||
${EndIf}
|
||||
|
||||
!macroend
|
||||
|
||||
!macro EXTERNAL_RUNINSTALLER COMPONENT
|
||||
|
||||
# Run the installer application of the component that does the actual installation.
|
||||
|
||||
install_${COMPONENT}:
|
||||
|
||||
ExecWait '"$PLUGINSDIR\${COMPONENT}Setup.exe"'
|
||||
|
||||
# Updates the path environment variable of the installer process to the latest system value
|
||||
# ReadRegStr $PathAllUsers HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" Path
|
||||
# ReadRegStr $PathCurrentUser HKCU "Environment" Path
|
||||
# System::Call 'kernel32::SetEnvironmentVariableA(t, t) i("Path", "$PathAllUsers;$PathCurrentUser").'
|
||||
|
||||
Call Search${COMPONENT}
|
||||
|
||||
${If} $Path${COMPONENT} == ""
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION $(TEXT_NOTINSTALLED_${COMPONENT}) IDYES install_${COMPONENT}
|
||||
${EndIf}
|
||||
|
||||
Delete "$PLUGINSDIR\${COMPONENT}Setup.exe"
|
||||
|
||||
!macroend
|
||||
|
||||
!macro EXTERNAL_DOWNLOAD COMPONENT
|
||||
|
||||
download_${COMPONENT}:
|
||||
|
||||
!insertmacro DOWNLOAD_FILE $DownloadResult "${COMPONENT}" "${COMPONENT}Setup.exe" ""
|
||||
|
||||
${If} $DownloadResult != "success"
|
||||
${AndIf} $DownloadResult != "cancel"
|
||||
# Download failed after trying twice - ask user
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_DOWNLOAD_FAILED_${COMPONENT}) ($DownloadResult)" IDYES download_${COMPONENT}
|
||||
Goto noinstall_${COMPONENT}
|
||||
${EndIf}
|
||||
|
||||
!insertmacro EXTERNAL_RUNINSTALLER ${COMPONENT}
|
||||
|
||||
noinstall_${COMPONENT}:
|
||||
|
||||
!macroend
|
||||
|
||||
!macro EXTERNAL_INSTALL COMPONENT
|
||||
|
||||
# Extract
|
||||
File /oname=$PLUGINSDIR\${COMPONENT}Setup.exe ${FILES_BUNDLE}\${INSTALL_${COMPONENT}}
|
||||
|
||||
!insertmacro EXTERNAL_RUNINSTALLER ${COMPONENT}
|
||||
|
||||
!macroend
|
||||
|
||||
|
||||
# Sections for external components
|
||||
|
||||
#Section -LaTeX ExternalLaTeX
|
||||
# !insertmacro EXTERNAL LaTeX
|
||||
#SectionEnd
|
||||
|
||||
/*Function InitExternal
|
||||
|
||||
# Get sizes of external component installers
|
||||
|
||||
#SectionGetSize ${ExternalLaTeX} $SizeLaTeX
|
||||
|
||||
# Add download size
|
||||
|
||||
!ifndef BUNDLESETUP_MIKTEX
|
||||
IntOp $SizeLaTeX $SizeLaTeX + ${SIZE_DOWNLOAD_LATEX}
|
||||
!endif
|
||||
|
||||
FunctionEnd*/
|
||||
|
@ -63,7 +63,7 @@ Section "un.LyX" un.SecUnProgramFiles
|
||||
${endif}
|
||||
${endif}
|
||||
${if} $MultiUser.Privileges == "Admin"
|
||||
DeleteRegKey HKCR "LyX.Document"
|
||||
DeleteRegKey HKCR "${APP_NAME}.Document"
|
||||
${endif}
|
||||
|
||||
# Uninstaller itself
|
||||
@ -77,9 +77,9 @@ Section "un.LyX" un.SecUnProgramFiles
|
||||
DeleteRegKey SHCTX "${APP_REGKEY_SETUP}"
|
||||
DeleteRegKey SHCTX "${APP_REGKEY}"
|
||||
DeleteRegKey SHCTX "${APP_UNINST_KEY}"
|
||||
DeleteRegKey HKCR "Applications\lyx.exe"
|
||||
DeleteRegValue HKCR "LyX.Document\Shell\open\command" ""
|
||||
DeleteRegValue HKCR "LyX.Document\DefaultIcon" ""
|
||||
DeleteRegKey HKCR "Applications\${BIN_LYX}"
|
||||
DeleteRegValue HKCR "${APP_NAME}.Document\Shell\open\command" ""
|
||||
DeleteRegValue HKCR "${APP_NAME}.Document\DefaultIcon" ""
|
||||
|
||||
# File associations
|
||||
ReadRegStr $FileAssociation SHELL_CONTEXT "Software\Classes\${APP_EXT}" ""
|
||||
@ -115,7 +115,7 @@ Section /o "un.$(UnLyXPreferencesTitle)" un.SecUnPreferences
|
||||
StrCpy $AppSubfolder ${APP_DIR_USERDATA}
|
||||
Call un.DelAppPathSub # function from LyXUtils.nsh
|
||||
# remove registry settings
|
||||
DeleteRegKey HKCU "Software\LyX\LyX${APP_SERIES_NAME}"
|
||||
DeleteRegKey HKCU "Software\${APP_NAME}\${APP_NAME}${APP_SERIES_NAME}"
|
||||
|
||||
SectionEnd
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user