| 237 | |
| 238 | #if defined(_WIN_ALL) && !defined(SFX_MODULE) |
| 239 | void GetRarDataPath(wchar *Path,size_t MaxSize,bool Create) |
| 240 | { |
| 241 | *Path=0; |
| 242 | |
| 243 | HKEY hKey; |
| 244 | if (RegOpenKeyEx(HKEY_CURRENT_USER,L"Software\\WinRAR\\Paths",0, |
| 245 | KEY_QUERY_VALUE,&hKey)==ERROR_SUCCESS) |
| 246 | { |
| 247 | DWORD DataSize=(DWORD)MaxSize,Type; |
| 248 | RegQueryValueEx(hKey,L"AppData",0,&Type,(BYTE *)Path,&DataSize); |
| 249 | RegCloseKey(hKey); |
| 250 | } |
| 251 | |
| 252 | if (*Path==0 || !FileExist(Path)) |
| 253 | if (!GetAppDataPath(Path,MaxSize,Create)) |
| 254 | { |
| 255 | GetModuleFileName(NULL,Path,(DWORD)MaxSize); |
| 256 | RemoveNameFromPath(Path); |
| 257 | } |
| 258 | } |
| 259 | #endif |
| 260 | |
| 261 |
no test coverage detected