NSIS Update can update itself
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2180 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
2ce75d8012
commit
804740a76c
2 changed files with 36 additions and 11 deletions
|
@ -100,6 +100,26 @@ ShowInstDetails show
|
||||||
|
|
||||||
Function .onInit
|
Function .onInit
|
||||||
|
|
||||||
|
StrCpy ${NSISPATH} "$EXEDIR\.."
|
||||||
|
|
||||||
|
StrCpy $R0 $CMDLINE "" -23
|
||||||
|
|
||||||
|
StrCmp $R0 'NSISUpdate Running.exe"' temp
|
||||||
|
|
||||||
|
# Create a temporary file, so NSIS Update can update itself
|
||||||
|
|
||||||
|
CopyFiles /SILENT "$EXEDIR\NSISUpdate.exe" "$EXEDIR\NSISUpdate Running.exe"
|
||||||
|
Exec '"$EXEDIR\NSISUpdate Running.exe"'
|
||||||
|
Quit
|
||||||
|
|
||||||
|
temp:
|
||||||
|
|
||||||
|
# Remove temporary file on next reboot
|
||||||
|
|
||||||
|
Delete /REBOOTOK "$EXEDIR\NSISUpdate Running.exe"
|
||||||
|
|
||||||
|
# InstallOptions INI File for "Update Method" idalog
|
||||||
|
|
||||||
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "Resources\GUI\io.ini" "io.ini"
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "Resources\GUI\io.ini" "io.ini"
|
||||||
|
|
||||||
# InitPluginsDir called by Modern UI InstallOptions extract macro
|
# InitPluginsDir called by Modern UI InstallOptions extract macro
|
||||||
|
@ -164,14 +184,14 @@ Function CheckCVSData
|
||||||
|
|
||||||
IfFileExists "${NSISPATH}\CVS\Root" datainstalled
|
IfFileExists "${NSISPATH}\CVS\Root" datainstalled
|
||||||
|
|
||||||
IfFileExists "${NSISPATH}\Bin\InstallCVSData.exe" +3
|
IfFileExists "$EXEDIR\InstallCVSData.exe" +3
|
||||||
MessageBox MB_OK|MB_ICONSTOP "CVS Data Setup not found."
|
MessageBox MB_OK|MB_ICONSTOP "CVS Data Setup not found."
|
||||||
Quit
|
Quit
|
||||||
|
|
||||||
SetDetailsPrint listonly
|
SetDetailsPrint listonly
|
||||||
DetailPrint "Installing CVS data..."
|
DetailPrint "Installing CVS data..."
|
||||||
SetDetailsPrint none
|
SetDetailsPrint none
|
||||||
Exec "${NSISPATH}\Bin\InstallCVSData.exe"
|
Exec "$EXEDIR\Bin\InstallCVSData.exe"
|
||||||
|
|
||||||
datainstalled:
|
datainstalled:
|
||||||
|
|
||||||
|
@ -188,8 +208,6 @@ FunctionEnd
|
||||||
|
|
||||||
Section ""
|
Section ""
|
||||||
|
|
||||||
StrCpy ${NSISPATH} "$EXEDIR\.."
|
|
||||||
|
|
||||||
FindWindow ${TEMP3} "#32770" "" $HWNDPARENT
|
FindWindow ${TEMP3} "#32770" "" $HWNDPARENT
|
||||||
GetDlgItem ${TEMP3} ${TEMP3} 1111
|
GetDlgItem ${TEMP3} ${TEMP3} 1111
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Settings]
|
[Settings]
|
||||||
NumFields=4
|
NumFields=5
|
||||||
[Field 1]
|
[Field 1]
|
||||||
Type=Label
|
Type=Label
|
||||||
Text=Welcome to NSIS Update. How would you like to update your NSIS files?
|
Text=Welcome to NSIS Update. How would you like to update your NSIS files?
|
||||||
|
@ -12,20 +12,27 @@ Type=RadioButton
|
||||||
Text=Check for a new tested release
|
Text=Check for a new tested release
|
||||||
Left=20
|
Left=20
|
||||||
Right=-1
|
Right=-1
|
||||||
Top=30
|
Top=25
|
||||||
Bottom=38
|
Bottom=33
|
||||||
State=1
|
State=1
|
||||||
[Field 3]
|
[Field 3]
|
||||||
Type=RadioButton
|
Type=RadioButton
|
||||||
Text=Download the latest untested development files, merge your changes
|
Text=Download the latest untested development files, merge your changes
|
||||||
Left=20
|
Left=20
|
||||||
Right=-1
|
Right=-1
|
||||||
Top=59
|
Top=49
|
||||||
Bottom=67
|
Bottom=57
|
||||||
[Field 4]
|
[Field 4]
|
||||||
Type=RadioButton
|
Type=RadioButton
|
||||||
Text=Download the latest untested development files, clean copy
|
Text=Download the latest untested development files, clean copy
|
||||||
Left=20
|
Left=20
|
||||||
Right=-1
|
Right=-1
|
||||||
Top=88
|
Top=73
|
||||||
Bottom=96
|
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
|
Loading…
Add table
Add a link
Reference in a new issue