Skip to content

Commit

Permalink
winrt: Add EffectiveLocation support for newer Win10 releases
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Nov 9, 2020
1 parent 16d789f commit a7d91eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/filesystem/winrt/SDL_sysfilesystem.cpp
Expand Up @@ -48,7 +48,12 @@ SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType)
{
static wstring path;
if (path.empty()) {
path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data();
/* Windows 1903 supports mods, via the EffectiveLocation API */
if (Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8, 0)) {
path = Windows::ApplicationModel::Package::Current->EffectiveLocation->Path->Data();
} else {
path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data();
}
}
return path.c_str();
}
Expand Down

0 comments on commit a7d91eb

Please sign in to comment.