WCHAR szFolder[MAX_PATH];
WCHAR szFolderSection[MAX_PATH];
INT csidl;
- LPWSTR p;
CoInitialize(NULL);
if (!SetupGetStringFieldW(&Context, 2, szFolder, MAX_PATH, NULL))
continue;
- if (!SHGetSpecialFolderPathW(0, szPath, csidl, TRUE))
+ if (FAILED(SHGetFolderPathAndSubDirW(NULL, csidl|CSIDL_FLAG_CREATE, (HANDLE)-1, SHGFP_TYPE_DEFAULT, szFolder, szPath)))
continue;
- p = PathAddBackslash(szPath);
- _tcscpy(p, szFolder);
-
- if (!CreateDirectory(szPath, NULL))
- {
- if (GetLastError() != ERROR_ALREADY_EXISTS)
- {
- continue;
- }
- }
-
CreateShortcutsFromSection(hinf, szFolderSection, szPath);
}while (SetupFindNextLine(&Context, &Context));
hret = SHGetFolderPathW(NULL, csidl, NULL, 0, szPath);
if (FAILED(hret))
{
- FatalError("SHGetSpecialFolderPathW failed hret=0x%d\n", hret);
+ FatalError("SHGetFolderPathW failed hret=0x%d\n", hret);
continue;
}