[*] Update FS resources under NT (prevent conflict of privileged user data + brand matching all user data)

This commit is contained in:
Reece Wilson 2022-03-30 12:33:52 +01:00
parent e7f6f79471
commit 802361c57e

View File

@ -154,7 +154,7 @@ namespace Aurora::IO::FS
if (DirExists(*secondary))
{
std::swap(secondary, primary);
AuSwap(secondary, primary);
}
else
{
@ -251,18 +251,16 @@ namespace Aurora::IO::FS
#if !defined(AU_NO_AU_HOME_BRANDING)
if (gRuntimeConfig.fio.defaultBrand.size())
{
#if !defined(AURORA_PLATFORM_WIN32)
gApplicationData += "/" + gRuntimeConfig.fio.defaultBrand;
#endif
gHomeDirectory += "/" + gRuntimeConfig.fio.defaultBrand;
gProgramsFolder += "/" + gRuntimeConfig.fio.defaultBrand;
}
#endif
#if defined(AURORA_PLATFORM_WIN32)
if (gRuntimeConfig.fio.defaultBrand.empty())
{
gApplicationData += "/AllUsers";
}
gApplicationData += "\\AllUsers";
if (!FS::DirExists(gApplicationData))
{
@ -271,9 +269,17 @@ namespace Aurora::IO::FS
Win32FixGlobalAppDataAcl(gApplicationData);
}
}
#if defined(AURORA_PLATFORM_WIN32)
if (gRuntimeConfig.fio.defaultBrand.size())
{
gApplicationData += "\\" + gRuntimeConfig.fio.defaultBrand;
}
#endif
FS::DirMk(gApplicationData);
#endif
NormalizePath(gApplicationData);
NormalizePath(gProgramsFolder);
NormalizePath(gHomeDirectory);