Skip to content

Commit

Permalink
support new CoreAudioToolbox location
Browse files Browse the repository at this point in the history
  • Loading branch information
nu774 committed Sep 17, 2020
1 parent fa133c7 commit 4f1d080
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,16 +869,22 @@ void set_dll_directories(int verbose)

try {
HKEY hKey;
const wchar_t *subkey =
L"SOFTWARE\\Apple Inc.\\Apple Application Support";
HR(RegOpenKeyExW(HKEY_LOCAL_MACHINE, subkey, 0, KEY_READ, &hKey));
std::shared_ptr<HKEY__> hKeyPtr(hKey, RegCloseKey);
DWORD size;
HR(RegQueryValueExW(hKey, L"InstallDir", 0, 0, 0, &size));
std::vector<wchar_t> vec(size/sizeof(wchar_t));
HR(RegQueryValueExW(hKey, L"InstallDir", 0, 0,
reinterpret_cast<LPBYTE>(&vec[0]), &size));
searchPaths = strutil::format(L"%s;%s", &vec[0], searchPaths.c_str());
const wchar_t *subkey[] = {
L"SOFTWARE\\Apple Inc.\\Apple Application Support",
L"SOFTWARE\\Apple Computer, Inc.\\iTunes",
};
for (int i = 0; i < 2; ++i) {
if (!RegOpenKeyExW(HKEY_LOCAL_MACHINE, subkey[i], 0, KEY_READ, &hKey)) {
std::shared_ptr<HKEY__> hKeyPtr(hKey, RegCloseKey);
DWORD size;
if (!RegQueryValueExW(hKey, L"InstallDir", 0, 0, 0, &size)) {
std::vector<wchar_t> vec(size/sizeof(wchar_t));
RegQueryValueExW(hKey, L"InstallDir", 0, 0,
reinterpret_cast<LPBYTE>(&vec[0]), &size);
searchPaths = strutil::format(L"%s;%s", &vec[0], searchPaths.c_str());
}
}
}
} catch (const std::exception &) {}
std::wstring dir = win32::get_module_directory() + L"QTfiles";
#ifdef _WIN64
Expand Down

0 comments on commit 4f1d080

Please sign in to comment.