mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Make install/update easy & quiet
Add command line parameter "/runNppAfterSilentInstall" for Notepad++ installer. This parameter launches installed Notepad++ after silent installation. Of course, the parameter takes effect only when "/S" (silent installation) is used. Fix partially #8514, follow up #15230 Close #15280
This commit is contained in:
parent
dbdeca5b28
commit
638b5a2043
@ -90,6 +90,7 @@ page Custom ExtraOptions
|
||||
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchNpp"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!define MUI_PAGE_CUSTOMFUNCTION_SHOW "un.CheckIfRunning"
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
@ -115,7 +116,7 @@ InstType "Minimalist"
|
||||
Var diffArchDir2Remove
|
||||
Var noUpdater
|
||||
Var closeRunningNpp
|
||||
|
||||
Var runNppAfterSilentInstall
|
||||
|
||||
!ifdef ARCH64 || ARCHARM64
|
||||
; this is needed for the 64-bit InstallDirRegKey patch
|
||||
@ -151,7 +152,8 @@ Function .onInit
|
||||
;
|
||||
; --- PATCH END ---
|
||||
|
||||
; check for the possible "/closeRunningNpp" cmdline option 1st
|
||||
|
||||
; Begin of "/closeRunningNpp"
|
||||
${GetParameters} $R0
|
||||
${GetOptions} $R0 "/closeRunningNpp" $R1 ; case insensitive
|
||||
IfErrors 0 closeRunningNppYes
|
||||
@ -175,7 +177,11 @@ closeRunningNppCheckDone:
|
||||
Quit ; silent installation is silent, currently we cannot continue without a user interaction (TODO: a new "/closeRunningNppAutomatically" installer optional param...)
|
||||
nppNotRunning:
|
||||
notInSilentMode:
|
||||
; End of "/closeRunningNpp"
|
||||
|
||||
|
||||
|
||||
; Begin of "/noUpdater"
|
||||
${GetParameters} $R0
|
||||
${GetOptions} $R0 "/noUpdater" $R1 ;case insensitive
|
||||
IfErrors withUpdater withoutUpdater
|
||||
@ -192,8 +198,22 @@ updaterDone:
|
||||
!insertmacro UnSelectSection ${PluginsAdmin}
|
||||
SectionSetText ${PluginsAdmin} ""
|
||||
${EndIf}
|
||||
; End of "/noUpdater"
|
||||
|
||||
|
||||
; Begin of "/runNppAfterSilentInstall"
|
||||
${GetParameters} $R0
|
||||
${GetOptions} $R0 "/runNppAfterSilentInstall" $R1 ;case insensitive
|
||||
IfErrors noRunNpp runNpp
|
||||
noRunNpp:
|
||||
StrCpy $runNppAfterSilentInstall "false"
|
||||
Goto runNppDone
|
||||
runNpp:
|
||||
StrCpy $runNppAfterSilentInstall "true"
|
||||
runNppDone:
|
||||
; End of "/runNppAfterSilentInstall"
|
||||
|
||||
|
||||
${If} ${SectionIsSelected} ${PluginsAdmin}
|
||||
!insertmacro SetSectionFlag ${AutoUpdater} ${SF_RO}
|
||||
!insertmacro SelectSection ${AutoUpdater}
|
||||
@ -358,6 +378,11 @@ FunctionEnd
|
||||
|
||||
Section -FinishSection
|
||||
Call writeInstallInfoInRegistry
|
||||
IfSilent 0 theEnd
|
||||
${If} $runNppAfterSilentInstall == "true"
|
||||
Call LaunchNpp
|
||||
${EndIf}
|
||||
theEnd:
|
||||
SectionEnd
|
||||
|
||||
BrandingText "The best things in life are free. Notepad++ is free so Notepad++ is the best"
|
||||
|
Loading…
x
Reference in New Issue
Block a user