From a7d91ebaa5a7dbff1a396898d47cd19454715548 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Mon, 9 Nov 2020 17:05:21 -0500 Subject: [PATCH] winrt: Add EffectiveLocation support for newer Win10 releases --- src/filesystem/winrt/SDL_sysfilesystem.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/filesystem/winrt/SDL_sysfilesystem.cpp b/src/filesystem/winrt/SDL_sysfilesystem.cpp index 6685f1cb4..3ea1bd025 100644 --- a/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/src/filesystem/winrt/SDL_sysfilesystem.cpp @@ -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(); }