Check executable directory for system plugins (in plugins folder) on Windows
This commit is contained in:
parent
b8bfd1dddc
commit
567ad09506
1 changed files with 22 additions and 0 deletions
|
|
@ -13,6 +13,10 @@
|
|||
#include "OpenRGBThemeManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
PluginManager::PluginManager()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
|
|
@ -64,6 +68,24 @@ void PluginManager::ScanAndLoadPlugins()
|
|||
\*---------------------------------------------------------*/
|
||||
ScanAndLoadPluginsFrom(OPENRGB_SYSTEM_PLUGIN_DIRECTORY, true);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
/*---------------------------------------------------------*\
|
||||
| Get the exe folder plugins directory (Windows) |
|
||||
| |
|
||||
| On Windows, system plugins are located in a folder called |
|
||||
| "plugins" inside the folder where the OpenRGB.exe file is |
|
||||
| installed. Typically, C:\Program Files\OpenRGB but other |
|
||||
| install paths are allowed. |
|
||||
\*---------------------------------------------------------*/
|
||||
char path[MAX_PATH];
|
||||
GetModuleFileName(NULL, path, MAX_PATH);
|
||||
|
||||
filesystem::path exe_dir(path);
|
||||
exe_dir = exe_dir.remove_filename() / plugins_path;
|
||||
|
||||
ScanAndLoadPluginsFrom(exe_dir, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void PluginManager::ScanAndLoadPluginsFrom(const filesystem::path & plugins_dir, bool is_system)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue