GetWinReg(ugUninstall.hWrRoot, ugUninstall.szWrKey, "Uninstall Log Folder", szLogFolder, sizeof(szLogFolder)); GetWinReg(ugUninstall.hWrRoot, ugUninstall.szWrKey, "Description",          ugUninstall.szUninstallKeyDescription, sizeof(szLogFolder));
hkRoot = ugUninstall.hWrRoot; strcpy(szKey, ugUninstall.szWrKey);
HRESULT GetUninstallLogPath(){  char szBuf[MAX_BUF];  char szLogFolder[MAX_BUF];  char szKey[MAX_BUF];  char szWindowsUninstallKey[MAX_BUF];  char szErrorMsg[MAX_BUF];  char szEUninstallLogFolder[MAX_BUF];  if(*ugUninstall.szUserAgent != '\0')  {    lstrcpy(szKey, ugUninstall.szWrMainKey);    AppendBackSlash(szKey, sizeof(szKey));    lstrcat(szKey, ugUninstall.szUserAgent);    AppendBackSlash(szKey, sizeof(szKey));    lstrcat(szKey, "Uninstall");    GetWinReg(ugUninstall.hWrMainRoot, szKey, "Uninstall Log Folder",   szLogFolder, sizeof(szLogFolder));    GetWinReg(ugUninstall.hWrMainRoot, szKey, "Description",            ugUninstall.szUninstallKeyDescription, sizeof(szLogFolder));  }  else  {    GetWinReg(ugUninstall.hWrRoot, ugUninstall.szWrKey, "Uninstall Log Folder", szLogFolder, sizeof(szLogFolder));    GetWinReg(ugUninstall.hWrRoot, ugUninstall.szWrKey, "Description",          ugUninstall.szUninstallKeyDescription, sizeof(szLogFolder));  }  lstrcpy(szWindowsUninstallKey, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\");  lstrcat(szWindowsUninstallKey, ugUninstall.szUninstallKeyDescription);  GetWinReg(HKEY_LOCAL_MACHINE, szWindowsUninstallKey, "DisplayName", ugUninstall.szDescription, sizeof(szLogFolder));  if(FileExists(szLogFolder) == FALSE)  {    if(NS_LoadString(hInst, IDS_ERROR_UNINSTALL_LOG_FOLDER, szEUninstallLogFolder, MAX_BUF) == WIZ_OK)    {      lstrcpy(szBuf, "\n\n    ");      lstrcat(szBuf, szLogFolder);      lstrcat(szBuf, "\n");      wsprintf(szErrorMsg, szEUninstallLogFolder, szBuf);      PrintError(szErrorMsg, ERROR_CODE_SHOW);    }    return(1);  }  lstrcpy(ugUninstall.szLogPath, szLogFolder);  return(0);}