NSIS Update - use ExtractDLL
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2413 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
6e963b9e91
commit
27e1a43b4a
3 changed files with 25 additions and 14 deletions
|
@ -32,7 +32,11 @@
|
||||||
!define TEMP2 $R1
|
!define TEMP2 $R1
|
||||||
!define TEMP3 $R2
|
!define TEMP3 $R2
|
||||||
|
|
||||||
|
!verbose 3
|
||||||
!include "WinMessages.nsh"
|
!include "WinMessages.nsh"
|
||||||
|
!verbose 4
|
||||||
|
|
||||||
|
!addplugindir "${NSISDIR}\Contrib\NSIS Update\Resources\BIN"
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
# Configuration
|
# Configuration
|
||||||
|
@ -68,23 +72,26 @@ Page instfiles
|
||||||
|
|
||||||
IfFileExists "${PATH}\${FILE}" "Done_${FILE}"
|
IfFileExists "${PATH}\${FILE}" "Done_${FILE}"
|
||||||
|
|
||||||
IfFileExists "$PLUGINSDIR\bzip2.exe" +3"
|
NSISdl::download "http://nsis.sourceforge.net/nsisupdate/${FILE}.dat" "${PATH}\${FILE}.dat"
|
||||||
File "/oname=$PLUGINSDIR\bzip2.exe" "Resources\bin\bzip2.exe"
|
|
||||||
|
|
||||||
NSISdl::download "http://nsis.sourceforge.net/nsisupdate/${FILE}.bz2" "${PATH}\${FILE}.bz2"
|
|
||||||
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
|
||||||
|
|
||||||
"Extract_${FILE}:"
|
Push ${TEMP1}
|
||||||
nsExec::ExecToLog '"$PLUGINSDIR\bzip2.exe" -vd "${PATH}\${FILE}.bz2"'
|
|
||||||
|
|
||||||
IfFileExists "${PATH}\${FILE}" "Done_${FILE}"
|
"Extract_${FILE}:"
|
||||||
MessageBox MB_OK|MB_ICONSTOP "Extraction failed."
|
ExtractDLL::extract "${PATH}\${FILE}" "${PATH}\${FILE}.dat"
|
||||||
|
Delete "${PATH}\${FILE}.dat"
|
||||||
|
|
||||||
|
Pop ${TEMP1}
|
||||||
|
StrCmp ${TEMP1} "success" +3
|
||||||
|
MessageBox MB_OK|MB_ICONSTOP "Extraction failed: ${TEMP1}."
|
||||||
Quit
|
Quit
|
||||||
|
|
||||||
|
Pop ${TEMP1}
|
||||||
|
|
||||||
"Done_${FILE}:"
|
"Done_${FILE}:"
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
@ -94,11 +101,13 @@ Page instfiles
|
||||||
|
|
||||||
Function .onInit
|
Function .onInit
|
||||||
|
|
||||||
Call GetInstallerFile
|
Push ${TEMP1}
|
||||||
Pop $R0
|
|
||||||
|
|
||||||
StrCpy $R0 $R0 "" -14
|
Call GetInstallerFile
|
||||||
StrCmp $R0 "NSISUpdate.bin" temp
|
Pop ${TEMP1}
|
||||||
|
|
||||||
|
StrCpy ${TEMP1} ${TEMP1} "" -14
|
||||||
|
StrCmp ${TEMP1} "NSISUpdate.bin" temp
|
||||||
|
|
||||||
# Create a temporary file, so NSIS Update can update itself
|
# Create a temporary file, so NSIS Update can update itself
|
||||||
|
|
||||||
|
@ -108,6 +117,8 @@ 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
|
||||||
|
|
BIN
Contrib/NSIS Update/Resources/BIN/ExtractDLL.dll
Normal file
BIN
Contrib/NSIS Update/Resources/BIN/ExtractDLL.dll
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue