| | |
| | | { |
| | | static wstring path; |
| | | if (path.empty()) { |
| | | #if defined(NTDDI_WIN10_19H1) && (NTDDI_VERSION >= NTDDI_WIN10_19H1) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) /* Only PC supports mods */ |
| | | /* 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(); |
| | | } |
| | | #else |
| | | path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data(); |
| | | #endif |
| | | } |
| | | return path.c_str(); |
| | | } |
| | | |