Change nppPluginList.dll installation locaion

From %LOCALAPPDATA%\Ntepad++\plugins\Config\ to %PROGRAMDATA%\Ntepad++\plugins\Config\
This commit is contained in:
Don HO 2018-12-06 02:31:39 +01:00
parent 775d204ef9
commit 15ef9bd052
4 changed files with 43 additions and 19 deletions

View File

@ -68,8 +68,7 @@ SectionGroup "Plugins" Plugins
${MementoSectionEnd} ${MementoSectionEnd}
${MementoSection} "Decent Spell-Checking" DSpellCheck ${MementoSection} "Decent Spell-Checking" DSpellCheck
Call setPathAndOptions
Delete "$INSTDIR\plugins\DSpellCheck.dll" Delete "$INSTDIR\plugins\DSpellCheck.dll"
Delete "$INSTDIR\plugins\DSpellCheck\DSpellCheck.dll" Delete "$INSTDIR\plugins\DSpellCheck\DSpellCheck.dll"
Delete "$PLUGIN_INST_PATH\DSpellCheck\DSpellCheck.dll" Delete "$PLUGIN_INST_PATH\DSpellCheck\DSpellCheck.dll"
@ -78,12 +77,12 @@ SectionGroup "Plugins" Plugins
SetOutPath "$PLUGIN_INST_PATH\DSpellCheck" SetOutPath "$PLUGIN_INST_PATH\DSpellCheck"
!ifdef ARCH64 !ifdef ARCH64
File "..\bin64\plugins\DSpellCheck\DSpellCheck.dll" File "..\bin64\plugins\DSpellCheck\DSpellCheck.dll"
SetOutPath "$PLUGIN_CONF_PATH\Hunspell" SetOutPath "$USER_PLUGIN_CONF_PATH\Hunspell"
File "..\bin64\plugins\Config\Hunspell\en_US.aff" File "..\bin64\plugins\Config\Hunspell\en_US.aff"
File "..\bin64\plugins\Config\Hunspell\en_US.dic" File "..\bin64\plugins\Config\Hunspell\en_US.dic"
!else !else
File "..\bin\plugins\DSpellCheck\DSpellCheck.dll" File "..\bin\plugins\DSpellCheck\DSpellCheck.dll"
SetOutPath "$PLUGIN_CONF_PATH\Hunspell" SetOutPath "$USER_PLUGIN_CONF_PATH\Hunspell"
File "..\bin\plugins\Config\Hunspell\en_US.aff" File "..\bin\plugins\Config\Hunspell\en_US.aff"
File "..\bin\plugins\Config\Hunspell\en_US.dic" File "..\bin\plugins\Config\Hunspell\en_US.dic"
!endif !endif
@ -114,7 +113,7 @@ ${MementoSectionEnd}
${MementoSection} "Plugins Admin" PluginsAdmin ${MementoSection} "Plugins Admin" PluginsAdmin
SetOverwrite on SetOverwrite on
SetOutPath $PLUGIN_CONF_PATH SetOutPath $ALLUSERS_PLUGIN_CONF_PATH
!ifdef ARCH64 !ifdef ARCH64
File "..\bin64\nppPluginList.dll" File "..\bin64\nppPluginList.dll"
!else !else
@ -128,6 +127,7 @@ SectionGroup un.Plugins
Delete "$INSTDIR\plugins\NppExport.dll" Delete "$INSTDIR\plugins\NppExport.dll"
Delete "$INSTDIR\plugins\NppExport\NppExport.dll" Delete "$INSTDIR\plugins\NppExport\NppExport.dll"
RMDir "$INSTDIR\plugins\NppExport" RMDir "$INSTDIR\plugins\NppExport"
Delete "$PLUGIN_INST_PATH\NppExport\NppExport.dll" Delete "$PLUGIN_INST_PATH\NppExport\NppExport.dll"
RMDir "$PLUGIN_INST_PATH\NppExport" RMDir "$PLUGIN_INST_PATH\NppExport"
SectionEnd SectionEnd
@ -137,14 +137,14 @@ SectionGroup un.Plugins
Delete "$INSTDIR\plugins\NppConverter\NppConverter.dll" Delete "$INSTDIR\plugins\NppConverter\NppConverter.dll"
RMDir "$INSTDIR\plugins\NppConverter" RMDir "$INSTDIR\plugins\NppConverter"
Delete "$PLUGIN_INST_PATH\NppConverter\NppConverter.dll" Delete "$PLUGIN_INST_PATH\NppConverter\NppConverter.dll"
RMDir "PLUGIN_INST_PATH\NppConverter" RMDir "$PLUGIN_INST_PATH\NppConverter"
SectionEnd SectionEnd
Section un.MimeTools Section un.MimeTools
Delete "$INSTDIR\plugins\mimeTools.dll" Delete "$INSTDIR\plugins\mimeTools.dll"
Delete "$INSTDIR\plugins\mimeTools\mimeTools.dll" Delete "$INSTDIR\plugins\mimeTools\mimeTools.dll"
RMDir "$INSTDIR\plugins\mimeTools" RMDir "$INSTDIR\plugins\mimeTools"
Delete "PLUGIN_INST_PATH\mimeTools\mimeTools.dll" Delete "$PLUGIN_INST_PATH\mimeTools\mimeTools.dll"
RMDir "$PLUGIN_INST_PATH\mimeTools" RMDir "$PLUGIN_INST_PATH\mimeTools"
SectionEnd SectionEnd
@ -156,16 +156,17 @@ SectionGroup un.Plugins
SectionEnd SectionEnd
Section un.DSpellCheck Section un.DSpellCheck
Delete "$INSTDIR\plugins\DSpellCheck.dll" Delete "$INSTDIR\plugins\DSpellCheck.dll"
Delete "$INSTDIR\plugins\DSpellCheck\DSpellCheck.dll" Delete "$PLUGIN_INST_PATH\DSpellCheck\DSpellCheck.dll"
Delete "$UPDATE_PATH\plugins\Config\DSpellCheck.ini" Delete "$UPDATE_PATH\plugins\Config\DSpellCheck.ini"
Delete "$PLUGIN_CONF_PATH\DSpellCheck.ini" Delete "$ALLUSERS_PLUGIN_CONF_PATH\DSpellCheck.ini"
Delete "$INSTDIR\plugins\Config\Hunspell\en_US.aff" Delete "$INSTDIR\plugins\Config\Hunspell\en_US.aff"
Delete "$PLUGIN_CONF_PATH\Hunspell\en_US.aff" Delete "$USER_PLUGIN_CONF_PATH\Hunspell\en_US.aff"
Delete "$INSTDIR\plugins\Config\Hunspell\en_US.dic" Delete "$INSTDIR\plugins\Config\Hunspell\en_US.dic"
Delete "$PLUGIN_CONF_PATH\Hunspell\en_US.dic" Delete "$USER_PLUGIN_CONF_PATH\Hunspell\en_US.dic"
RMDir /r "$INSTDIR\plugins\Config" ; Remove Config folder recursively only if empty RMDir /r "$INSTDIR\plugins\Config" ; Remove Config folder recursively only if empty
RMDir /r "$PLUGIN_CONF_PATH\Config" ; Remove Config folder recursively only if empty RMDir /r "$ALLUSERS_PLUGIN_CONF_PATH\Config" ; Remove Config folder recursively only if empty
RMDir "$INSTDIR\plugins\DSpellCheck" RMDir "$INSTDIR\plugins\DSpellCheck"
SectionEnd SectionEnd
@ -194,5 +195,6 @@ ${EndIf}
FunctionEnd FunctionEnd
Section un.PluginsAdmin Section un.PluginsAdmin
Delete "$PLUGIN_CONF_PATH\nppPluginList.dll" Delete "$PLUGIN_CONF_PATH\nppPluginList.dll" ; delete 7.6 version's left
Delete "$ALLUSERS_PLUGIN_CONF_PATH\nppPluginList.dll"
SectionEnd SectionEnd

