comparison win/edge.cpp @ 2224:d3974aa8ad64

Win: Add a second registry check for when running on x86.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 24 Dec 2020 09:42:52 +0000
parents a81b9031412e
children 2e804b4db81e
comparison
equal deleted inserted replaced
2223:a81b9031412e 2224:d3974aa8ad64
424 WCHAR szBuffer[100] = {0}; 424 WCHAR szBuffer[100] = {0};
425 DWORD dwBufferSize = sizeof(szBuffer); 425 DWORD dwBufferSize = sizeof(szBuffer);
426 static WCHAR EdgeStablePath[MAX_PATH+1] = {0}; 426 static WCHAR EdgeStablePath[MAX_PATH+1] = {0};
427 427
428 /* If we haven't successfully gotten the path, try to find it in the registry */ 428 /* If we haven't successfully gotten the path, try to find it in the registry */
429 if(!EdgeStablePath[0] && 429 if(!EdgeStablePath[0])
430 RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\WOW6432Node\\Microsoft\\EdgeUpdate\\Clients\\{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}", 0, KEY_READ, &hKey) == ERROR_SUCCESS && 430 {
431 RegQueryValueExW(hKey, L"pv", 0, NULL, (LPBYTE)szBuffer, &dwBufferSize) == ERROR_SUCCESS) 431 // Handle the case we are running on x64
432 { 432 if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\WOW6432Node\\Microsoft\\EdgeUpdate\\Clients\\{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}", 0, KEY_READ, &hKey) == ERROR_SUCCESS &&
433 wcscpy(EdgeStablePath, L"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\"); 433 RegQueryValueExW(hKey, L"pv", 0, NULL, (LPBYTE)szBuffer, &dwBufferSize) == ERROR_SUCCESS)
434 wcscat(EdgeStablePath, szBuffer); 434 {
435 wcscpy(EdgeStablePath, L"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\");
436 wcscat(EdgeStablePath, szBuffer);
437 }
438 // and also the case we are running x86
439 else if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\EdgeUpdate\\Clients\\{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}", 0, KEY_READ, &hKey) == ERROR_SUCCESS &&
440 RegQueryValueExW(hKey, L"pv", 0, NULL, (LPBYTE)szBuffer, &dwBufferSize) == ERROR_SUCCESS)
441 {
442 wcscpy(EdgeStablePath, L"C:\\Program Files\\Microsoft\\Edge\\Application\\");
443 wcscat(EdgeStablePath, szBuffer);
444 }
435 } 445 }
436 return EdgeStablePath; 446 return EdgeStablePath;
437 } 447 }
438 448
439 /******************************* dw_edge_detect() ************************** 449 /******************************* dw_edge_detect() **************************