From 250ca9e6e29c1a3b3dca8352a40307dbf5244382 Mon Sep 17 00:00:00 2001 From: SinghRajenM Date: Thu, 28 Dec 2017 21:58:57 +0530 Subject: [PATCH] Improve installer --- PowerEditor/installer/nppSetup.nsi | 29 ++++++++++++++----- .../nsisInclude/binariesComponents.nsh | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index d9a5762d1..b1868fb20 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -100,7 +100,6 @@ page Custom ExtraOptions !include "nsisInclude\mainSectionFuncs.nsh" -!include "nsisInclude\langs4Npp.nsh" !include "nsisInclude\autoCompletion.nsh" !include "nsisInclude\binariesComponents.nsh" @@ -109,11 +108,6 @@ page Custom ExtraOptions InstType "Minimalist" -Section -FinishSection - Call writeInstallInfoInRegistry -SectionEnd - - Var diffArchDir2Remove Var noUpdater Function .onInit @@ -142,7 +136,7 @@ ${If} $noUpdater == "true" SectionSetText ${AutoUpdater} "" ${EndIf} - SectionSetSize ${mainSection} 4500 ; This is rough estimation of files present in function copyCommonFiles + Call SetRoughEstimation ; This is rough estimation of files present in function copyCommonFiles InitPluginsDir ; Initializes the plug-ins dir ($PLUGINSDIR) if not already initialized. Call preventInstallInWin9x @@ -210,6 +204,18 @@ Section -"Notepad++" mainSection SectionEnd +; Please **DONOT** move this function (SetRoughEstimation) anywhere else +; Just keep it right after the "mainSection" section +; Otherwise rough estimation for copyCommonFiles will not be set +; which will become reason for showing 0.0KB size on components section page + +Function SetRoughEstimation + SectionSetSize ${mainSection} 4500 ; This is rough estimation of files present in function copyCommonFiles +FunctionEnd + + +!include "nsisInclude\langs4Npp.nsh" + !include "nsisInclude\themes.nsh" ${MementoSection} "Context Menu Entry" explorerContextMenu @@ -251,6 +257,15 @@ Function .onInstSuccess FunctionEnd +; Keep "FinishSection" section in the last so that +; writing installation info happens in the last +; Specially for writing registry "EstimatedSize" +; which is visible in control panel in column named "size" + +Section -FinishSection + Call writeInstallInfoInRegistry +SectionEnd + BrandingText "Je code donc je suis" ; eof diff --git a/PowerEditor/installer/nsisInclude/binariesComponents.nsh b/PowerEditor/installer/nsisInclude/binariesComponents.nsh index f464f9534..555222014 100644 --- a/PowerEditor/installer/nsisInclude/binariesComponents.nsh +++ b/PowerEditor/installer/nsisInclude/binariesComponents.nsh @@ -118,7 +118,7 @@ SectionGroup un.Plugins 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\" + RMDir /r "$INSTDIR\plugins\Config" ; Remove Config folder recursively only if empty SectionEnd SectionGroupEnd