Fix the plugin crash issue due to the inexistent path
Inexistent path %APPDATA%\Notepad++\plugins\Config\ made some plugins crash. In this PR the folder is checked (and created if it doesn't exist) by each launch of Notepad++.
This commit is contained in:
parent
647651b7ee
commit
a079013c22
@ -1028,13 +1028,18 @@ bool NppParameters::load()
|
|||||||
_userPath = getSpecialFolderLocation(CSIDL_APPDATA);
|
_userPath = getSpecialFolderLocation(CSIDL_APPDATA);
|
||||||
|
|
||||||
PathAppend(_userPath, TEXT("Notepad++"));
|
PathAppend(_userPath, TEXT("Notepad++"));
|
||||||
_appdataNppDir = _userPluginConfDir = _userPath;
|
|
||||||
PathAppend(_userPluginConfDir, TEXT("plugins"));
|
|
||||||
PathAppend(_userPluginConfDir, TEXT("Config"));
|
|
||||||
|
|
||||||
if (!PathFileExists(_userPath.c_str()))
|
if (!PathFileExists(_userPath.c_str()))
|
||||||
::CreateDirectory(_userPath.c_str(), NULL);
|
::CreateDirectory(_userPath.c_str(), NULL);
|
||||||
|
|
||||||
|
_appdataNppDir = _userPluginConfDir = _userPath;
|
||||||
|
PathAppend(_userPluginConfDir, TEXT("plugins"));
|
||||||
|
if (!PathFileExists(_userPluginConfDir.c_str()))
|
||||||
|
::CreateDirectory(_userPluginConfDir.c_str(), NULL);
|
||||||
|
PathAppend(_userPluginConfDir, TEXT("Config"));
|
||||||
|
if (!PathFileExists(_userPluginConfDir.c_str()))
|
||||||
|
::CreateDirectory(_userPluginConfDir.c_str(), NULL);
|
||||||
|
|
||||||
|
|
||||||
_pluginRootDir = getSpecialFolderLocation(CSIDL_COMMON_APPDATA);
|
_pluginRootDir = getSpecialFolderLocation(CSIDL_COMMON_APPDATA);
|
||||||
PathAppend(_pluginRootDir, TEXT("Notepad++"));
|
PathAppend(_pluginRootDir, TEXT("Notepad++"));
|
||||||
nppPluginRootParent = _pluginRootDir;
|
nppPluginRootParent = _pluginRootDir;
|
||||||
|
Loading…
Reference in New Issue
Block a user