From 7faaa1bb24be99f18f0d81635a40deaefdab8dfd Mon Sep 17 00:00:00 2001 From: Don HO Date: Mon, 4 Dec 2017 20:00:55 +0100 Subject: [PATCH] Fix installer issues 1. Fix shell extension registration error (due to notepad++.exe has not yet been copied) 2. Fix themes' absence after installation (one variable depends on its initialization in mainSection) --- PowerEditor/installer/nppSetup.nsi | 53 +++++++++++++------ .../nsisInclude/binariesComponents.nsh | 26 +-------- .../nsisInclude/mainSectionFuncs.nsh | 2 +- 3 files changed, 39 insertions(+), 42 deletions(-) diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index 578ed9eed..d9a5762d1 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -98,32 +98,16 @@ page Custom ExtraOptions !include "nsisInclude\langs4Installer.nsh" - - - !include "nsisInclude\mainSectionFuncs.nsh" - !include "nsisInclude\langs4Npp.nsh" !include "nsisInclude\autoCompletion.nsh" -!include "nsisInclude\themes.nsh" + !include "nsisInclude\binariesComponents.nsh" InstType "Minimalist" -${MementoSectionDone} - -;-------------------------------- - !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${explorerContextMenu} 'Explorer context menu entry for Notepad++ : Open whatever you want in Notepad++ from Windows Explorer.' - !insertmacro MUI_DESCRIPTION_TEXT ${autoCompletionComponent} 'Install the API files you need for the auto-completion feature (Ctrl+Space).' - !insertmacro MUI_DESCRIPTION_TEXT ${Plugins} 'You may need these plugins to extend the capabilities of Notepad++.' - !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_FUNCTION_DESCRIPTION_END -;-------------------------------- Section -FinishSection Call writeInstallInfoInRegistry @@ -226,6 +210,41 @@ Section -"Notepad++" mainSection SectionEnd +!include "nsisInclude\themes.nsh" + +${MementoSection} "Context Menu Entry" explorerContextMenu + SetOverwrite try + SetOutPath "$INSTDIR\" + + ; There is no need to keep x86 NppShell_06.dll in 64 bit installer + ; But in 32bit installer both the Dlls are required + ; As user can install 32bit npp version on x64 bit machine, that time x64 bit NppShell is required. + + !ifdef ARCH64 + File /oname=$INSTDIR\NppShell_06.dll "..\bin\NppShell64_06.dll" + !else + ${If} ${RunningX64} + File /oname=$INSTDIR\NppShell_06.dll "..\bin\NppShell64_06.dll" + ${Else} + File "..\bin\NppShell_06.dll" + ${EndIf} + !endif + Exec 'regsvr32 /s "$INSTDIR\NppShell_06.dll"' +${MementoSectionEnd} + +${MementoSectionDone} + +;-------------------------------- + !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${explorerContextMenu} 'Explorer context menu entry for Notepad++ : Open whatever you want in Notepad++ from Windows Explorer.' + !insertmacro MUI_DESCRIPTION_TEXT ${autoCompletionComponent} 'Install the API files you need for the auto-completion feature (Ctrl+Space).' + !insertmacro MUI_DESCRIPTION_TEXT ${Plugins} 'You may need these plugins to extend the capabilities of Notepad++.' + !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_FUNCTION_DESCRIPTION_END +;-------------------------------- + Function .onInstSuccess ${MementoSectionSave} diff --git a/PowerEditor/installer/nsisInclude/binariesComponents.nsh b/PowerEditor/installer/nsisInclude/binariesComponents.nsh index a8451ed60..fc5f803b8 100644 --- a/PowerEditor/installer/nsisInclude/binariesComponents.nsh +++ b/PowerEditor/installer/nsisInclude/binariesComponents.nsh @@ -25,28 +25,6 @@ ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -${MementoSection} "Context Menu Entry" explorerContextMenu - SetOverwrite try - SetOutPath "$INSTDIR\" - - ; There is no need to keep x86 NppShell_06.dll in 64 bit installer - ; But in 32bit installer both the Dlls are required - ; As user can install 32bit npp version on x64 bit machine, that time x64 bit NppShell is required. - - !ifdef ARCH64 - File /oname=$INSTDIR\NppShell_06.dll "..\bin\NppShell64_06.dll" - !else - ${If} ${RunningX64} - File /oname=$INSTDIR\NppShell_06.dll "..\bin\NppShell64_06.dll" - ${Else} - File "..\bin\NppShell_06.dll" - ${EndIf} - !endif - - Exec 'regsvr32 /s "$INSTDIR\NppShell_06.dll"' -${MementoSectionEnd} - SectionGroup "Plugins" Plugins SetOverwrite on !ifndef ARCH64 @@ -133,13 +111,13 @@ SectionGroup un.Plugins RMDir "$INSTDIR\updater\" SectionEnd -/* Section un.DSpellCheck + Section un.DSpellCheck Delete "$INSTDIR\plugins\DSpellCheck.dll" Delete "$UPDATE_PATH\plugins\Config\DSpellCheck.ini" Delete "$INSTDIR\plugins\Config\Hunspell\en_US.aff" Delete "$INSTDIR\plugins\Config\Hunspell\en_US.dic" RMDir "$INSTDIRplugins\Config\Hunspell\" - SectionEnd */ + SectionEnd SectionGroupEnd diff --git a/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh b/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh index f0c17e735..a46662f0e 100644 --- a/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh +++ b/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh @@ -210,8 +210,8 @@ Function removeUnstablePlugins never: Rename "$INSTDIR\plugins\DSpellCheck.dll" "$INSTDIR\plugins\DSpellCheck2.dll" Goto donothing - */ donothing: + */ FunctionEnd Function removeOldContextMenu