improved user interface
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3374 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
66151af376
commit
71bcd120d3
6 changed files with 276 additions and 254 deletions
60
Contrib/NSIS Update/Method.ini
Normal file
60
Contrib/NSIS Update/Method.ini
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
[Settings]
|
||||||
|
NumFields=7
|
||||||
|
|
||||||
|
[Field 1]
|
||||||
|
Type=RadioButton
|
||||||
|
Text=Check for a new tested release (recommended)
|
||||||
|
State=1
|
||||||
|
Left=4
|
||||||
|
Right=-73
|
||||||
|
Top=4
|
||||||
|
Bottom=12
|
||||||
|
|
||||||
|
[Field 2]
|
||||||
|
Type=RadioButton
|
||||||
|
Text=Download the latest development files and merge your changes
|
||||||
|
Left=4
|
||||||
|
Right=-41
|
||||||
|
Top=38
|
||||||
|
Bottom=46
|
||||||
|
|
||||||
|
[Field 3]
|
||||||
|
Type=RadioButton
|
||||||
|
Text=Download a clean copy of the latest development files
|
||||||
|
Left=4
|
||||||
|
Right=-9
|
||||||
|
Top=87
|
||||||
|
Bottom=95
|
||||||
|
|
||||||
|
[Field 4]
|
||||||
|
Type=Label
|
||||||
|
Text=Checks the NSIS Website for a new tested NSIS release.
|
||||||
|
Left=21
|
||||||
|
Right=303
|
||||||
|
Top=19
|
||||||
|
Bottom=27
|
||||||
|
|
||||||
|
[Field 5]
|
||||||
|
Type=Label
|
||||||
|
Text=Downloads the development files from the CVS server. Use them to test the latest cutting-edge features and bugfixes. Not recommended for production environments. This update option merges changes you made in text files.
|
||||||
|
Left=21
|
||||||
|
Right=303
|
||||||
|
Top=52
|
||||||
|
Bottom=81
|
||||||
|
|
||||||
|
[Field 6]
|
||||||
|
Type=Label
|
||||||
|
Text=Same as the options above, but removes any changes you made in the NSIS files.
|
||||||
|
Left=21
|
||||||
|
Right=300
|
||||||
|
Top=102
|
||||||
|
Bottom=110
|
||||||
|
|
||||||
|
[Field 7]
|
||||||
|
Type=Label
|
||||||
|
Text=Important: Please close all other NSIS utilities before updating.
|
||||||
|
Left=5
|
||||||
|
Right=-9
|
||||||
|
Top=126
|
||||||
|
Bottom=137
|
||||||
|
|
|
@ -1,45 +1,37 @@
|
||||||
# NSIS Update
|
; NSIS Update
|
||||||
#####################################################################
|
;--------------------------------
|
||||||
# Original version Copyright (C) 2002-2003 Nathan Purciful.
|
|
||||||
# Version for NSIS distribution Copyright (C) 2003 Joost Verburg.
|
|
||||||
#
|
|
||||||
# This software is provided 'as-is', without any express or implied
|
|
||||||
# warranty. In no event will the authors be held liable for any
|
|
||||||
# damages arising from the use of this software.
|
|
||||||
#
|
|
||||||
# Permission is granted to anyone to use this software for any purpose,
|
|
||||||
# including commercial applications, and to alter it and redistribute
|
|
||||||
# it freely, subject to the following restrictions:
|
|
||||||
#
|
|
||||||
# 1. The origin of this software must not be misrepresented; you must
|
|
||||||
# not claim that you wrote the original software. If you use this
|
|
||||||
# software in a product, an acknowledgment in the product
|
|
||||||
# documentation would be appreciated but is not required.
|
|
||||||
# 2. Altered source versions must be plainly marked as such, and must
|
|
||||||
# not be misrepresented as being the original software.
|
|
||||||
# 3. This notice may not be removed or altered from any source
|
|
||||||
# distribution.
|
|
||||||
#
|
|
||||||
# This program uses CVSNT software, http://www.cvsnt.org/
|
|
||||||
#
|
|
||||||
#####################################################################
|
|
||||||
# Defines / Includes
|
|
||||||
|
|
||||||
!define MISSINGFILES $0
|
; Original version Copyright (C) 2002-2003 Nathan Purciful.
|
||||||
!define NSISBINPATH $1
|
; Version for NSIS distribution Copyright (C) 2003-2004 Joost Verburg.
|
||||||
|
;
|
||||||
|
; This software is provided 'as-is', without any express or implied
|
||||||
|
; warranty. In no event will the authors be held liable for any
|
||||||
|
; damages arising from the use of this software.
|
||||||
|
;
|
||||||
|
; Permission is granted to anyone to use this software for any purpose,
|
||||||
|
; including commercial applications, and to alter it and redistribute
|
||||||
|
; it freely, subject to the following restrictions:
|
||||||
|
;
|
||||||
|
; 1. The origin of this software must not be misrepresented; you must
|
||||||
|
; not claim that you wrote the original software. If you use this
|
||||||
|
; software in a product, an acknowledgment in the product
|
||||||
|
; documentation would be appreciated but is not required.
|
||||||
|
; 2. Altered source versions must be plainly marked as such, and must
|
||||||
|
; not be misrepresented as being the original software.
|
||||||
|
; 3. This notice may not be removed or altered from any source
|
||||||
|
; distribution.
|
||||||
|
;
|
||||||
|
; This program uses CVSNT software, http://www.cvsnt.org/
|
||||||
|
|
||||||
!define TEMP1 $R0
|
;--------------------------------
|
||||||
!define TEMP2 $R1
|
;Header files
|
||||||
!define TEMP3 $R2
|
|
||||||
|
|
||||||
!verbose 3
|
!include "MUI.nsh"
|
||||||
!include "WinMessages.nsh"
|
|
||||||
!verbose 4
|
|
||||||
|
|
||||||
!addplugindir "${NSISDIR}\Contrib\NSIS Update\Resources\BIN"
|
!addplugindir "${NSISDIR}\Contrib\NSIS Update"
|
||||||
|
|
||||||
#####################################################################
|
;--------------------------------
|
||||||
# Configuration
|
;Configuration
|
||||||
|
|
||||||
Name "NSIS Update"
|
Name "NSIS Update"
|
||||||
Caption "NSIS Update"
|
Caption "NSIS Update"
|
||||||
|
@ -50,23 +42,54 @@ InstallButtonText "Update"
|
||||||
ShowInstDetails show
|
ShowInstDetails show
|
||||||
InstallColors /windows
|
InstallColors /windows
|
||||||
|
|
||||||
ChangeUI IDD_INST "Resources\GUI\NSISUpdate.exe"
|
;--------------------------------
|
||||||
ChangeUI IDD_INSTFILES "Resources\GUI\NSISUpdate.exe"
|
;Variables
|
||||||
|
|
||||||
Icon "${NSISDIR}\Contrib\Graphics\Icons\arrow-install.ico"
|
Var TEMP1
|
||||||
|
Var TEMP2
|
||||||
|
Var TEMP3
|
||||||
|
|
||||||
XPStyle on
|
Var MISSINGFILES
|
||||||
|
Var NSISBINPATH
|
||||||
|
|
||||||
Page custom UpdateMethod "" ": Update Method"
|
Var OUTDIRFULL
|
||||||
Page instfiles
|
|
||||||
|
|
||||||
#####################################################################
|
;--------------------------------
|
||||||
# Macros
|
;Interface Settings
|
||||||
|
|
||||||
|
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\arrow2-install.ico"
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
|
;Pages
|
||||||
|
|
||||||
|
Page custom UpdateMethod UpdateLeave
|
||||||
|
|
||||||
|
!define MUI_PAGE_HEADER_TEXT ""
|
||||||
|
!define MUI_PAGE_HEADER_SUBTEXT ""
|
||||||
|
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "Task Completed"
|
||||||
|
!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "See the log window below for details."
|
||||||
|
!define MUI_INSTFILESPAGE_ABORTHEADER_TEXT "Error"
|
||||||
|
!define MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT "NSIS Update was not completed succesfully."
|
||||||
|
|
||||||
|
!insertmacro MUI_PAGE_INSTFILES
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
|
;Languages
|
||||||
|
|
||||||
|
!insertmacro MUI_LANGUAGE "English"
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
|
;Custom Interface
|
||||||
|
|
||||||
|
ChangeUI IDD_INSTFILES "UI.exe"
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
|
;Macros
|
||||||
|
|
||||||
!macro checkFile PATH FILE
|
!macro checkFile PATH FILE
|
||||||
|
|
||||||
IfFileExists "${PATH}\${FILE}" +2
|
IfFileExists "${PATH}\${FILE}" +2
|
||||||
StrCpy ${MISSINGFILES} "${FILE} ${MISSINGFILES}"
|
StrCpy $MISSINGFILES "${FILE} $MISSINGFILES"
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
|
@ -75,42 +98,36 @@ Page instfiles
|
||||||
IfFileExists "${PATH}\${FILE}" "Done_${FILE}"
|
IfFileExists "${PATH}\${FILE}" "Done_${FILE}"
|
||||||
|
|
||||||
NSISdl::download "http://nsis.sourceforge.net/nsisupdate/${FILE}.dat" "${PATH}\${FILE}.dat"
|
NSISdl::download "http://nsis.sourceforge.net/nsisupdate/${FILE}.dat" "${PATH}\${FILE}.dat"
|
||||||
Pop ${TEMP1}
|
Pop $TEMP1
|
||||||
|
|
||||||
StrCmp ${TEMP1} "success" "Extract_${FILE}"
|
StrCmp $TEMP1 "success" "Extract_${FILE}"
|
||||||
MessageBox MB_OK|MB_ICONSTOP "Download failed: ${TEMP1}."
|
MessageBox MB_OK|MB_ICONSTOP "Download failed: $TEMP1."
|
||||||
Quit
|
Quit
|
||||||
|
|
||||||
Push ${TEMP1}
|
|
||||||
|
|
||||||
"Extract_${FILE}:"
|
"Extract_${FILE}:"
|
||||||
ExtractDLL::extract "${PATH}\${FILE}" "${PATH}\${FILE}.dat"
|
ExtractDLL::extract "${PATH}\${FILE}" "${PATH}\${FILE}.dat"
|
||||||
Delete "${PATH}\${FILE}.dat"
|
Delete "${PATH}\${FILE}.dat"
|
||||||
|
|
||||||
Pop ${TEMP1}
|
Pop $TEMP1
|
||||||
StrCmp ${TEMP1} "success" +3
|
StrCmp $TEMP1 "success" +3
|
||||||
MessageBox MB_OK|MB_ICONSTOP "Extraction failed: ${TEMP1}."
|
MessageBox MB_OK|MB_ICONSTOP "Extraction failed: $TEMP1."
|
||||||
Quit
|
Quit
|
||||||
|
|
||||||
Pop ${TEMP1}
|
|
||||||
|
|
||||||
"Done_${FILE}:"
|
"Done_${FILE}:"
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
#####################################################################
|
;--------------------------------
|
||||||
# Functions
|
; Functions
|
||||||
|
|
||||||
Function .onInit
|
Function .onInit
|
||||||
|
|
||||||
Push ${TEMP1}
|
|
||||||
|
|
||||||
System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
|
System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
|
||||||
|
|
||||||
StrCpy ${TEMP1} ${TEMP1} "" -14
|
StrCpy $R0 $R0 "" -14
|
||||||
StrCmp ${TEMP1} "NSISUpdate.bin" temp
|
StrCmp $R0 "NSISUpdate.bin" temp
|
||||||
|
|
||||||
# Create a temporary file, so NSIS Update can update itself
|
;Create a temporary file, so NSIS Update can update itself
|
||||||
|
|
||||||
CopyFiles /SILENT "$EXEDIR\NSISUpdate.exe" "$TEMP\NSISUpdate.bin"
|
CopyFiles /SILENT "$EXEDIR\NSISUpdate.exe" "$TEMP\NSISUpdate.bin"
|
||||||
Exec '"$TEMP\NSISUpdate.bin" $EXEDIR'
|
Exec '"$TEMP\NSISUpdate.bin" $EXEDIR'
|
||||||
|
@ -118,62 +135,69 @@ Function .onInit
|
||||||
|
|
||||||
temp:
|
temp:
|
||||||
|
|
||||||
Pop ${TEMP1}
|
;Close the NSIS Menu (files in use cannot be updated)
|
||||||
|
|
||||||
# Close the NSIS Menu (files in use cannot be updated)
|
|
||||||
|
|
||||||
Call CloseMenu
|
Call CloseMenu
|
||||||
|
|
||||||
# Remove temporary file on next reboot
|
;Remove temporary file on next reboot
|
||||||
|
|
||||||
Delete /REBOOTOK "$TEMP\NSISUpdate.bin"
|
Delete /REBOOTOK "$TEMP\NSISUpdate.bin"
|
||||||
|
|
||||||
# Get NSIS directory
|
;Get NSIS directory
|
||||||
|
|
||||||
Call GetParameters
|
Call GetParameters
|
||||||
Pop ${NSISBINPATH}
|
Pop $NSISBINPATH
|
||||||
|
|
||||||
# InstallOptions INI File for the "Update Method" dialog
|
;InstallOptions INI File for the "Update Method" dialog
|
||||||
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "Method.ini"
|
||||||
|
|
||||||
InitPluginsdir
|
;Check for pserver CVS access
|
||||||
File "/oname=$PLUGINSDIR\io.ini" "Resources\GUI\io.ini"
|
IfFileExists "$NSISBINPATH\..\Cvs\Root" 0 done
|
||||||
|
|
||||||
|
FileOpen $TEMP1 "$NSISBINPATH\..\CVS\Root" r
|
||||||
|
FileRead $TEMP1 $TEMP2 9
|
||||||
|
FileClose $TEMP1
|
||||||
|
|
||||||
|
StrCmp $TEMP2 ":pserver:" done
|
||||||
|
|
||||||
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "Method.ini" "Field 2" "Flags" "DISABLED"
|
||||||
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "Method.ini" "Field 3" "Flags" "DISABLED"
|
||||||
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "Method.ini" "Field 5" "Flags" "DISABLED"
|
||||||
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "Method.ini" "Field 6" "Flags" "DISABLED"
|
||||||
|
|
||||||
|
done:
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function CheckCVSAccess
|
Function UpdateMethod
|
||||||
|
|
||||||
IfFileExists "${NSISBINPATH}\..\Cvs\Root" +2
|
!insertmacro MUI_HEADER_TEXT "Update Method" "Please select how you would like to update your NSIS files."
|
||||||
Return
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "Method.ini"
|
||||||
|
|
||||||
Push ${TEMP1}
|
FunctionEnd
|
||||||
Push ${TEMP2}
|
|
||||||
|
|
||||||
FileOpen ${TEMP1} "${NSISBINPATH}\..\CVS\Root" r
|
Function UpdateLeave
|
||||||
FileRead ${TEMP1} ${TEMP2} 9
|
|
||||||
FileClose ${TEMP1}
|
|
||||||
|
|
||||||
StrCmp ${TEMP2} ":pserver:" AccessOK
|
!insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 "Method.ini" "Field 1" "State"
|
||||||
|
StrCmp $TEMP1 "1" nocvs
|
||||||
|
|
||||||
MessageBox MB_OK|MB_ICONSTOP "NSIS Update only supports anonymous CVS access.$\r$\nNSIS developers should use a client with support for the :ext: access mode."
|
StrCpy $MISSINGFILES ""
|
||||||
Quit
|
|
||||||
|
|
||||||
AccessOK:
|
Call CheckCVSData
|
||||||
|
Call CheckCVSFiles
|
||||||
|
Call CheckCVSDownload
|
||||||
|
|
||||||
Pop ${TEMP2}
|
nocvs:
|
||||||
Pop ${TEMP1}
|
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function CheckCVSFiles
|
Function CheckCVSFiles
|
||||||
|
|
||||||
!insertmacro checkFile "${NSISBINPATH}" "cvs95.exe"
|
!insertmacro checkFile "$NSISBINPATH" "cvs95.exe"
|
||||||
!insertmacro checkFile "$SYSDIR" "msvcr70.dll"
|
!insertmacro checkFile "$SYSDIR" "msvcr70.dll"
|
||||||
!insertmacro checkFile "$SYSDIR" "msvcp70.dll"
|
!insertmacro checkFile "$SYSDIR" "msvcp70.dll"
|
||||||
!insertmacro checkFile "${NSISBINPATH}" "pserver_protocol.dll"
|
!insertmacro checkFile "$NSISBINPATH" "pserver_protocol.dll"
|
||||||
|
|
||||||
StrCmp ${MISSINGFILES} "" done
|
StrCmp $MISSINGFILES "" done
|
||||||
MessageBox MB_YESNO|MB_ICONQUESTION "NSIS update has to download a few small CVS client files in order to be able to update your NSIS files.$\r$\nThese files only have to be download once. Do you want to download them now?$\r$\n$\r$\nRequired Files: ${MISSINGFILES}" IDYES Done
|
MessageBox MB_YESNO|MB_ICONQUESTION "NSIS update has to download a few small CVS client files in order to be able to update your NSIS files.$\r$\nThese files only have to be download once. Do you want to download them now?$\r$\n$\r$\nRequired Files: $MISSINGFILES" IDYES Done
|
||||||
Quit
|
Abort
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
|
@ -181,14 +205,14 @@ FunctionEnd
|
||||||
|
|
||||||
Function CheckCVSDownload
|
Function CheckCVSDownload
|
||||||
|
|
||||||
StrCmp ${MISSINGFILES} "" done
|
StrCmp $MISSINGFILES "" done
|
||||||
|
|
||||||
SendMessage ${TEMP3} ${WM_SETTEXT} 0 "STR:Downloading CVS client files..."
|
!insertmacro MUI_HEADER_TEXT "Downloading..." "Please wait while NSIS Update downloads CVS client files."
|
||||||
|
|
||||||
!insertmacro checkFileDownload "${NSISBINPATH}" "cvs95.exe"
|
!insertmacro checkFileDownload "$NSISBINPATH" "cvs95.exe"
|
||||||
!insertmacro checkFileDownload "$SYSDIR" "msvcr70.dll"
|
!insertmacro checkFileDownload "$SYSDIR" "msvcr70.dll"
|
||||||
!insertmacro checkFileDownload "$SYSDIR" "msvcp70.dll"
|
!insertmacro checkFileDownload "$SYSDIR" "msvcp70.dll"
|
||||||
!insertmacro checkFileDownload "${NSISBINPATH}" "pserver_protocol.dll"
|
!insertmacro checkFileDownload "$NSISBINPATH" "pserver_protocol.dll"
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
|
@ -196,32 +220,21 @@ FunctionEnd
|
||||||
|
|
||||||
Function CheckCVSData
|
Function CheckCVSData
|
||||||
|
|
||||||
IfFileExists "${NSISBINPATH}\..\CVS\Root" datainstalled
|
IfFileExists "$NSISBINPATH\..\CVS\Root" datainstalled
|
||||||
|
|
||||||
IfFileExists "${NSISBINPATH}\InstallCVSData.exe" +3
|
IfFileExists "$NSISBINPATH\InstallCVSData.exe" +3
|
||||||
MessageBox MB_OK|MB_ICONSTOP "CVS Data Setup not found."
|
MessageBox MB_OK|MB_ICONSTOP "CVS Data Setup not found."
|
||||||
Quit
|
Abort
|
||||||
|
|
||||||
SetDetailsPrint listonly
|
SetDetailsPrint listonly
|
||||||
DetailPrint "Installing CVS data..."
|
DetailPrint "Installing CVS data..."
|
||||||
SetDetailsPrint none
|
SetDetailsPrint none
|
||||||
Exec "${NSISBINPATH}\InstallCVSData.exe"
|
Exec "$NSISBINPATH\InstallCVSData.exe"
|
||||||
|
|
||||||
datainstalled:
|
datainstalled:
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function UpdateMethod
|
|
||||||
|
|
||||||
Push ${TEMP1}
|
|
||||||
|
|
||||||
InstallOptions::dialog "$PLUGINSDIR\io.ini"
|
|
||||||
Push ${TEMP1}
|
|
||||||
|
|
||||||
Pop ${TEMP1}
|
|
||||||
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
Function GetParameters
|
Function GetParameters
|
||||||
|
|
||||||
Push $R0
|
Push $R0
|
||||||
|
@ -261,13 +274,9 @@ FunctionEnd
|
||||||
|
|
||||||
Function CloseMenu
|
Function CloseMenu
|
||||||
|
|
||||||
Push $R0
|
FindWindow $TEMP1 "NSIS Menu"
|
||||||
|
IntCmp $TEMP1 0 +2
|
||||||
FindWindow $R0 "NSIS Menu"
|
SendMessage $TEMP1 ${WM_CLOSE} 0 0
|
||||||
IntCmp $R0 0 +2
|
|
||||||
SendMessage $R0 ${WM_CLOSE} 0 0
|
|
||||||
|
|
||||||
Pop $R0
|
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
@ -286,7 +295,7 @@ Function ConnectInternet
|
||||||
|
|
||||||
noie3:
|
noie3:
|
||||||
|
|
||||||
# IE3 not installed
|
; IE3 not installed
|
||||||
MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
|
MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
|
||||||
|
|
||||||
connected:
|
connected:
|
||||||
|
@ -317,17 +326,17 @@ no_trim_needed:
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function FindFiles
|
Function FindFiles
|
||||||
Exch $R5 # callback function
|
Exch $R5 ; callback function
|
||||||
Exch
|
Exch
|
||||||
Exch $R4 # file name
|
Exch $R4 ; file name
|
||||||
Exch 2
|
Exch 2
|
||||||
Exch $R0 # directory
|
Exch $R0 ; directory
|
||||||
Push $R1
|
Push $R1
|
||||||
Push $R2
|
Push $R2
|
||||||
Push $R3
|
Push $R3
|
||||||
Push $R6
|
Push $R6
|
||||||
|
|
||||||
Push $R0 # first dir to search
|
Push $R0 ; first dir to search
|
||||||
|
|
||||||
StrCpy $R3 1
|
StrCpy $R3 1
|
||||||
|
|
||||||
|
@ -376,69 +385,68 @@ FunctionEnd
|
||||||
!macro CallFindFiles DIR FILE CBFUNC
|
!macro CallFindFiles DIR FILE CBFUNC
|
||||||
Push ${DIR}
|
Push ${DIR}
|
||||||
Push ${FILE}
|
Push ${FILE}
|
||||||
Push $0
|
|
||||||
GetFunctionAddress $0 ${CBFUNC}
|
GetFunctionAddress $TEMP1 ${CBFUNC}
|
||||||
Exch $0
|
|
||||||
|
Push $TEMP1
|
||||||
|
|
||||||
Call FindFiles
|
Call FindFiles
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
Function PatchCVSRoot
|
Function PatchCVSRoot
|
||||||
Pop $5
|
Pop $TEMP1
|
||||||
FileOpen $6 $5 "r"
|
FileOpen $TEMP2 $TEMP1 "r"
|
||||||
FileRead $6 $7
|
FileRead $TEMP2 $TEMP3
|
||||||
FileClose $6
|
FileClose $TEMP3
|
||||||
Push $7
|
Push $TEMP3
|
||||||
Call TrimNewLines
|
Call TrimNewLines
|
||||||
Pop $7
|
Pop $TEMP3
|
||||||
StrCmp $7 ":pserver:anonymous@cvs1:/cvsroot/nsis" go
|
StrCmp $TEMP3 ":pserver:anonymous@cvs1:/cvsroot/nsis" go
|
||||||
Push "stop"
|
Push "stop"
|
||||||
Return
|
Return
|
||||||
go:
|
go:
|
||||||
FileOpen $6 $5 "w"
|
FileOpen $TEMP1 $TEMP1 "w"
|
||||||
FileWrite $6 ":pserver:anonymous:@cvs.sourceforge.net:/cvsroot/nsis$\r$\n"
|
FileWrite $TEMP2 ":pserver:anonymous:@cvs.sourceforge.net:/cvsroot/nsis$\r$\n"
|
||||||
FileClose $6
|
FileClose $TEMP2
|
||||||
Push "go"
|
Push "go"
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
#####################################################################
|
;--------------------------------
|
||||||
# Update (Installer Section)
|
; Update (Installer Section)
|
||||||
|
|
||||||
Section ""
|
Section ""
|
||||||
|
|
||||||
FindWindow ${TEMP3} "#32770" "" $HWNDPARENT
|
|
||||||
GetDlgItem ${TEMP3} ${TEMP3} 1111
|
|
||||||
|
|
||||||
SetDetailsPrint none
|
SetDetailsPrint none
|
||||||
|
|
||||||
Call ConnectInternet
|
Call ConnectInternet
|
||||||
|
|
||||||
ReadINIStr ${TEMP1} "$PLUGINSDIR\io.ini" "Field 2" "State"
|
!insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 "Method.ini" "Field 1" "State"
|
||||||
StrCmp ${TEMP1} "1" "" CVS
|
StrCmp $TEMP1 "1" 0 CVS
|
||||||
|
|
||||||
# Check for a new release
|
;Check for a new release
|
||||||
|
|
||||||
SetDetailsPrint listonly
|
SetDetailsPrint listonly
|
||||||
|
|
||||||
SendMessage ${TEMP3} ${WM_SETTEXT} 0 "STR:Checking for a new NSIS release..."
|
!insertmacro MUI_HEADER_TEXT "Checking for a release..." "Please wait while NSIS Update checks whether a new NSIS release is available."
|
||||||
|
|
||||||
nsExec::ExecToStack '"${NSISBINPATH}\..\makensis.exe" "/version"'
|
nsExec::ExecToStack '"$NSISBINPATH\..\makensis.exe" "/version"'
|
||||||
Pop ${TEMP1}
|
Pop $TEMP1
|
||||||
|
|
||||||
StrCmp ${TEMP1} "error" "" +3
|
StrCmp $TEMP1 "error" "" +3
|
||||||
MessageBox MB_OK|MB_ICONSTOP "Can't get NSIS version."
|
MessageBox MB_OK|MB_ICONSTOP "Can't get NSIS version."
|
||||||
Quit
|
Quit
|
||||||
|
|
||||||
Pop ${TEMP1}
|
Pop $TEMP1
|
||||||
DetailPrint "Your NSIS version: ${TEMP1}"
|
DetailPrint "Your NSIS version: $TEMP1"
|
||||||
DetailPrint ""
|
DetailPrint ""
|
||||||
|
|
||||||
StrCpy ${TEMP2} ${TEMP1} "" -5
|
StrCpy $TEMP2 $TEMP1 "" -5
|
||||||
StrCmp ${TEMP2} "(CVS)" "" NoCVSVersion
|
StrCmp $TEMP2 "(CVS)" "" NoCVSVersion
|
||||||
|
|
||||||
StrLen ${TEMP2} ${TEMP1}
|
StrLen $TEMP2 $TEMP1
|
||||||
IntOp ${TEMP2} ${TEMP2} - 6
|
IntOp $TEMP2 $TEMP2 - 6
|
||||||
StrCpy ${TEMP1} ${TEMP1} ${TEMP2}
|
StrCpy $TEMP1 $TEMP1 $TEMP2
|
||||||
StrCpy ${TEMP2} 1
|
StrCpy $TEMP2 1
|
||||||
|
|
||||||
DetailPrint "NOTE: You are using a development version of NSIS."
|
DetailPrint "NOTE: You are using a development version of NSIS."
|
||||||
DetailPrint "You can also use NSIS Update to get the latest development files."
|
DetailPrint "You can also use NSIS Update to get the latest development files."
|
||||||
|
@ -448,44 +456,42 @@ Section ""
|
||||||
|
|
||||||
NoCVSVersion:
|
NoCVSVersion:
|
||||||
|
|
||||||
StrCpy ${TEMP2} 0
|
StrCpy $TEMP2 0
|
||||||
|
|
||||||
CheckUpdate:
|
CheckUpdate:
|
||||||
|
|
||||||
DetailPrint "Checking for a new release..."
|
DetailPrint "Checking for a new release..."
|
||||||
DetailPrint ""
|
DetailPrint ""
|
||||||
|
|
||||||
NSISdl::download_quiet "http://nsis.sourceforge.net/update.php?version=${TEMP1}&cvs=${TEMP2}" "$PLUGINSDIR\Update"
|
NSISdl::download_quiet "http://nsis.sourceforge.net/update.php?version=$TEMP1&cvs=$TEMP2" "$PLUGINSDIR\Update"
|
||||||
Pop ${TEMP1}
|
Pop $TEMP1
|
||||||
|
|
||||||
StrCmp ${TEMP1} "success" ReadVersion
|
StrCmp $TEMP1 "success" ReadVersion
|
||||||
MessageBox MB_OK|MB_ICONSTOP "Download failed: ${TEMP1}."
|
MessageBox MB_OK|MB_ICONSTOP "Download failed: $TEMP1."
|
||||||
Quit
|
Quit
|
||||||
|
|
||||||
ReadVersion:
|
ReadVersion:
|
||||||
|
|
||||||
FileOpen ${TEMP1} "$PLUGINSDIR\Update" r
|
FileOpen $TEMP1 "$PLUGINSDIR\Update" r
|
||||||
FileRead ${TEMP1} ${TEMP2}
|
FileRead $TEMP1 $TEMP2
|
||||||
FileClose ${TEMP1}
|
FileClose $TEMP1
|
||||||
|
|
||||||
StrCmp ${TEMP2} "" "" +3
|
StrCmp $TEMP2 "" "" +3
|
||||||
MessageBox MB_OK|MB_ICONSTOP "Invalid version data."
|
MessageBox MB_OK|MB_ICONSTOP "Invalid version data."
|
||||||
Quit
|
Quit
|
||||||
|
|
||||||
StrCpy ${TEMP1} ${TEMP2} 1
|
StrCpy $TEMP1 $TEMP2 1
|
||||||
StrCpy ${TEMP2} ${TEMP2} "" 2
|
StrCpy $TEMP2 $TEMP2 "" 2
|
||||||
|
|
||||||
SendMessage ${TEMP3} ${WM_SETTEXT} 0 "STR:Task completed."
|
StrCmp $TEMP1 "1" "" +3
|
||||||
|
DetailPrint "A new stable release is available: $TEMP2"
|
||||||
StrCmp ${TEMP1} "1" "" +3
|
|
||||||
DetailPrint "A new stable release is available: ${TEMP2}"
|
|
||||||
Goto UpdateMsg
|
Goto UpdateMsg
|
||||||
|
|
||||||
StrCmp ${TEMP1} "2" "" +3
|
StrCmp $TEMP1 "2" "" +3
|
||||||
DetailPrint "A new pre-release is available: ${TEMP2}"
|
DetailPrint "A new pre-release is available: $TEMP2"
|
||||||
Goto UpdateMsg
|
Goto UpdateMsg
|
||||||
|
|
||||||
DetailPrint "No new release is available. Check again later."
|
DetailPrint "No new release is available. Please check again later."
|
||||||
|
|
||||||
Goto done
|
Goto done
|
||||||
|
|
||||||
|
@ -499,48 +505,42 @@ Section ""
|
||||||
|
|
||||||
CVS:
|
CVS:
|
||||||
|
|
||||||
# CVS Update
|
;CVS Update
|
||||||
|
|
||||||
SetOutPath ${NSISBINPATH}\..
|
SetOutPath $NSISBINPATH\..
|
||||||
|
|
||||||
Call CheckCVSAccess
|
;patch CVS Root files that come from the development snapshot
|
||||||
Call CheckCVSFiles
|
GetFullPathName $OUTDIRFULL $OUTDIR
|
||||||
Call CheckCVSDownload
|
!insertmacro CallFindFiles $OUTDIRFULL Root PatchCVSRoot
|
||||||
Call CheckCVSData
|
|
||||||
# patch CVS Root files that come from the development snapshot
|
|
||||||
GetFullPathName $9 $OUTDIR
|
|
||||||
!insertmacro CallFindFiles $9 Root PatchCVSRoot
|
|
||||||
|
|
||||||
SetDetailsPrint listonly
|
SetDetailsPrint listonly
|
||||||
|
|
||||||
SendMessage ${TEMP3} ${WM_SETTEXT} 0 "STR:Updating your NSIS files..."
|
!insertmacro MUI_HEADER_TEXT "Updating..." "Please wait while NSIS Update is downloading development files. This may take several minutes to complete."
|
||||||
|
|
||||||
DetailPrint "Initializing CVS Update..."
|
DetailPrint "Initializing CVS Update..."
|
||||||
|
|
||||||
ReadINIStr ${TEMP1} "$PLUGINSDIR\io.ini" "Field 3" "State"
|
!insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 "Method.ini" "Field 2" "State"
|
||||||
StrCmp ${TEMP1} "1" "" CleanCVSUpdate
|
StrCmp $TEMP1 "1" 0 CleanCVSUpdate
|
||||||
|
|
||||||
# Normal update
|
;Normal update
|
||||||
|
|
||||||
nsExec::ExecToLog '"${NSISBINPATH}\cvs95.exe" -q -z3 update -d -P'
|
nsExec::ExecToLog '"$NSISBINPATH\cvs95.exe" -q -z3 update -d -P'
|
||||||
Pop ${TEMP1}
|
Pop $TEMP1
|
||||||
Goto CheckCVSReturn
|
Goto CheckCVSReturn
|
||||||
|
|
||||||
CleanCVSUpdate:
|
CleanCVSUpdate:
|
||||||
|
|
||||||
# Clean copy
|
;Clean copy
|
||||||
|
|
||||||
nsExec::ExecToLog '"${NSISBINPATH}\cvs95.exe" -q -z3 update -C -d -P'
|
nsExec::ExecToLog '"$NSISBINPATH\cvs95.exe" -q -z3 update -C -d -P'
|
||||||
Pop ${TEMP1}
|
Pop $TEMP1
|
||||||
|
|
||||||
CheckCVSReturn:
|
CheckCVSReturn:
|
||||||
|
|
||||||
StrCmp ${TEMP1} "error" "" +3
|
StrCmp $TEMP1 "error" "" +3
|
||||||
MessageBox MB_OK|MB_ICONSTOP "Can't execute CVS client."
|
MessageBox MB_OK|MB_ICONSTOP "Can't execute CVS client."
|
||||||
Quit
|
Quit
|
||||||
|
|
||||||
SendMessage ${TEMP3} ${WM_SETTEXT} 0 "STR:Task completed."
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
SetDetailsPrint none
|
SetDetailsPrint none
|
||||||
|
|
Binary file not shown.
|
@ -1,38 +0,0 @@
|
||||||
[Settings]
|
|
||||||
NumFields=5
|
|
||||||
[Field 1]
|
|
||||||
Type=Label
|
|
||||||
Text=Welcome to NSIS Update. How would you like to update your NSIS files?
|
|
||||||
Left=0
|
|
||||||
Right=-1
|
|
||||||
Top=0
|
|
||||||
Bottom=8
|
|
||||||
[Field 2]
|
|
||||||
Type=RadioButton
|
|
||||||
Text=Check for a new tested release
|
|
||||||
Left=20
|
|
||||||
Right=-1
|
|
||||||
Top=25
|
|
||||||
Bottom=33
|
|
||||||
State=1
|
|
||||||
[Field 3]
|
|
||||||
Type=RadioButton
|
|
||||||
Text=Download the latest development files from CVS, merge your changes
|
|
||||||
Left=20
|
|
||||||
Right=-1
|
|
||||||
Top=49
|
|
||||||
Bottom=57
|
|
||||||
[Field 4]
|
|
||||||
Type=RadioButton
|
|
||||||
Text=Download the latest development files from CVS, clean copy
|
|
||||||
Left=20
|
|
||||||
Right=-1
|
|
||||||
Top=73
|
|
||||||
Bottom=81
|
|
||||||
[Field 5]
|
|
||||||
Type=Label
|
|
||||||
Text=Please close all other NSIS utilities (including the NSIS Menu) before installing a new release or downloading development files, otherwise these utitilies can't be updated.
|
|
||||||
Left=0
|
|
||||||
Right=-1
|
|
||||||
Top=97
|
|
||||||
Bottom=113
|
|
BIN
Contrib/NSIS Update/UI.exe
Normal file
BIN
Contrib/NSIS Update/UI.exe
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue