Skip to content

Commit

Permalink
Make Store package download stable (#4570)
Browse files Browse the repository at this point in the history
  • Loading branch information
yao-msft authored Jun 21, 2024
1 parent c074cbe commit 6c54251
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 57 deletions.
11 changes: 0 additions & 11 deletions doc/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,6 @@ Currently, this means that properly attributed configuration units (and only tho
},
```

### storeDownload

This feature enables packages to be downloaded from the Microsoft Store.
You can enable the feature as shown below.

```json
"experimentalFeatures": {
"storeDownload": true
},
```

### configureExport

This feature enables exporting a configuration file.
Expand Down
5 changes: 0 additions & 5 deletions schemas/JSON/settings/settings.schema.0.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,6 @@
"type": "boolean",
"default": false
},
"storeDownload": {
"description": "Enable support for downloading packages from the Microsoft Store",
"type": "boolean",
"default": false
},
"configureExport": {
"description": "Enable support for the configure export command",
"type": "boolean",
Expand Down
1 change: 0 additions & 1 deletion src/AppInstallerCLICore/Workflows/DownloadFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ namespace AppInstaller::CLI::Workflow
if (installerDownloadOnly)
{
context <<
EnsureFeatureEnabled(Settings::ExperimentalFeature::Feature::StoreDownload) <<
MSStoreDownload <<
ExportManifest;
}
Expand Down
22 changes: 0 additions & 22 deletions src/AppInstallerCLITests/MSStoreDownloadFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ std::vector<SFS::AppContent> GetSfsAppContentsOverrideFunction(std::string_view

TEST_CASE("MSStoreDownloadFlow_Success", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand Down Expand Up @@ -287,8 +285,6 @@ TEST_CASE("MSStoreDownloadFlow_Success", "[MSStoreDownloadFlow][workflow]")

TEST_CASE("MSStoreDownloadFlow_Success_SkipDependencies", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand Down Expand Up @@ -328,8 +324,6 @@ TEST_CASE("MSStoreDownloadFlow_Success_SkipDependencies", "[MSStoreDownloadFlow]

TEST_CASE("MSStoreDownloadFlow_Success_SkipLicense", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand Down Expand Up @@ -364,8 +358,6 @@ TEST_CASE("MSStoreDownloadFlow_Success_SkipLicense", "[MSStoreDownloadFlow][work

TEST_CASE("MSStoreDownloadFlow_Success_SpecificLocale", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand Down Expand Up @@ -404,8 +396,6 @@ TEST_CASE("MSStoreDownloadFlow_Success_SpecificLocale", "[MSStoreDownloadFlow][w

TEST_CASE("MSStoreDownloadFlow_Success_SpecificArchitecture", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand Down Expand Up @@ -445,8 +435,6 @@ TEST_CASE("MSStoreDownloadFlow_Success_SpecificArchitecture", "[MSStoreDownloadF

TEST_CASE("MSStoreDownloadFlow_Success_SpecificPlatform", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand Down Expand Up @@ -486,8 +474,6 @@ TEST_CASE("MSStoreDownloadFlow_Success_SpecificPlatform", "[MSStoreDownloadFlow]

TEST_CASE("MSStoreDownloadFlow_Fail_TargetSkuNotFound", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand All @@ -507,8 +493,6 @@ TEST_CASE("MSStoreDownloadFlow_Fail_TargetSkuNotFound", "[MSStoreDownloadFlow][w

TEST_CASE("MSStoreDownloadFlow_Fail_LocaleNotApplicable", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand All @@ -528,8 +512,6 @@ TEST_CASE("MSStoreDownloadFlow_Fail_LocaleNotApplicable", "[MSStoreDownloadFlow]

TEST_CASE("MSStoreDownloadFlow_Fail_ArchitectureNotApplicable", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand All @@ -550,8 +532,6 @@ TEST_CASE("MSStoreDownloadFlow_Fail_ArchitectureNotApplicable", "[MSStoreDownloa

TEST_CASE("MSStoreDownloadFlow_Fail_PlatformNotApplicable", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand All @@ -572,8 +552,6 @@ TEST_CASE("MSStoreDownloadFlow_Fail_PlatformNotApplicable", "[MSStoreDownloadFlo

TEST_CASE("MSStoreDownloadFlow_Fail_Licensing", "[MSStoreDownloadFlow][workflow]")
{
auto enableFeature = TestUserSettings::EnableExperimentalFeature(AppInstaller::Settings::ExperimentalFeature::Feature::StoreDownload);

TestCommon::TempDirectory tempDirectory("TestDownloadDirectory", false);

std::ostringstream downloadOutput;
Expand Down
15 changes: 7 additions & 8 deletions src/AppInstallerCLITests/TestCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,13 @@ namespace TestCommon
std::unique_ptr<TestUserSettings> result = std::make_unique<TestUserSettings>(keepFileSettings);

// Due to the template usage, this needs to be updated for any features that want to use it.
switch (feature)
{
case Settings::ExperimentalFeature::Feature::StoreDownload:
result->Set<Settings::Setting::EFStoreDownload>(true);
break;
default:
THROW_HR(E_NOTIMPL);
}
// Currently no feature is used. Uncomment below when a feature needs to be used.
// switch (feature)
// {
// default:
// THROW_HR(E_NOTIMPL);
// }
UNREFERENCED_PARAMETER(feature);

return result;
}
Expand Down
4 changes: 0 additions & 4 deletions src/AppInstallerCommonCore/ExperimentalFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ namespace AppInstaller::Settings
return userSettings.Get<Setting::EFConfiguration03>();
case ExperimentalFeature::Feature::ConfigureSelfElevation:
return userSettings.Get<Setting::EFConfigureSelfElevation>();
case ExperimentalFeature::Feature::StoreDownload:
return userSettings.Get<Setting::EFStoreDownload>();
case ExperimentalFeature::Feature::IndexV2:
return userSettings.Get<Setting::EFIndexV2>();
case ExperimentalFeature::Feature::ConfigureExport:
Expand Down Expand Up @@ -87,8 +85,6 @@ namespace AppInstaller::Settings
return ExperimentalFeature{ "Configuration Schema 0.3", "configuration03", "https://aka.ms/winget-settings", Feature::Configuration03 };
case Feature::ConfigureSelfElevation:
return ExperimentalFeature{ "Configure Self Elevation", "configureSelfElevate", "https://aka.ms/winget-settings", Feature::ConfigureSelfElevation };
case Feature::StoreDownload:
return ExperimentalFeature{ "Store Download", "storeDownload", "https://aka.ms/winget-settings", Feature::StoreDownload };
case Feature::IndexV2:
return ExperimentalFeature{ "Index V2", "indexV2", "https://aka.ms/winget-settings", Feature::IndexV2 };
case Feature::ConfigureExport:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ namespace AppInstaller::Settings
Resume = 0x2,
Configuration03 = 0x4,
ConfigureSelfElevation = 0x8,
StoreDownload = 0x10,
ConfigureExport = 0x20,
IndexV2 = 0x40,
ConfigureExport = 0x10,
IndexV2 = 0x20,
Max, // This MUST always be after all experimental features

// Features listed after Max will not be shown with the features command
Expand Down
2 changes: 0 additions & 2 deletions src/AppInstallerCommonCore/Public/winget/UserSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ namespace AppInstaller::Settings
EFResume,
EFConfiguration03,
EFConfigureSelfElevation,
EFStoreDownload,
EFIndexV2,
EFConfigureExport,
// Telemetry
Expand Down Expand Up @@ -158,7 +157,6 @@ namespace AppInstaller::Settings
SETTINGMAPPING_SPECIALIZATION(Setting::EFResume, bool, bool, false, ".experimentalFeatures.resume"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFConfiguration03, bool, bool, false, ".experimentalFeatures.configuration03"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFConfigureSelfElevation, bool, bool, false, ".experimentalFeatures.configureSelfElevate"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFStoreDownload, bool, bool, false, ".experimentalFeatures.storeDownload"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFIndexV2, bool, bool, true, ".experimentalFeatures.indexV2"sv);
SETTINGMAPPING_SPECIALIZATION(Setting::EFConfigureExport, bool, bool, false, ".experimentalFeatures.configureExport"sv);
// Telemetry
Expand Down
1 change: 0 additions & 1 deletion src/AppInstallerCommonCore/UserSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ namespace AppInstaller::Settings
WINGET_VALIDATE_PASS_THROUGH(EFResume)
WINGET_VALIDATE_PASS_THROUGH(EFConfiguration03)
WINGET_VALIDATE_PASS_THROUGH(EFConfigureSelfElevation)
WINGET_VALIDATE_PASS_THROUGH(EFStoreDownload)
WINGET_VALIDATE_PASS_THROUGH(EFIndexV2)
WINGET_VALIDATE_PASS_THROUGH(EFConfigureExport)
WINGET_VALIDATE_PASS_THROUGH(AnonymizePathForDisplay)
Expand Down

0 comments on commit 6c54251

Please sign in to comment.