From fbd57e00c1fb317c170b42f24703a0043e6f4e6b Mon Sep 17 00:00:00 2001 From: anders_k Date: Mon, 3 Apr 2017 17:35:57 +0000 Subject: [PATCH] Added MUI_PAGE_CUSTOMFUNCTION_DESTROYED so custom image handles can be cleaned up git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6844 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Modern UI 2/MUI2.nsh | 13 +++++++------ Contrib/Modern UI 2/Pages/Finish.nsh | 1 + Contrib/Modern UI 2/Pages/StartMenu.nsh | 2 +- Contrib/Modern UI 2/Pages/Welcome.nsh | 1 + Contrib/Modern UI 2/Readme.html | 7 +++++-- Contrib/Modern UI/System.nsh | 2 +- Contrib/MultiUser/MultiUser.nsh | 1 + Docs/src/history.but | 2 +- Source/exehead/fileform.h | 2 +- 9 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Contrib/Modern UI 2/MUI2.nsh b/Contrib/Modern UI 2/MUI2.nsh index f339f698..2d651fb7 100644 --- a/Contrib/Modern UI 2/MUI2.nsh +++ b/Contrib/Modern UI 2/MUI2.nsh @@ -1,22 +1,23 @@ /* -NSIS Modern User Interface - Version 2.0 +NSIS Modern User Interface - Version 2.1 Copyright 2002-2017 Joost Verburg Contributors: Amir Szekely, Anders Kjersem */ !ifndef MUI_INCLUDED -!echo "NSIS Modern User Interface version 2.0 - Copyright 2002-2017 Joost Verburg" +!verbose push 3 +!define MUI_INCLUDED +!define MUI_SYSVERSION "2.1" +!verbose pop +!echo "NSIS Modern User Interface version ${MUI_SYSVERSION} - Copyright 2002-2017 Joost Verburg" ;-------------------------------- !verbose push 3 !define /IfNDef MUI_VERBOSE 3 !verbose ${MUI_VERBOSE} -!define MUI_INCLUDED -!define MUI_SYSVERSION "2.0" - !addincludedir "${NSISDIR}\Contrib\Modern UI 2" ;-------------------------------- @@ -113,4 +114,4 @@ Contributors: Amir Szekely, Anders Kjersem !macroend !verbose pop -!endif +!endif ;~ MUI_INCLUDED diff --git a/Contrib/Modern UI 2/Pages/Finish.nsh b/Contrib/Modern UI 2/Pages/Finish.nsh index 9d0ad2f9..74431c4e 100644 --- a/Contrib/Modern UI 2/Pages/Finish.nsh +++ b/Contrib/Modern UI 2/Pages/Finish.nsh @@ -412,6 +412,7 @@ Finish page (implemented using nsDialogs) Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW nsDialogs::Show + !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow !ifdef MUI_FINISHPAGE_CANCEL_ENABLED diff --git a/Contrib/Modern UI 2/Pages/StartMenu.nsh b/Contrib/Modern UI 2/Pages/StartMenu.nsh index dd660ac4..831d5911 100644 --- a/Contrib/Modern UI 2/Pages/StartMenu.nsh +++ b/Contrib/Modern UI 2/Pages/StartMenu.nsh @@ -141,8 +141,8 @@ Start Menu folder page !endif !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW - StartMenu::Show + !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED Pop $mui.StartMenuPage.Temp ${if} $mui.StartMenuPage.Temp == "success" diff --git a/Contrib/Modern UI 2/Pages/Welcome.nsh b/Contrib/Modern UI 2/Pages/Welcome.nsh index 3c9fe035..f4720446 100644 --- a/Contrib/Modern UI 2/Pages/Welcome.nsh +++ b/Contrib/Modern UI 2/Pages/Welcome.nsh @@ -160,6 +160,7 @@ Welcome page (implemented using nsDialogs) Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW nsDialogs::Show + !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow ;Delete image from memory diff --git a/Contrib/Modern UI 2/Readme.html b/Contrib/Modern UI 2/Readme.html index cd5e1591..d4b0986c 100644 --- a/Contrib/Modern UI 2/Readme.html +++ b/Contrib/Modern UI 2/Readme.html @@ -191,7 +191,7 @@

- Modern UI 2.0

+ Modern UI 2.1

This new version makes it easier to customize pages, because the same method can @@ -1086,6 +1086,7 @@ FunctionEnd MUI_PAGE_CUSTOMFUNCTION_PRE function
MUI_PAGE_CUSTOMFUNCTION_SHOW function
MUI_PAGE_CUSTOMFUNCTION_LEAVE function
+ MUI_PAGE_CUSTOMFUNCTION_DESTROYED function

The pre function is called first and allows you to initalize variables or decide @@ -1095,8 +1096,10 @@ FunctionEnd

In the show function, the window handles of all controls on the page can be retrieved from a Modern UI variable. A list of the variables names is not yet available. For - now, refer to the source files of the Modern UI 2.0. The variable declarations can + now, refer to the source files of the Modern UI 2. The variable declarations can be found in the first lines of the header file for a certain page.

+

+ The destroyed function is called after a external/plug-in page has been destroyed.

diff --git a/Contrib/Modern UI/System.nsh b/Contrib/Modern UI/System.nsh index a80e14ba..dce467ce 100644 --- a/Contrib/Modern UI/System.nsh +++ b/Contrib/Modern UI/System.nsh @@ -1451,8 +1451,8 @@ Var MUI_TEMP2 !endif !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW - StartMenu::Show + !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED Pop $MUI_TEMP1 StrCmp $MUI_TEMP1 "success" 0 +2 diff --git a/Contrib/MultiUser/MultiUser.nsh b/Contrib/MultiUser/MultiUser.nsh index 9baa62ae..9cbc9fbd 100644 --- a/Contrib/MultiUser/MultiUser.nsh +++ b/Contrib/MultiUser/MultiUser.nsh @@ -450,6 +450,7 @@ Modern UI 2 page !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW nsDialogs::Show + !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED FunctionEnd diff --git a/Docs/src/history.but b/Docs/src/history.but index 6bb9d115..18990b98 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -16,7 +16,7 @@ Released on ? ?th, 2017 \b MultiUser now supports $ProgramFiles64 (\W{http://sf.net/p/nsis/bugs/843}{bug #843}) -\b Added support for MUI_UNCONFIRMPAGE_VARIABLE (\W{http://sf.net/p/nsis/feature-requests/511}{RFE #511}) +\b Added support for MUI_UNCONFIRMPAGE_VARIABLE (\W{http://sf.net/p/nsis/feature-requests/511}{RFE #511}) and MUI_PAGE_CUSTOMFUNCTION_DESTROYED \b Unicode nsExec now supports the /OEM switch (\W{http://sf.net/p/nsis/bugs/1171}{bug #1171}) diff --git a/Source/exehead/fileform.h b/Source/exehead/fileform.h index 5bf0f716..bc112ad3 100644 --- a/Source/exehead/fileform.h +++ b/Source/exehead/fileform.h @@ -203,7 +203,7 @@ enum #ifdef _UNICODE // opcodes available only in Unicode installers must be at the end of the enumeration #ifdef NSIS_SUPPORT_FILEFUNCTIONS - EW_FPUTWS, // FileWriteUTF16LE: 3 [handle, string, ?int:string] + EW_FPUTWS, // FileWriteUTF16LE: 4 [handle, string, ?int:string, TryWriteBOM] EW_FGETWS, // FileReadUTF16LE: 4 [handle, output, maxlen, ?getchar:gets] #endif//NSIS_SUPPORT_FILEFUNCTIONS #endif