mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 22:25:38 +00:00
(Windows) Added support for appending strings to the winregistryvalue find rule.
This commit is contained in:
parent
678a1e0fc9
commit
361a93fd37
|
@ -1268,6 +1268,16 @@ const std::string FileData::findEmulatorPath(std::string& command)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::string value : emulatorWinRegistryValues) {
|
for (std::string value : emulatorWinRegistryValues) {
|
||||||
|
// If the pipe character is found, then the string following this should be appended
|
||||||
|
// to the key value, assuming the key is found.
|
||||||
|
std::string appendString;
|
||||||
|
size_t pipePos = value.find('|');
|
||||||
|
|
||||||
|
if (pipePos != std::string::npos) {
|
||||||
|
appendString = value.substr(pipePos + 1, std::string::npos);
|
||||||
|
value = value.substr(0, pipePos);
|
||||||
|
}
|
||||||
|
|
||||||
// Search for the defined value in the Windows Registry.
|
// Search for the defined value in the Windows Registry.
|
||||||
std::string registryValueKey =
|
std::string registryValueKey =
|
||||||
Utils::String::replace(Utils::FileSystem::getParent(value), "/", "\\");
|
Utils::String::replace(Utils::FileSystem::getParent(value), "/", "\\");
|
||||||
|
@ -1300,6 +1310,14 @@ const std::string FileData::findEmulatorPath(std::string& command)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strlen(path) == 0) {
|
||||||
|
RegCloseKey(registryKey);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!appendString.empty())
|
||||||
|
strncat_s(path, 1024, appendString.c_str(), appendString.length());
|
||||||
|
|
||||||
// That a value was found does not guarantee that the emulator binary actually exists,
|
// That a value was found does not guarantee that the emulator binary actually exists,
|
||||||
// so check for that as well.
|
// so check for that as well.
|
||||||
if (pathStatus == ERROR_SUCCESS) {
|
if (pathStatus == ERROR_SUCCESS) {
|
||||||
|
|
Loading…
Reference in a new issue