[*] Alternative solution for FOLDERID_UserProgramFiles when targeting <= Windows Vista

This commit is contained in:
Reece Wilson 2023-08-18 18:03:05 +01:00
parent 61df62213f
commit ebce7e0048

View File

@ -177,7 +177,20 @@ namespace Aurora::IO::FS
gUserHomeDirectory = GetSpecialDir(FOLDERID_Profile); gUserHomeDirectory = GetSpecialDir(FOLDERID_Profile);
gAdminWritableAppDirectory = gApplicationData; gAdminWritableAppDirectory = gApplicationData;
gUserWritableAppData = gHomeDirectory; gUserWritableAppData = gHomeDirectory;
gProgramsFolder = GetSpecialDir(FOLDERID_UserProgramFiles); gProgramsFolder = AuSwInfo::IsWindows7OrGreater() ? GetSpecialDir(FOLDERID_UserProgramFiles) : "";
if (gProgramsFolder.empty())
{
gProgramsFolder = GetSpecialDir(FOLDERID_Documents);
if (gProgramsFolder.size())
{
gProgramsFolder += "\\Programs";
if (!AuFS::DirExists(gProgramsFolder))
{
AuFS::DirMk(gProgramsFolder);
}
}
}
} }
#elif defined(AURORA_PLATFORM_LINUX) || defined(AURORA_PLATFORM_BSD) #elif defined(AURORA_PLATFORM_LINUX) || defined(AURORA_PLATFORM_BSD)