From c0d795a736e0a6a4fcdd44a54246a923768405ad Mon Sep 17 00:00:00 2001 From: joostverburg Date: Fri, 21 Feb 2003 19:29:04 +0000 Subject: [PATCH] nsis update closes nsis menu git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2206 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/NSIS Update/NSISUpdate.nsi | 36 +++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/Contrib/NSIS Update/NSISUpdate.nsi b/Contrib/NSIS Update/NSISUpdate.nsi index be0e5ccf..4f853566 100644 --- a/Contrib/NSIS Update/NSISUpdate.nsi +++ b/Contrib/NSIS Update/NSISUpdate.nsi @@ -114,6 +114,10 @@ Function .onInit temp: + # Close the NSIS Menu (files in use cannot be updated) + + Call CloseMenu + # Remove temporary file on next reboot Delete /REBOOTOK "$TEMP\NSISUpdate.bin" @@ -265,17 +269,19 @@ Function GetParameters FunctionEnd -##################################################################### -# Update (Installer Section) +Function CloseMenu -Section "" + Push $R0 - FindWindow ${TEMP3} "#32770" "" $HWNDPARENT - GetDlgItem ${TEMP3} ${TEMP3} 1111 + FindWindow $R0 "NSIS Menu" + IntCmp $R0 0 +2 + SendMessage $R0 ${WM_CLOSE} 0 0 + + Pop $R0 - SetDetailsPrint none - - # Connect to the internet +FunctionEnd + +Function ConnectInternet ClearErrors Dialer::AttemptConnect @@ -292,6 +298,20 @@ Section "" MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now." connected: + +FunctionEnd + +##################################################################### +# Update (Installer Section) + +Section "" + + FindWindow ${TEMP3} "#32770" "" $HWNDPARENT + GetDlgItem ${TEMP3} ${TEMP3} 1111 + + SetDetailsPrint none + + Call ConnectInternet !insertmacro MUI_INSTALLOPTIONS_READ ${TEMP1} "io.ini" "Field 2" "State" StrCmp ${TEMP1} "1" "" CVS