MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / GetEdgeExecutableLocation

Method GetEdgeExecutableLocation

cpp/iedriver/BrowserFactory.cpp:1342–1369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1340}
1341
1342void BrowserFactory::GetEdgeExecutableLocation() {
1343 LOG(TRACE) << "Entering BrowserFactory::GetEdgeExecutableLocation";
1344 std::wstring edge_executable_location;
1345 if (RegistryUtilities::GetRegistryValue(HKEY_LOCAL_MACHINE,
1346 EDGE_REGISTRY_KEY,
1347 L"",
1348 true,
1349 &edge_executable_location)) {
1350 // If the executable location in the registry has an environment
1351 // variable in it, expand the environment variable to an absolute
1352 // path.
1353 DWORD expanded_location_size = ::ExpandEnvironmentStrings(edge_executable_location.c_str(), NULL, 0);
1354 std::vector<wchar_t> expanded_location(expanded_location_size);
1355 ::ExpandEnvironmentStrings(edge_executable_location.c_str(), &expanded_location[0], expanded_location_size);
1356 edge_executable_location = &expanded_location[0];
1357 this->edge_executable_located_location_ = edge_executable_location;
1358 size_t arg_start_pos = edge_executable_location.find(L" -");
1359 if (arg_start_pos != std::string::npos) {
1360 this->edge_executable_located_location_ = edge_executable_location.substr(0, arg_start_pos);
1361 }
1362 if (this->edge_executable_located_location_.substr(0, 1) == L"\"") {
1363 this->edge_executable_located_location_.erase(0, 1);
1364 this->edge_executable_located_location_.erase(this->edge_executable_located_location_.size() - 1, 1);
1365 }
1366 } else {
1367 LOG(WARN) << "Unable to get Edge executable location from registry";
1368 }
1369}
1370
1371void BrowserFactory::GetIEVersion() {
1372 LOG(TRACE) << "Entering BrowserFactory::GetIEVersion";

Callers 1

BrowserFactoryMethod · 0.95

Calls 3

findMethod · 0.80
LOGClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected