From 589e21151dc87acb523fb17c0a9e5ee3bfd2a73a Mon Sep 17 00:00:00 2001 From: Don HO Date: Tue, 25 Dec 2018 19:25:38 +0100 Subject: [PATCH] Change the access right of folders via installer %PROGRAMDATA%\Notepad++\plugins\ will be restricted %PROGRAMDATA%\Notepad++\plugins\Config\ will has full access --- PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh b/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh index 070bee15..d6432cbb 100644 --- a/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh +++ b/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh @@ -59,11 +59,17 @@ initUpdatePath: IfFileExists $INSTDIR\doLocalConf.xml 0 +2 Delete $INSTDIR\doLocalConf.xml - ; "%PROGRAMDATA%\Notepad++\plugins" + ; "SetShellVarContext all" makes "$APPDATA\${APPNAME}\plugins" to "%PROGRAMDATA%\Notepad++\plugins" SetShellVarContext all StrCpy $PLUGIN_INST_PATH "$APPDATA\${APPNAME}\plugins" StrCpy $ALLUSERS_PLUGIN_CONF_PATH "$APPDATA\${APPNAME}\plugins\Config" - + + CreateDirectory $PLUGIN_INST_PATH + AccessControl::GrantOnFile "$PLUGIN_INST_PATH" "(S-1-5-32-545)" "ListDirectory + GenericRead + GenericExecute" + + CreateDirectory $ALLUSERS_PLUGIN_CONF_PATH + AccessControl::GrantOnFile "$ALLUSERS_PLUGIN_CONF_PATH" "(S-1-5-32-545)" "FullAccess" + SetShellVarContext current StrCpy $USER_PLUGIN_CONF_PATH "$APPDATA\${APPNAME}\plugins\Config" StrCpy $UPDATE_PATH "$APPDATA\${APPNAME}"