View File

@ -27,14 +27,18 @@
Var UPDATE_PATH Var UPDATE_PATH
Var PLUGIN_INST_PATH Var PLUGIN_INST_PATH
Var PLUGIN_CONF_PATH Var USER_PLUGIN_CONF_PATH
Var ALLUSERS_PLUGIN_CONF_PATH
Function setPathAndOptions Function setPathAndOptions
${If} $UPDATE_PATH == "" ${If} $UPDATE_PATH == ""
${OrIf} $PLUGIN_INST_PATH == ""
${OrIf} $USER_PLUGIN_CONF_PATH == ""
${OrIf} $ALLUSERS_PLUGIN_CONF_PATH == ""
Goto initUpdatePath Goto initUpdatePath
${ELSE} ${ELSE}
Goto alreadyDone Goto alreadyDone
${EndIf} ${EndIf}
initUpdatePath: initUpdatePath:
; Set Section properties ; Set Section properties
@ -44,26 +48,42 @@ initUpdatePath:
SetOutPath "$INSTDIR\" SetOutPath "$INSTDIR\"
${If} $noUserDataChecked == ${BST_CHECKED} ${If} $noUserDataChecked == ${BST_CHECKED}
File "..\bin\doLocalConf.xml" File "..\bin\doLocalConf.xml"
StrCpy $PLUGIN_INST_PATH "$INSTDIR\plugins" StrCpy $PLUGIN_INST_PATH "$INSTDIR\plugins"
StrCpy $PLUGIN_CONF_PATH "$INSTDIR\plugins\Config" StrCpy $ALLUSERS_PLUGIN_CONF_PATH "$INSTDIR\plugins\Config"
StrCpy $USER_PLUGIN_CONF_PATH "$INSTDIR\plugins\Config"
CreateDirectory $PLUGIN_INST_PATH\config CreateDirectory $PLUGIN_INST_PATH\config
${ELSE} ${ELSE}
IfFileExists $INSTDIR\doLocalConf.xml 0 +2 IfFileExists $INSTDIR\doLocalConf.xml 0 +2
Delete $INSTDIR\doLocalConf.xml Delete $INSTDIR\doLocalConf.xml
; "%PROGRAMDATA%\Notepad++\plugins" ; "%PROGRAMDATA%\Notepad++\plugins"
ReadEnvStr $0 "ALLUSERSPROFILE" ReadEnvStr $0 "ALLUSERSPROFILE"
StrCpy $PLUGIN_INST_PATH "$0\Notepad++\plugins" StrCpy $PLUGIN_INST_PATH "$0\Notepad++\plugins"
StrCpy $ALLUSERS_PLUGIN_CONF_PATH "$0\Notepad++\plugins\Config"
StrCpy $PLUGIN_CONF_PATH "$APPDATA\${APPNAME}\plugins\Config" StrCpy $USER_PLUGIN_CONF_PATH "$APPDATA\${APPNAME}\plugins\Config"
StrCpy $UPDATE_PATH "$APPDATA\${APPNAME}" StrCpy $UPDATE_PATH "$APPDATA\${APPNAME}"
CreateDirectory $UPDATE_PATH\plugins\config CreateDirectory $UPDATE_PATH\plugins\config
${EndIf} ${EndIf}
WriteIniStr "$INSTDIR\uninstall.ini" "Uninstall" "UPDATE_PATH" $UPDATE_PATH
WriteIniStr "$INSTDIR\uninstall.ini" "Uninstall" "PLUGIN_INST_PATH" $PLUGIN_INST_PATH
WriteIniStr "$INSTDIR\uninstall.ini" "Uninstall" "USER_PLUGIN_CONF_PATH" $USER_PLUGIN_CONF_PATH
WriteIniStr "$INSTDIR\uninstall.ini" "Uninstall" "ALLUSERS_PLUGIN_CONF_PATH" $ALLUSERS_PLUGIN_CONF_PATH
alreadyDone: alreadyDone:
FunctionEnd FunctionEnd
Function un.setPathAndOptions
ReadINIStr $UPDATE_PATH "$INSTDIR\uninstall.ini" "Uninstall" "UPDATE_PATH"
ReadINIStr $PLUGIN_INST_PATH "$INSTDIR\uninstall.ini" "Uninstall" "PLUGIN_INST_PATH"
ReadINIStr $USER_PLUGIN_CONF_PATH "$INSTDIR\uninstall.ini" "Uninstall" "USER_PLUGIN_CONF_PATH"
ReadINIStr $ALLUSERS_PLUGIN_CONF_PATH "$INSTDIR\uninstall.ini" "Uninstall" "ALLUSERS_PLUGIN_CONF_PATH"
FunctionEnd
Function copyCommonFiles Function copyCommonFiles
SetOverwrite off SetOverwrite off
SetOutPath "$UPDATE_PATH\" SetOutPath "$UPDATE_PATH\"

