From 4fa910c74b7cb1321c0c95da959458b5b5b2ddf4 Mon Sep 17 00:00:00 2001 From: Don HO Date: Tue, 6 Nov 2018 13:31:20 +0100 Subject: [PATCH] Add nppPluginList into the installer. --- PowerEditor/installer/nppSetup.nsi | 19 +++++++++--- .../nsisInclude/binariesComponents.nsh | 26 +++++++++++++++-- .../nsisInclude/mainSectionFuncs.nsh | 2 -- PowerEditor/installer/nsisInclude/tools.nsh | 2 -- PowerEditor/installer/packageAll.bat | 29 ++++++++++++------- 5 files changed, 58 insertions(+), 20 deletions(-) diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index fc303d086..5b14a2b4f 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -126,10 +126,19 @@ withoutUpdater: StrCpy $noUpdater "true" updaterDone: -${If} $noUpdater == "true" - !insertmacro UnSelectSection ${AutoUpdater} - SectionSetText ${AutoUpdater} "" -${EndIf} + ${If} $noUpdater == "true" + !insertmacro UnSelectSection ${AutoUpdater} + SectionSetText ${AutoUpdater} "" + !insertmacro UnSelectSection ${PluginsAdmin} + SectionSetText ${PluginsAdmin} "" + ${EndIf} + + ${If} ${SectionIsSelected} ${PluginsAdmin} + !insertmacro SetSectionFlag ${AutoUpdater} ${SF_RO} + !insertmacro SelectSection ${AutoUpdater} + ${Else} + !insertmacro ClearSectionFlag ${AutoUpdater} ${SF_RO} + ${EndIf} Call SetRoughEstimation ; This is rough estimation of files present in function copyCommonFiles InitPluginsDir ; Initializes the plug-ins dir ($PLUGINSDIR) if not already initialized. @@ -240,10 +249,12 @@ ${MementoSectionDone} !insertmacro MUI_DESCRIPTION_TEXT ${localization} 'To use Notepad++ in your favorite language(s), install all/desired language(s).' !insertmacro MUI_DESCRIPTION_TEXT ${Themes} 'The eye-candy to change visual effects. Use Theme selector to switch among them.' !insertmacro MUI_DESCRIPTION_TEXT ${AutoUpdater} 'Keep Notepad++ updated: Automatically download and install the latest updates.' + !insertmacro MUI_DESCRIPTION_TEXT ${PluginsAdmin} 'Install, Update and Remove any plugin from a list by some clicks. It needs Auto-Updater installed.' !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- + Function .onInstSuccess ${MementoSectionSave} FunctionEnd diff --git a/PowerEditor/installer/nsisInclude/binariesComponents.nsh b/PowerEditor/installer/nsisInclude/binariesComponents.nsh index 717d7e177..77744aa77 100644 --- a/PowerEditor/installer/nsisInclude/binariesComponents.nsh +++ b/PowerEditor/installer/nsisInclude/binariesComponents.nsh @@ -34,7 +34,6 @@ SectionGroup "Plugins" Plugins Delete "$INSTDIR\plugins\NppExport.dll" Delete "$INSTDIR\plugins\NppExport\NppExport.dll" Delete "$PLUGIN_INST_PATH\NppExport\NppExport.dll" - MessageBox MB_OK "$PLUGIN_INST_PATH\toto" SetOutPath "$PLUGIN_INST_PATH\NppExport" File "..\bin\plugins\NppExport\NppExport.dll" @@ -113,6 +112,16 @@ ${MementoSection} "Auto-Updater" AutoUpdater !endif ${MementoSectionEnd} +${MementoSection} "Plugins Admin" PluginsAdmin + SetOverwrite on + SetOutPath $PLUGIN_CONF_PATH +!ifdef ARCH64 + File "..\bin64\nppPluginList.dll" +!else + File "..\bin\nppPluginList.dll" +!endif +${MementoSectionEnd} + ;Uninstall section SectionGroup un.Plugins Section un.NppExport @@ -173,4 +182,17 @@ Section un.AutoUpdater Delete "$INSTDIR\updater\README.md" Delete "$INSTDIR\updater\getDownLoadUrl.php" RMDir "$INSTDIR\updater" -SectionEnd +SectionEnd + +Function .onSelChange +${If} ${SectionIsSelected} ${PluginsAdmin} + !insertmacro SetSectionFlag ${AutoUpdater} ${SF_RO} + !insertmacro SelectSection ${AutoUpdater} +${Else} + !insertmacro ClearSectionFlag ${AutoUpdater} ${SF_RO} +${EndIf} +FunctionEnd + +Section un.PluginsAdmin + Delete "$PLUGIN_CONF_PATH\nppPluginList.dll" +SectionEnd diff --git a/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh b/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh index 536b872c8..5ec167645 100644 --- a/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh +++ b/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh @@ -47,14 +47,12 @@ initUpdatePath: File "..\bin\doLocalConf.xml" StrCpy $PLUGIN_INST_PATH "$INSTDIR\plugins" StrCpy $PLUGIN_CONF_PATH "$INSTDIR\plugins\Config" - MessageBox MB_OK $PLUGIN_INST_PATH CreateDirectory $PLUGIN_INST_PATH\config ${ELSE} IfFileExists $INSTDIR\doLocalConf.xml 0 +2 Delete $INSTDIR\doLocalConf.xml StrCpy $PLUGIN_INST_PATH "$PROFILE\AppData\Local\${APPNAME}\plugins" StrCpy $PLUGIN_CONF_PATH "$APPDATA\${APPNAME}\plugins\Config" - MessageBox MB_OK $PLUGIN_INST_PATH StrCpy $UPDATE_PATH "$APPDATA\${APPNAME}" CreateDirectory $UPDATE_PATH\plugins\config ${EndIf} diff --git a/PowerEditor/installer/nsisInclude/tools.nsh b/PowerEditor/installer/nsisInclude/tools.nsh index 92fde6aad..0028793e9 100644 --- a/PowerEditor/installer/nsisInclude/tools.nsh +++ b/PowerEditor/installer/nsisInclude/tools.nsh @@ -82,7 +82,6 @@ FunctionEnd Var Dialog Var NoUserDataCheckboxHandle Var ShortcutCheckboxHandle -Var PluginLoadFromUserDataCheckboxHandle Var WinVer Function ExtraOptions @@ -124,7 +123,6 @@ Function preventInstallInWin9x FunctionEnd Var noUserDataChecked -Var allowPluginLoadFromUserDataChecked Var createShortcutChecked ; The definition of "OnChange" event for checkbox diff --git a/PowerEditor/installer/packageAll.bat b/PowerEditor/installer/packageAll.bat index 8e215b0b2..b72abf431 100644 --- a/PowerEditor/installer/packageAll.bat +++ b/PowerEditor/installer/packageAll.bat @@ -23,8 +23,8 @@ rem retrieve GUP release from website while doing Notepad++ release set WINGUP_VER=5.0.3 IF EXIST ".\bin\wingup\GUP.exe" ( cd .\bin\wingup - GUP.exe -unzipTo %~dp0\..\bin\updater https://github.com/notepad-plus-plus/wingup/releases/download/v%WINGUP_VER%/wingup.v%WINGUP_VER%.bin.zip - GUP.exe -unzipTo %~dp0\..\bin64\updater https://github.com/notepad-plus-plus/wingup/releases/download/v%WINGUP_VER%/wingup.v%WINGUP_VER%.bin.x64.zip + GUP.exe -unzipTo %~dp0\..\bin\updater https://github.com/notepad-plus-plus/wingup/releases/download/v%WINGUP_VER%/wingup.v%WINGUP_VER%.bin.zip "" + GUP.exe -unzipTo %~dp0\..\bin64\updater https://github.com/notepad-plus-plus/wingup/releases/download/v%WINGUP_VER%/wingup.v%WINGUP_VER%.bin.x64.zip "" cd ..\.. ) ELSE ( echo .\wingup\GUP.exe is absent. @@ -44,6 +44,11 @@ If ErrorLevel 1 goto End signtool.exe sign /f %NPP_CERT% /p %NPP_CERT_PWD% /d "Notepad++" /du https://notepad-plus-plus.org/ /t http://timestamp.digicert.com/ ..\bin\NppShell64_06.dll If ErrorLevel 1 goto End +signtool.exe sign /f %NPP_CERT% /p %NPP_CERT_PWD% /d "Notepad++" /du https://notepad-plus-plus.org/ /t http://timestamp.digicert.com/ ..\bin\nppPluginList.dll +If ErrorLevel 1 goto End +signtool.exe sign /f %NPP_CERT% /p %NPP_CERT_PWD% /d "Notepad++" /du https://notepad-plus-plus.org/ /t http://timestamp.digicert.com/ ..\bin64\nppPluginList.dll +If ErrorLevel 1 goto End + signtool.exe sign /f %NPP_CERT% /p %NPP_CERT_PWD% /d "Notepad++" /du https://notepad-plus-plus.org/ /t http://timestamp.digicert.com/ ..\bin\updater\GUP.exe If ErrorLevel 1 goto End signtool.exe sign /f %NPP_CERT% /p %NPP_CERT_PWD% /d "Notepad++" /du https://notepad-plus-plus.org/ /t http://timestamp.digicert.com/ ..\bin64\updater\GUP.exe @@ -123,9 +128,10 @@ copy /Y ..\bin64\SciLexer.dll .\minimalist64\ If ErrorLevel 1 goto End -rem Notepad++ Unicode package +rem Remove old built Notepad++ 32-bit package rmdir /S /Q .\zipped.package.release +rem Re-build Notepad++ 32-bit package folders mkdir .\zipped.package.release mkdir .\zipped.package.release\updater mkdir .\zipped.package.release\localization @@ -139,8 +145,10 @@ mkdir .\zipped.package.release\plugins\APIs mkdir .\zipped.package.release\plugins\Config mkdir .\zipped.package.release\plugins\doc +rem Remove old built Notepad++ 64-bit package rmdir /S /Q .\zipped.package.release64 +rem Re-build Notepad++ 64-bit package folders mkdir .\zipped.package.release64 mkdir .\zipped.package.release64\updater mkdir .\zipped.package.release64\localization @@ -153,7 +161,7 @@ mkdir .\zipped.package.release64\plugins\APIs mkdir .\zipped.package.release64\plugins\Config mkdir .\zipped.package.release64\plugins\doc -rem 32 +rem Basic: Copy needed files into Notepad++ 32-bit package folders copy /Y ..\bin\license.txt .\zipped.package.release\ If ErrorLevel 1 goto End copy /Y ..\bin\readme.txt .\zipped.package.release\ @@ -177,7 +185,7 @@ If ErrorLevel 1 goto End copy /Y ..\bin\SciLexer.dll .\zipped.package.release\ If ErrorLevel 1 goto End -rem 64 +rem Basic Copy needed files into Notepad++ 64-bit package folders copy /Y ..\bin\license.txt .\zipped.package.release64\ If ErrorLevel 1 goto End copy /Y ..\bin\readme.txt .\zipped.package.release64\ @@ -202,7 +210,7 @@ copy /Y ..\bin64\SciLexer.dll .\zipped.package.release64\ If ErrorLevel 1 goto End -rem Plugins +rem Plugins: Copy needed files into Notepad++ 32-bit package folders copy /Y "..\bin\plugins\NppExport\NppExport.dll" .\zipped.package.release\plugins\NppExport\ If ErrorLevel 1 goto End copy /Y "..\bin\plugins\mimeTools\mimeTools.dll" .\zipped.package.release\plugins\mimeTools\ @@ -220,6 +228,7 @@ If ErrorLevel 1 goto End copy /Y "..\bin\plugins\Config\Hunspell\en_US.dic" .\zipped.package.release\plugins\Config\Hunspell\ If ErrorLevel 1 goto End +rem Plugins: Copy needed files into Notepad++ 64-bit package folders copy /Y "..\bin64\plugins\mimeTools\mimeTools.dll" .\zipped.package.release64\plugins\mimeTools\ If ErrorLevel 1 goto End copy /Y "..\bin64\plugins\NppConverter\NppConverter.dll" .\zipped.package.release64\plugins\NppConverter\ @@ -236,19 +245,19 @@ copy /Y "..\bin64\plugins\Config\Hunspell\en_US.dic" .\zipped.package.release64\ If ErrorLevel 1 goto End -rem localizations +rem localizations: Copy all files into Notepad++ 32-bit/64-bit package folders copy /Y ".\nativeLang\*.xml" .\zipped.package.release\localization\ If ErrorLevel 1 goto End copy /Y ".\nativeLang\*.xml" .\zipped.package.release64\localization\ If ErrorLevel 1 goto End -rem files API +rem files API: Copy all files into Notepad++ 32-bit/64-bit package folders copy /Y ".\APIs\*.xml" .\zipped.package.release\plugins\APIs\ If ErrorLevel 1 goto End copy /Y ".\APIs\*.xml" .\zipped.package.release64\plugins\APIs\ If ErrorLevel 1 goto End -rem theme +rem theme: Copy all files into Notepad++ 32-bit/64-bit package folders copy /Y ".\themes\*.xml" .\zipped.package.release\themes\ If ErrorLevel 1 goto End copy /Y ".\themes\*.xml" .\zipped.package.release64\themes\ @@ -270,7 +279,7 @@ rem IF EXIST "%PROGRAMFILES(X86)%" ("%PROGRAMFILES(x86)%\NSIS\Unicode\makensis.e IF EXIST "%PROGRAMFILES(X86)%" ("%PROGRAMFILES(x86)%\NSIS\makensis.exe" nppSetup.nsi) ELSE ("%PROGRAMFILES%\NSIS\makensis.exe" nppSetup.nsi) IF EXIST "%PROGRAMFILES(X86)%" ("%PROGRAMFILES(x86)%\NSIS\makensis.exe" -DARCH64 nppSetup.nsi) ELSE ("%PROGRAMFILES%\NSIS\makensis.exe" -DARCH64 nppSetup.nsi) -rem Notepad++ Unicode package +rem Remove old build rmdir /S /Q .\zipped.package.release rem