aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authormyd7349 <myd7349@gmail.com>2019-03-09 06:38:23 +0800
committerRobert Schumacher <roschuma@microsoft.com>2019-03-08 14:38:23 -0800
commit32f1120b9f7181b3db4537b9eb1c966d22b0dfe1 (patch)
tree8b7e9d6816102e50be0e203b03b308e7826eb897 /toolsrc/src
parent65f1d0ebc476523631b33e5ae5f30aa4917b2772 (diff)
downloadvcpkg-32f1120b9f7181b3db4537b9eb1c966d22b0dfe1.tar.gz
vcpkg-32f1120b9f7181b3db4537b9eb1c966d22b0dfe1.zip
[vcpkg edit] Update find_from_registry (#5393)
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg/commands.edit.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/toolsrc/src/vcpkg/commands.edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp
index c9d52c572..83ddea014 100644
--- a/toolsrc/src/vcpkg/commands.edit.cpp
+++ b/toolsrc/src/vcpkg/commands.edit.cpp
@@ -13,16 +13,37 @@ namespace vcpkg::Commands::Edit
std::vector<fs::path> output;
#if defined(_WIN32)
- static const std::array<const char*, 3> REGKEYS = {
- R"(SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C26E74D1-022E-4238-8B9D-1E7564A36CC9}_is1)",
- R"(SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1287CAD5-7C8D-410D-88B9-0D1EE4A83FF2}_is1)",
- R"(SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F8A2A208-72B3-4D61-95FC-8A65D340689B}_is1)",
+ struct RegKey
+ {
+ HKEY root;
+ const char *subkey;
+ } REGKEYS[] = {
+ {
+ HKEY_LOCAL_MACHINE,
+ R"(SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C26E74D1-022E-4238-8B9D-1E7564A36CC9}_is1)"
+ },
+ {
+ HKEY_LOCAL_MACHINE,
+ R"(SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1287CAD5-7C8D-410D-88B9-0D1EE4A83FF2}_is1)"
+ },
+ {
+ HKEY_LOCAL_MACHINE,
+ R"(SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F8A2A208-72B3-4D61-95FC-8A65D340689B}_is1)"
+ },
+ {
+ HKEY_CURRENT_USER,
+ R"(Software\Microsoft\Windows\CurrentVersion\Uninstall\{771FD6B0-FA20-440A-A002-3B3BAC16DC50}_is1)"
+ },
+ {
+ HKEY_LOCAL_MACHINE,
+ R"(SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EA457B21-F73E-494C-ACAB-524FDE069978}_is1)"
+ },
};
for (auto&& keypath : REGKEYS)
{
const Optional<std::string> code_installpath =
- System::get_registry_string(HKEY_LOCAL_MACHINE, keypath, "InstallLocation");
+ System::get_registry_string(keypath.root, keypath.subkey, "InstallLocation");
if (const auto c = code_installpath.get())
{
const fs::path install_path = fs::path(*c);