View File

@ -39,6 +39,8 @@ doesExist:
StrCpy $doLocalConf "true" StrCpy $doLocalConf "true"
noneExist: noneExist:
;MessageBox MB_OK "doLocalConf == $doLocalConf" ;MessageBox MB_OK "doLocalConf == $doLocalConf"
Call un.setPathAndOptions
FunctionEnd FunctionEnd
Function un.onUninstSuccess Function un.onUninstSuccess
@ -245,6 +247,7 @@ Section Uninstall
Delete "$INSTDIR\SourceCodePro-BoldIt.ttf" Delete "$INSTDIR\SourceCodePro-BoldIt.ttf"
Delete "$INSTDIR\NppHelp.chm" Delete "$INSTDIR\NppHelp.chm"
Delete "$INSTDIR\doLocalConf.xml" Delete "$INSTDIR\doLocalConf.xml"
Delete "$INSTDIR\uninstall.ini"
${If} $doLocalConf == "false" ${If} $doLocalConf == "false"
Call un.doYouReallyWantToKeepData Call un.doYouReallyWantToKeepData

View File

@ -1070,7 +1070,6 @@ INT_PTR CALLBACK PluginsAdminDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
{ {
case WM_INITDIALOG : case WM_INITDIALOG :
{ {
return TRUE; return TRUE;
} }