Add /noUpdater argument for installer

By launch "npp.7.4.3.Installer.exe /noUpdater /S" allows users install
Notepad++ silentely, without including Auto-Updater.
This commit is contained in:
Don HO 2017-07-13 08:46:44 +02:00
parent 4c2e41b649
commit 77d9a9959a
2 changed files with 65 additions and 56 deletions

View File

@ -86,7 +86,58 @@ page Custom ExtraOptions
!include "nsisInclude\langs4Installer.nsh" !include "nsisInclude\langs4Installer.nsh"
!include "nsisInclude\mainSectionFuncs.nsh"
Section -"Notepad++" mainSection
Call setPathAndOptions
${If} $diffArchDir2Remove != ""
!insertmacro uninstallRegKey
!insertmacro uninstallDir $diffArchDir2Remove
${endIf}
Call copyCommonFiles
Call removeUnstablePlugins
Call removeOldContextMenu
Call shortcutLinkManagement
SectionEnd
!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
SectionEnd
Var diffArchDir2Remove Var diffArchDir2Remove
Var noUpdater
Function .onInit Function .onInit
${GetParameters} $R0 ${GetParameters} $R0
@ -99,6 +150,20 @@ appdataLoadYes:
StrCpy $allowAppDataPluginsLoading "true" StrCpy $allowAppDataPluginsLoading "true"
appdataLoadDone: appdataLoadDone:
${GetOptions} $R0 "/noUpdater" $R1 ;case insensitive
IfErrors withUpdater withoutUpdater
withUpdater:
StrCpy $noUpdater "false"
Goto updaterDone
withoutUpdater:
StrCpy $noUpdater "true"
updaterDone:
${If} $noUpdater == "true"
!insertmacro UnSelectSection ${AutoUpdater}
SectionSetText ${AutoUpdater} ""
${EndIf}
SectionSetSize ${mainSection} 4500 ; This is rough estimation of files present in function copyCommonFiles SectionSetSize ${mainSection} 4500 ; This is rough estimation of files present in function copyCommonFiles
InitPluginsDir ; Initializes the plug-ins dir ($PLUGINSDIR) if not already initialized. InitPluginsDir ; Initializes the plug-ins dir ($PLUGINSDIR) if not already initialized.
Call preventInstallInWin9x Call preventInstallInWin9x
@ -152,52 +217,6 @@ Function .onInstSuccess
FunctionEnd FunctionEnd
!include "nsisInclude\mainSectionFuncs.nsh"
Section -"Notepad++" mainSection
Call setPathAndOptions
${If} $diffArchDir2Remove != ""
!insertmacro uninstallRegKey
!insertmacro uninstallDir $diffArchDir2Remove
${endIf}
Call copyCommonFiles
Call removeUnstablePlugins
Call removeOldContextMenu
Call shortcutLinkManagement
SectionEnd
!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
SectionEnd
BrandingText "Don HO" BrandingText "Don HO"
; eof ; eof

View File

@ -56,15 +56,6 @@ SectionGroup "Plugins" Plugins
File "..\bin\plugins\NppExport.dll" File "..\bin\plugins\NppExport.dll"
${MementoSectionEnd} ${MementoSectionEnd}
${MementoSection} "Plugin Manager" PluginManager
Delete "$INSTDIR\plugins\PluginManager.dll"
SetOutPath "$INSTDIR\plugins"
File "..\bin\plugins\PluginManager.dll"
SetOutPath "$UPDATE_PATH\plugins\Config"
File "..\bin\plugins\Config\PluginManager.ini"
SetOutPath "$INSTDIR\updater"
File "..\bin\updater\gpup.exe"
${MementoSectionEnd}
!endif !endif
${MementoSection} "Mime Tools" MimeTools ${MementoSection} "Mime Tools" MimeTools
@ -108,7 +99,6 @@ ${MementoSection} "Auto-Updater" AutoUpdater
!endif !endif
${MementoSectionEnd} ${MementoSectionEnd}
;Uninstall section ;Uninstall section
SectionGroup un.Plugins SectionGroup un.Plugins
Section un.NppExport Section un.NppExport