From f8aba0122ea3fca77ca1e38f13cbb87bb5f77385 Mon Sep 17 00:00:00 2001 From: Don HO Date: Sun, 2 Dec 2018 00:58:07 +0100 Subject: [PATCH] Make %PROGRAMDATA%\Notepad++\plugins\ as default plugins installation location And remove %LOCALAPPDATA%\Notepad++\plugins\ location --- PowerEditor/installer/nppSetup.nsi | 12 ------------ .../installer/nsisInclude/langs4Npp.nsh | 1 - .../nsisInclude/mainSectionFuncs.nsh | 15 +++++---------- PowerEditor/installer/nsisInclude/tools.nsh | 19 +------------------ 4 files changed, 6 insertions(+), 41 deletions(-) diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index ad74da2f9..d1f74daf7 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -41,8 +41,6 @@ SetCompressor /SOLID lzma ; This reduces installer size by approx 30~35% ; Installer is DPI-aware: not scaled by the DWM, no blurry text ManifestDPIAware true -Var arePlugins4AllUsers - !include "nsisInclude\winVer.nsh" !include "nsisInclude\globalDef.nsh" !include "nsisInclude\tools.nsh" @@ -133,16 +131,6 @@ withoutUpdater: StrCpy $noUpdater "true" updaterDone: - ${GetOptions} $R0 "/pluginsForAllUsers" $R1 ;case insensitive - IfErrors withoutPlugins4AllUsers withPlugins4AllUsers -withPlugins4AllUsers: - StrCpy $arePlugins4AllUsers "true" - Goto plugins4AllUsersDone -withoutPlugins4AllUsers: - StrCpy $arePlugins4AllUsers "false" -plugins4AllUsersDone: - - ${If} $noUpdater == "true" !insertmacro UnSelectSection ${AutoUpdater} SectionSetText ${AutoUpdater} "" diff --git a/PowerEditor/installer/nsisInclude/langs4Npp.nsh b/PowerEditor/installer/nsisInclude/langs4Npp.nsh index 5439625c2..eae209b9a 100644 --- a/PowerEditor/installer/nsisInclude/langs4Npp.nsh +++ b/PowerEditor/installer/nsisInclude/langs4Npp.nsh @@ -283,7 +283,6 @@ SectionGroup "Localization" localization ${MementoUnselectedSection} "Kurdish" kurdish CopyFiles "$PLUGINSDIR\nppLocalization\kurdish.xml" "$INSTDIR\localization\kurdish.xml" ${MementoSectionEnd} - ${MementoSectionEnd} ${MementoUnselectedSection} "Piglatin" piglatin CopyFiles "$PLUGINSDIR\nppLocalization\piglatin.xml" "$INSTDIR\localization\piglatin.xml" ${MementoSectionEnd} diff --git a/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh b/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh index 0fa283774..12d024039 100644 --- a/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh +++ b/PowerEditor/installer/nsisInclude/mainSectionFuncs.nsh @@ -51,20 +51,15 @@ initUpdatePath: ${ELSE} IfFileExists $INSTDIR\doLocalConf.xml 0 +2 Delete $INSTDIR\doLocalConf.xml - StrCpy $PLUGIN_INST_PATH "$PROFILE\AppData\Local\${APPNAME}\plugins" + + ; "%PROGRAMDATA%\Notepad++\plugins" + ReadEnvStr $0 "ALLUSERSPROFILE" + StrCpy $PLUGIN_INST_PATH "$0\Notepad++\plugins" + StrCpy $PLUGIN_CONF_PATH "$APPDATA\${APPNAME}\plugins\Config" StrCpy $UPDATE_PATH "$APPDATA\${APPNAME}" CreateDirectory $UPDATE_PATH\plugins\config ${EndIf} - - ; override PLUGIN_INST_PATH - ${If} $arePlugins4AllUsers == "true" - ReadEnvStr $0 "ALLUSERSPROFILE" - StrCpy $PLUGIN_INST_PATH "$0\Notepad++\plugins" - File /oname=$INSTDIR\pluginsForAllUsers.xml "..\bin\pluginsForAllUsers_dummy.xml" - ${ELSE} - Delete $INSTDIR\pluginsForAllUsers.xml - ${EndIf} alreadyDone: FunctionEnd diff --git a/PowerEditor/installer/nsisInclude/tools.nsh b/PowerEditor/installer/nsisInclude/tools.nsh index 60fd46cb0..2ee287e4d 100644 --- a/PowerEditor/installer/nsisInclude/tools.nsh +++ b/PowerEditor/installer/nsisInclude/tools.nsh @@ -81,7 +81,6 @@ FunctionEnd ;Installer Functions Var Dialog Var NoUserDataCheckboxHandle -Var Plugin4AllUsersCheckboxHandle Var ShortcutCheckboxHandle Var WinVer @@ -99,14 +98,7 @@ Function ExtraOptions ${NSD_Check} $ShortcutCheckboxHandle ${NSD_OnClick} $ShortcutCheckboxHandle OnChange_ShortcutCheckBox - ${NSD_CreateCheckbox} 0 80 100% 30u "Check this will make your plugin installed for all users on this PC." - Pop $Plugin4AllUsersCheckboxHandle - ${If} $arePlugins4AllUsers == "true" - ${NSD_Check} $Plugin4AllUsersCheckboxHandle - ${EndIf} - ${NSD_OnClick} $Plugin4AllUsersCheckboxHandle OnChange_Plugin4AllUsersCheckBox - - ${NSD_CreateCheckbox} 0 160 100% 30u "Don't use %APPDATA%$\nEnable this option to make Notepad++ load/write the configuration files from/to its install directory. Check it if you use Notepad++ in a USB device." + ${NSD_CreateCheckbox} 0 80 100% 30u "Don't use %APPDATA%$\nEnable this option to make Notepad++ load/write the configuration files from/to its install directory. Check it if you use Notepad++ in a USB device." Pop $NoUserDataCheckboxHandle ${NSD_OnClick} $NoUserDataCheckboxHandle OnChange_NoUserDataCheckBox @@ -142,15 +134,6 @@ Function OnChange_ShortcutCheckBox ${NSD_GetState} $ShortcutCheckboxHandle $createShortcutChecked FunctionEnd -Function OnChange_Plugin4AllUsersCheckBox - ${NSD_GetState} $ShortcutCheckboxHandle $0 - ${If} $0 == ${BST_CHECKED} - StrCpy $arePlugins4AllUsers "true" - ${ELSE} - StrCpy $arePlugins4AllUsers "false" - ${EndIf} -FunctionEnd - Function writeInstallInfoInRegistry WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\notepad++.exe" "" "$INSTDIR\notepad++.exe"