installer: port recent changes from branch

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40296 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2011-11-27 13:53:29 +00:00
parent 529a018bc3
commit 10a51558e7
6 changed files with 12 additions and 80 deletions

View File

@ -1,67 +0,0 @@
/*
reinstall.nsh
Verify whether the LyX version of the installer is already installed.
If yes, ask the user whether the program files need to be reinstalled.
*/
Var ReinstallPage
Var ReinstallPage.Info
Var ReinstallPage.CheckBox
Var ReinstallPage.CheckBox.State
Var InstalledVersion
# Page functions
Function PageReinstall
# Check whether this version is already installed
# If so, some registry key like Software/Lyx16 should exist
ReadRegStr $InstalledVersion SHELL_CONTEXT ${APP_REGKEY} "Version"
${If} $InstalledVersion != "${APP_VERSION_NUMBER}"
# Different version, go ahead
Abort
${EndIf}
# Same version is already installed, ask the user
!insertmacro MUI_HEADER_TEXT $(TEXT_REINSTALL_TITLE) $(TEXT_REINSTALL_SUBTITLE)
# Build the dialog
nsDialogs::Create /NOUNLOAD 1018
Pop $ReinstallPage
${NSD_CreateLabel} 0u 0u 300u 60u $(TEXT_REINSTALL_INFO)
Pop $ReinstallPage.Info
${NSD_CreateCheckBox} 20u 60u 280u 10u $(TEXT_REINSTALL_ENABLE)
Pop $ReinstallPage.CheckBox
${If} ${SectionIsSelected} ${SecProgramFiles}
${NSD_SetState} $ReinstallPage.CheckBox ${BST_CHECKED}
${Else}
${NSD_SetState} $ReinstallPage.CheckBox ${BST_UNCHECKED}
${EndIf}
nsDialogs::Show
FunctionEnd
Function PageReinstallValidate
# Get state of checkbox
${NSD_GetState} $ReinstallPage.CheckBox $ReinstallPage.CheckBox.State
# Set whether the programs files need to be installed
${If} $ReinstallPage.CheckBox.State = ${BST_CHECKED}
!insertmacro SelectSection ${SecProgramFiles}
${Else}
!insertmacro UnselectSection ${SecProgramFiles}
${EndIf}
FunctionEnd

View File

@ -93,7 +93,6 @@ Lists of files to include in the installer
!macro FileListMetaFile2EPS COMMAND DIRECTORY
${FILE}metafile2eps.exe"
${FILE}metafile2eps.dat"
!macroend

View File

@ -38,7 +38,6 @@ BrandingText " "
!insertmacro MULTIUSER_PAGE_INSTALLMODE
Page custom PageReinstall PageReinstallValidate
#Page custom PageExternalLaTeX PageExternalLaTeXValidate
# Specify the installation directory.

View File

@ -6,11 +6,15 @@ Compatible with NSIS 2.46
*/
# Do a Cyclic Redundancy Check to make sure the installer
# was not corrupted by the download.
CRCCheck force
#
# Make the installer as small as possible.
SetCompressor /SOLID lzma
# installer settings like version numbers
!include settings.nsh
!include settings.nsh
# declarations of LyX's registry keys and installer variant
!include include\declarations.nsh

View File

@ -200,8 +200,6 @@ Section -PSPrinter
ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
# Install printer and driver
ExecWait '$PrinterConf /if /f "$WINDIR\inf\ntprint.inf" /b "Metafile to EPS Converter" /r "FILE:" /m "MS Publisher Imagesetter"'
# Restore DEVMODE with proper settings
ExecWait '$PrinterConf /q /Sr /n "Metafile to EPS Converter" /a "$INSTDIR\bin\metafile2eps.dat" g'
${EndIf}

View File

@ -46,10 +46,6 @@ Section -ProgramFiles SecProgramFiles
SetOutPath "$INSTDIR"
# recursively copy all files under Python
File /r "${FILES_PYTHON}"
# add MSVC runtimes
#SetOutPath "$INSTDIR\python"
#!insertmacro FileListMSVC File "${FILES_MSVC}\"
# Compile all Pyton files to byte-code
# The user using the scripts may not have write access
@ -147,8 +143,10 @@ SectionEnd
NSISdl::download "${DOWNLOAD_${ID}}${APPEND}" "$PLUGINSDIR\${FILENAME}"
Pop ${RET} # Return value (OK if succesful)
${If} ${RET} != "OK"
# Download failed, try again (usally we get a different mirror)
${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}
@ -208,8 +206,9 @@ SectionEnd
!insertmacro DOWNLOAD_FILE $DownloadResult "${COMPONENT}" "${COMPONENT}Setup.exe" ""
${If} $DownloadResult != "OK"
# Download failed
${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}