Add new installer argument /allowAppDataPluginsLoading
The new installer argument /allowAppDataPluginsLoading add file allowAppDataPlugins.xml which allows Notepad++ to load plugins from "%APPDATA%\Notepad++\plugins\"
This commit is contained in:
parent
e7a5c72465
commit
19f24d1d65
|
@ -37,6 +37,7 @@ Unicode true ; Generate a Unicode installer. It can only be used outside of se
|
||||||
SetCompressor /SOLID lzma ; This reduces installer size by approx 30~35%
|
SetCompressor /SOLID lzma ; This reduces installer size by approx 30~35%
|
||||||
;SetCompressor /FINAL lzma ; This reduces installer size by approx 15~18%
|
;SetCompressor /FINAL lzma ; This reduces installer size by approx 15~18%
|
||||||
|
|
||||||
|
Var allowAppDataPluginsLoading
|
||||||
|
|
||||||
!include "nsisInclude\winVer.nsh"
|
!include "nsisInclude\winVer.nsh"
|
||||||
!include "nsisInclude\globalDef.nsh"
|
!include "nsisInclude\globalDef.nsh"
|
||||||
|
@ -82,15 +83,22 @@ page Custom ExtraOptions
|
||||||
!define MUI_PAGE_CUSTOMFUNCTION_SHOW "un.CheckIfRunning"
|
!define MUI_PAGE_CUSTOMFUNCTION_SHOW "un.CheckIfRunning"
|
||||||
!insertmacro MUI_UNPAGE_INSTFILES
|
!insertmacro MUI_UNPAGE_INSTFILES
|
||||||
|
|
||||||
; TODO for optional arg
|
|
||||||
;!insertmacro GetParameters
|
|
||||||
|
|
||||||
|
|
||||||
!include "nsisInclude\langs4Installer.nsh"
|
!include "nsisInclude\langs4Installer.nsh"
|
||||||
|
|
||||||
Var diffArchDir2Remove
|
Var diffArchDir2Remove
|
||||||
Function .onInit
|
Function .onInit
|
||||||
|
|
||||||
|
${GetParameters} $R0
|
||||||
|
${GetOptions} $R0 "/allowAppDataPluginsLoading" $R1 ;case insensitive
|
||||||
|
IfErrors appdataLoadNo appdataLoadYes
|
||||||
|
appdataLoadNo:
|
||||||
|
StrCpy $allowAppDataPluginsLoading "false"
|
||||||
|
Goto appdataLoadDone
|
||||||
|
appdataLoadYes:
|
||||||
|
StrCpy $allowAppDataPluginsLoading "true"
|
||||||
|
appdataLoadDone:
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -42,7 +42,7 @@ Function setPathAndOptions
|
||||||
CreateDirectory $UPDATE_PATH\plugins\config
|
CreateDirectory $UPDATE_PATH\plugins\config
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
${If} $allowPluginLoadFromUserDataChecked == ${BST_CHECKED}
|
${If} $allowAppDataPluginsLoading == "true"
|
||||||
File "..\bin\allowAppDataPlugins.xml"
|
File "..\bin\allowAppDataPlugins.xml"
|
||||||
${ELSE}
|
${ELSE}
|
||||||
IfFileExists $INSTDIR\allowAppDataPlugins.xml 0 +2
|
IfFileExists $INSTDIR\allowAppDataPlugins.xml 0 +2
|
||||||
|
|
|
@ -100,6 +100,9 @@ Function ExtraOptions
|
||||||
${NSD_CreateCheckbox} 0 50 100% 30u "Allow plugins to be loaded from %APPDATA%\notepad++\plugins$\nIt could cause a security issue. Turn it on if you know what you are doing."
|
${NSD_CreateCheckbox} 0 50 100% 30u "Allow plugins to be loaded from %APPDATA%\notepad++\plugins$\nIt could cause a security issue. Turn it on if you know what you are doing."
|
||||||
Pop $PluginLoadFromUserDataCheckboxHandle
|
Pop $PluginLoadFromUserDataCheckboxHandle
|
||||||
${NSD_OnClick} $PluginLoadFromUserDataCheckboxHandle OnChange_PluginLoadFromUserDataCheckBox
|
${NSD_OnClick} $PluginLoadFromUserDataCheckboxHandle OnChange_PluginLoadFromUserDataCheckBox
|
||||||
|
${If} $allowAppDataPluginsLoading == "true"
|
||||||
|
${NSD_Check} $PluginLoadFromUserDataCheckboxHandle
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
${NSD_CreateCheckbox} 0 110 100% 30u "Create Shortcut on Desktop"
|
${NSD_CreateCheckbox} 0 110 100% 30u "Create Shortcut on Desktop"
|
||||||
Pop $ShortcutCheckboxHandle
|
Pop $ShortcutCheckboxHandle
|
||||||
|
@ -138,6 +141,12 @@ FunctionEnd
|
||||||
|
|
||||||
Function OnChange_PluginLoadFromUserDataCheckBox
|
Function OnChange_PluginLoadFromUserDataCheckBox
|
||||||
${NSD_GetState} $PluginLoadFromUserDataCheckboxHandle $allowPluginLoadFromUserDataChecked
|
${NSD_GetState} $PluginLoadFromUserDataCheckboxHandle $allowPluginLoadFromUserDataChecked
|
||||||
|
|
||||||
|
${If} $allowPluginLoadFromUserDataChecked == ${BST_CHECKED}
|
||||||
|
StrCpy $allowAppDataPluginsLoading "true"
|
||||||
|
${ELSE}
|
||||||
|
StrCpy $allowAppDataPluginsLoading "false"
|
||||||
|
${EndIf}
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function OnChange_ShortcutCheckBox
|
Function OnChange_ShortcutCheckBox
|
||||||
|
|
Loading…
Reference in New Issue