Use exe path to search for fonts

This commit is contained in:
2022-07-22 21:48:04 +02:00
parent ebdd35b1e1
commit 7fa68792fb
8 changed files with 59 additions and 8 deletions

View File

@@ -81,12 +81,9 @@ void setAutostart(bool newValue)
if (newValue)
{
std::wstring appPath;
appPath.resize(MAX_PATH_LENGTH);
hr = GetModuleFileName(NULL, &appPath[0], static_cast<DWORD>(appPath.size()));
if (isError(hr, "Failed to get executable name: ")) return;
appPath.resize(wcslen(appPath.data()));
if (FAILED(getAppPath(appPath))) return;
hr = RegSetValueEx(runKey, KEY_APP_NAME, 0, REG_SZ, (BYTE*)appPath.c_str(), (appPath.size() + 1) * sizeof(wchar_t));
hr = RegSetValueEx(runKey, KEY_APP_NAME, 0, REG_SZ, (BYTE*)appPath.c_str(), static_cast<DWORD>((appPath.size() + 1) * sizeof(wchar_t)));
if (isError(hr, "Failed to write autostart key: ")) return;
}
else