From 7c0bf9f1f44339ae0d64581b62f98109e148e7c0 Mon Sep 17 00:00:00 2001 From: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Date: Wed, 28 Sep 2022 15:31:25 +0200 Subject: [PATCH] [FileExplorer Add-ons][Dev files] Add regfile registry key for previewing .reg files (#20579) * Add regfile registry key for previewing .reg files * Address PR comments --- src/common/utils/registry.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/utils/registry.h b/src/common/utils/registry.h index 2297c3850c..689b436a7b 100644 --- a/src/common/utils/registry.h +++ b/src/common/utils/registry.h @@ -378,6 +378,12 @@ namespace registry std::wstring kindMapPath = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\KindMap"; changes.push_back({ HKEY_LOCAL_MACHINE, kindMapPath, fileType, fileKindType, false}); } + if (handlerType == PreviewHandlerType::preview && fileType == L".reg") + { + // this regfile registry key has precedence over Software\Classes\.reg for .reg files + std::wstring regfilePath = L"Software\\Classes\\regfile\\shellex\\" + IPREVIEW_HANDLER_CLSID + L"\\"; + changes.push_back({ scope, regfilePath, std::nullopt, handlerClsid }); + } } if (handlerType == PreviewHandlerType::preview)