From 804740a76c9dcc24cbb35db978976d7878735961 Mon Sep 17 00:00:00 2001 From: joostverburg Date: Tue, 18 Feb 2003 21:11:09 +0000 Subject: [PATCH] NSIS Update can update itself git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2180 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/NSIS Update/NSISUpdate.nsi | 26 ++++++++++++++++++++---- Contrib/NSIS Update/Resources/GUI/io.ini | 21 ++++++++++++------- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/Contrib/NSIS Update/NSISUpdate.nsi b/Contrib/NSIS Update/NSISUpdate.nsi index 66f06dc9..53b2906a 100644 --- a/Contrib/NSIS Update/NSISUpdate.nsi +++ b/Contrib/NSIS Update/NSISUpdate.nsi @@ -100,6 +100,26 @@ ShowInstDetails show 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" # InitPluginsDir called by Modern UI InstallOptions extract macro @@ -164,14 +184,14 @@ Function CheckCVSData 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." Quit SetDetailsPrint listonly DetailPrint "Installing CVS data..." SetDetailsPrint none - Exec "${NSISPATH}\Bin\InstallCVSData.exe" + Exec "$EXEDIR\Bin\InstallCVSData.exe" datainstalled: @@ -188,8 +208,6 @@ FunctionEnd Section "" - StrCpy ${NSISPATH} "$EXEDIR\.." - FindWindow ${TEMP3} "#32770" "" $HWNDPARENT GetDlgItem ${TEMP3} ${TEMP3} 1111 diff --git a/Contrib/NSIS Update/Resources/GUI/io.ini b/Contrib/NSIS Update/Resources/GUI/io.ini index 7eef2a37..918b477f 100644 --- a/Contrib/NSIS Update/Resources/GUI/io.ini +++ b/Contrib/NSIS Update/Resources/GUI/io.ini @@ -1,5 +1,5 @@ [Settings] -NumFields=4 +NumFields=5 [Field 1] Type=Label 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 Left=20 Right=-1 -Top=30 -Bottom=38 +Top=25 +Bottom=33 State=1 [Field 3] Type=RadioButton Text=Download the latest untested development files, merge your changes Left=20 Right=-1 -Top=59 -Bottom=67 +Top=49 +Bottom=57 [Field 4] Type=RadioButton Text=Download the latest untested development files, clean copy Left=20 Right=-1 -Top=88 -Bottom=96 \ No newline at end of file +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 \ No newline at end of file