| 79 | } |
| 80 | |
| 81 | std::optional<std::filesystem::path> UWP::GetAppStorageFolder() |
| 82 | { |
| 83 | if (const auto familyName = UWP::GetPackageFamilyName()) |
| 84 | { |
| 85 | wil::unique_cotaskmem_string appdata; |
| 86 | HresultVerify( |
| 87 | SHGetKnownFolderPath(FOLDERID_LocalAppData, KF_FLAG_NO_PACKAGE_REDIRECTION, nullptr, appdata.put()), |
| 88 | spdlog::level::critical, |
| 89 | L"Failed to get local app data folder" |
| 90 | ); |
| 91 | |
| 92 | std::filesystem::path storage = appdata.get(); |
| 93 | storage /= L"Packages"; |
| 94 | storage /= *familyName; |
| 95 | return std::move(storage); |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | return std::nullopt; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | winrt::fire_and_forget UWP::OpenUri(const wf::Uri &uri) |
| 104 | { |