mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[win] updatesvc: fix app lang detection
This commit is contained in:
@ -117,8 +117,8 @@ namespace NS_Utils
|
||||
wstring GetAppLanguage()
|
||||
{
|
||||
wstring lang = TEXT("en_US"), subkey = TEXT("SOFTWARE\\" REG_GROUP_KEY "\\" REG_APP_NAME);
|
||||
HKEY hKey = NULL;
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, subkey.c_str(), 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS) {
|
||||
HKEY hKey = NULL, hRootKey = isRunAsApp() ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE;
|
||||
if (RegOpenKeyEx(hRootKey, subkey.c_str(), 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS) {
|
||||
DWORD type = REG_SZ, cbData = 0;
|
||||
if (RegGetValue(hKey, NULL, TEXT("locale"), RRF_RT_REG_SZ, &type, NULL, &cbData) == ERROR_SUCCESS) {
|
||||
wchar_t *pvData = (wchar_t*)malloc(cbData);
|
||||
|
||||
Reference in New Issue
Block a user