[settings] loading powerpreview module from subfolder (#2709)

* loading module in sub-folders

* reverted un-related change
This commit is contained in:
Lavius Motileng
2020-05-08 08:23:18 -07:00
committed by GitHub
parent 1ab0a5182f
commit 6b2955f135

View File

@@ -122,6 +122,9 @@ int runner(bool isProcessElevated)
chdir_current_executable(); chdir_current_executable();
// Load Powertyos DLLS // Load Powertyos DLLS
// For now only load known DLLs // For now only load known DLLs
std::wstring baseModuleFolder = L"modules/";
std::unordered_set<std::wstring> known_dlls = { std::unordered_set<std::wstring> known_dlls = {
L"shortcut_guide.dll", L"shortcut_guide.dll",
L"fancyzones.dll", L"fancyzones.dll",
@@ -131,7 +134,15 @@ int runner(bool isProcessElevated)
L"powerpreview.dll", L"powerpreview.dll",
L"KeyboardManager.dll" L"KeyboardManager.dll"
}; };
for (auto& file : std::filesystem::directory_iterator(L"modules/"))
std::unordered_set<std::wstring> module_folders = {
L"",
L"FileExplorerPreview/",
};
for (std::wstring subfolderName : module_folders)
{
for (auto& file : std::filesystem::directory_iterator(baseModuleFolder + subfolderName))
{ {
if (file.path().extension() != L".dll") if (file.path().extension() != L".dll")
continue; continue;
@@ -146,6 +157,7 @@ int runner(bool isProcessElevated)
{ {
} }
} }
}
// Start initial powertoys // Start initial powertoys
start_initial_powertoys(); start_initial_powertoys();