diff --git a/PluginManager.cpp b/PluginManager.cpp index db3d0fa6..b394fc62 100644 --- a/PluginManager.cpp +++ b/PluginManager.cpp @@ -13,6 +13,10 @@ #include "OpenRGBThemeManager.h" #include "SettingsManager.h" +#ifdef _WIN32 +#include +#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)