Skip to content

Commit a538c82

Browse files
authored
Fix ApplicationData.MachineFolder path (#4664)
1 parent 816a67b commit a538c82

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

dev/ApplicationData/M.W.S.ApplicationData.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,12 @@ namespace winrt::Microsoft::Windows::Storage::implementation
281281
}
282282
std::filesystem::path ApplicationData::_MachinePath(hstring const& packageFamilyName)
283283
{
284-
// Path = HKLM\...apprepository...\ApplicationData\...pkgfamilyname...\Machine
285-
// This is typically %ProgramData%\Microsoft\Windows\AppRepository\ApplicationData\...pkgfamilyname...\Machine
284+
// Path = HKLM\...apprepository...\Families\ApplicationData\...pkgfamilyname...\Machine
285+
// This is typically %ProgramData%\Microsoft\Windows\AppRepository\Families\ApplicationData\...pkgfamilyname...\Machine
286286
PCWSTR c_path{ L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Appx" };
287287
PCWSTR c_valueName{ L"PackageRepositoryRoot" };
288288
std::filesystem::path appRepository{ wil::reg::get_value_string(HKEY_LOCAL_MACHINE, c_path, c_valueName) };
289-
auto path{ appRepository / L"ApplicationData" };
289+
auto path{ appRepository / L"Families\\ApplicationData" };
290290
path /= packageFamilyName.c_str();
291291
path /= "Machine";
292292

specs/applicationdata/ApplicationData.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ to grant more access than provided by default.
110110

111111
### 3.4.1. Machine Path/Folder
112112

113-
The path for a package family's "Machine Folder" is located at `%ProgramData%\Microsoft\Windows\AppRepository\ApplicationData\...packagefamilyname...\Machine`.
113+
The path for a package family's "Machine Folder" is located at `%ProgramData%\Microsoft\Windows\AppRepository\Families\ApplicationData\...packagefamilyname...\Machine`.
114114

115115
This directory is ACL'd similarly to a package's System Metadata directory (`%ProgramData%\Microsoft\Windows\AppRepository\Packages\...pkgfullname...`) e.g.
116116

test/ApplicationData/ApplicationDataTests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ namespace Test::PackageManager::Tests
9090

9191
std::filesystem::path GetExpectedMachinePath(winrt::hstring const& packageFamilyName)
9292
{
93-
// Expected Path = HKLM\...apprepository...\ApplicationData\...pkgfamilyname...\Machine
94-
// This is typically %ProgramData%\Microsoft\Windows\AppRepository\ApplicationData\...pkgfamilyname...\Machine
93+
// Expected Path = HKLM\...apprepository...\Families\ApplicationData\...pkgfamilyname...\Machine
94+
// This is typically %ProgramData%\Microsoft\Windows\AppRepository\Families\ApplicationData\...pkgfamilyname...\Machine
9595
// and by 'typically' we mean 'all current Windows editions' so we'll assume it's true for ease of testing
9696
// and use this test as a canary to detect if/when this is ever not true on any supported platform.
9797
wil::unique_cotaskmem_string path;
9898
THROW_IF_FAILED(::SHGetKnownFolderPath(FOLDERID_ProgramData, 0, nullptr, wil::out_param(path)));
9999
const std::filesystem::path programData{ path.get() };
100-
const auto packageRepositoryRoot{ programData / L"Microsoft\\Windows\\AppRepository\\ApplicationData" };
100+
const auto packageRepositoryRoot{ programData / L"Microsoft\\Windows\\AppRepository\\Families\\ApplicationData" };
101101
const auto packageFamilyRoot{ packageRepositoryRoot / packageFamilyName.c_str() };
102102
const auto expectedMachinePath{ packageFamilyRoot / L"Machine" };
103103
return expectedMachinePath;

0 commit comments

Comments
 (0)