diff --git a/doc/Settings.md b/doc/Settings.md index 27659c19ec..aa1b7a5e49 100644 --- a/doc/Settings.md +++ b/doc/Settings.md @@ -251,16 +251,6 @@ You can enable the feature as shown below. }, ``` -### dependencies - -Experimental feature with the aim of managing dependencies, as of now it only shows package dependency information. You can enable the feature as shown below. - -```json - "experimentalFeatures": { - "dependencies": true - }, -``` - ### configuration This feature enables the configuration commands. These commands allow configuring the system into a desired state. @@ -270,26 +260,4 @@ You can enable the feature as shown below. "experimentalFeatures": { "configuration": true }, -``` - -### windowsFeature - -This feature enables the ability to enable Windows Feature dependencies during installation. -You can enable the feature as shown below. - -```json - "experimentalFeatures": { - "windowsFeature": true - }, -``` - -### download - -This feature enables the download command. This command allows users to download the installers of a specified package. -You can enable the feature as shown below. - -```json - "experimentalFeatures": { - "download": true - }, ``` \ No newline at end of file diff --git a/schemas/JSON/settings/settings.schema.0.2.json b/schemas/JSON/settings/settings.schema.0.2.json index 2940c40803..5ceefb80d3 100644 --- a/schemas/JSON/settings/settings.schema.0.2.json +++ b/schemas/JSON/settings/settings.schema.0.2.json @@ -210,11 +210,6 @@ "type": "boolean", "default": false }, - "dependencies": { - "description": "Support for package dependencies", - "type": "boolean", - "default": false - }, "directMSI": { "description": "Enable use of MSI APIs rather than msiexec for MSI installs", "type": "boolean", @@ -224,11 +219,6 @@ "description": "Enable support for configuration", "type": "boolean", "default": false - }, - "download": { - "description": "Enable support for the download command", - "type": "boolean", - "default": false } } } diff --git a/src/AppInstallerCLICore/Commands/DownloadCommand.h b/src/AppInstallerCLICore/Commands/DownloadCommand.h index 3026b6cc5e..06a76cfe9a 100644 --- a/src/AppInstallerCLICore/Commands/DownloadCommand.h +++ b/src/AppInstallerCLICore/Commands/DownloadCommand.h @@ -7,7 +7,7 @@ namespace AppInstaller::CLI { struct DownloadCommand final : public Command { - DownloadCommand(std::string_view parent) : Command("download", {} /* aliases */, parent, Settings::ExperimentalFeature::Feature::Download) {} + DownloadCommand(std::string_view parent) : Command("download", {} /* aliases */, parent) {} std::vector GetArguments() const override; diff --git a/src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp b/src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp index cc7761cc83..876b5ddaa5 100644 --- a/src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp @@ -36,10 +36,6 @@ namespace AppInstaller::CLI::Workflow void ReportDependencies::operator()(Execution::Context& context) const { - if (!Settings::ExperimentalFeature::IsEnabled(Settings::ExperimentalFeature::Feature::Dependencies)) - { - return; - } auto info = context.Reporter.Info(); const auto& dependencies = context.Get(); @@ -81,40 +77,32 @@ namespace AppInstaller::CLI::Workflow } } - void GetInstallersDependenciesFromManifest(Execution::Context& context) { - if (Settings::ExperimentalFeature::IsEnabled(Settings::ExperimentalFeature::Feature::Dependencies)) - { - const auto& manifest = context.Get(); - DependencyList allDependencies; - - for (const auto& installer : manifest.Installers) - { - allDependencies.Add(installer.Dependencies); - } + void GetInstallersDependenciesFromManifest(Execution::Context& context) + { + const auto& manifest = context.Get(); + DependencyList allDependencies; - context.Add(std::move(allDependencies)); + for (const auto& installer : manifest.Installers) + { + allDependencies.Add(installer.Dependencies); } + + context.Add(std::move(allDependencies)); } void GetDependenciesFromInstaller(Execution::Context& context) { - if (Settings::ExperimentalFeature::IsEnabled(Settings::ExperimentalFeature::Feature::Dependencies)) + const auto& installer = context.Get(); + if (installer) { - const auto& installer = context.Get(); - if (installer) - { - context.Add(installer->Dependencies); - } + context.Add(installer->Dependencies); } } void GetDependenciesInfoForUninstall(Execution::Context& context) { - if (Settings::ExperimentalFeature::IsEnabled(Settings::ExperimentalFeature::Feature::Dependencies)) - { - // TODO make best effort to get the correct installer information, it may be better to have a record of installations and save the correct installers - context.Add(DependencyList()); // sending empty list of dependencies for now - } + // TODO make best effort to get the correct installer information, it may be better to have a record of installations and save the correct installers + context.Add(DependencyList()); // sending empty list of dependencies for now } void OpenDependencySource(Execution::Context& context) @@ -141,11 +129,6 @@ namespace AppInstaller::CLI::Workflow void EnableWindowsFeaturesDependencies(Execution::Context& context) { - if (!Settings::ExperimentalFeature::IsEnabled(Settings::ExperimentalFeature::Feature::WindowsFeature)) - { - return; - } - const auto& rootDependencies = context.Get()->Dependencies; if (rootDependencies.Empty()) @@ -239,11 +222,6 @@ namespace AppInstaller::CLI::Workflow void CreateDependencySubContexts::operator()(Execution::Context& context) const { - if (!Settings::ExperimentalFeature::IsEnabled(Settings::ExperimentalFeature::Feature::Dependencies)) - { - return; - } - auto info = context.Reporter.Info(); auto error = context.Reporter.Error(); const auto& rootManifest = context.Get(); diff --git a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp index 8c6046059a..db3697cd0a 100644 --- a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp @@ -618,32 +618,29 @@ namespace AppInstaller::CLI::Workflow bool downloadInstallerOnly = WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::InstallerDownloadOnly); // Report dependencies - if (Settings::ExperimentalFeature::IsEnabled(Settings::ExperimentalFeature::Feature::Dependencies)) + auto& packageSubContexts = context.Get(); + if (!packageSubContexts.empty()) { - auto& packageSubContexts = context.Get(); - if (!packageSubContexts.empty()) + if (downloadInstallerOnly) { - if (downloadInstallerOnly) - { - context.Reporter.Info() << Resource::String::DependenciesFlowDownload << std::endl; - } - else - { - context.Reporter.Info() << Resource::String::DependenciesFlowInstall << std::endl; - } + context.Reporter.Info() << Resource::String::DependenciesFlowDownload << std::endl; } - - DependencyList allDependencies; - - for (auto& packageContext : packageSubContexts) + else { - allDependencies.Add(packageContext->Get().value().Dependencies); + context.Reporter.Info() << Resource::String::DependenciesFlowInstall << std::endl; } + } - context.Add(allDependencies); - context << Workflow::ReportDependencies(m_dependenciesReportMessage); + DependencyList allDependencies; + + for (auto& packageContext : packageSubContexts) + { + allDependencies.Add(packageContext->Get().value().Dependencies); } + context.Add(allDependencies); + context << Workflow::ReportDependencies(m_dependenciesReportMessage); + bool allSucceeded = true; size_t packagesCount = context.Get().size(); size_t packagesProgress = 0; diff --git a/src/AppInstallerCLICore/Workflows/ShowFlow.cpp b/src/AppInstallerCLICore/Workflows/ShowFlow.cpp index 0dbea826fd..32c71974de 100644 --- a/src/AppInstallerCLICore/Workflows/ShowFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/ShowFlow.cpp @@ -169,45 +169,42 @@ namespace AppInstaller::CLI::Workflow ShowSingleLineField(info, Resource::String::ShowLabelInstallerProductId, installer->ProductId, true); ShowSingleLineField(info, Resource::String::ShowLabelInstallerReleaseDate, installer->ReleaseDate, true); - if (Settings::ExperimentalFeature::IsEnabled(Settings::ExperimentalFeature::Feature::Dependencies)) + const auto& dependencies = installer->Dependencies; + + if (dependencies.HasAny()) { - const auto& dependencies = installer->Dependencies; + info << Execution::ManifestInfoEmphasis << " "_liv << Resource::String::ShowLabelDependencies << ' ' << std::endl; - if (dependencies.HasAny()) + if (dependencies.HasAnyOf(Manifest::DependencyType::WindowsFeature)) { - info << Execution::ManifestInfoEmphasis << " "_liv << Resource::String::ShowLabelDependencies << ' ' << std::endl; - - if (dependencies.HasAnyOf(Manifest::DependencyType::WindowsFeature)) - { - info << " - "_liv << Resource::String::ShowLabelWindowsFeaturesDependencies << ' ' << std::endl; - dependencies.ApplyToType(Manifest::DependencyType::WindowsFeature, [&info](Manifest::Dependency dependency) {info << " "_liv << dependency.Id() << std::endl; }); - } + info << " - "_liv << Resource::String::ShowLabelWindowsFeaturesDependencies << ' ' << std::endl; + dependencies.ApplyToType(Manifest::DependencyType::WindowsFeature, [&info](Manifest::Dependency dependency) {info << " "_liv << dependency.Id() << std::endl; }); + } - if (dependencies.HasAnyOf(Manifest::DependencyType::WindowsLibrary)) - { - info << " - "_liv << Resource::String::ShowLabelWindowsLibrariesDependencies << ' ' << std::endl; - dependencies.ApplyToType(Manifest::DependencyType::WindowsLibrary, [&info](Manifest::Dependency dependency) {info << " "_liv << dependency.Id() << std::endl; }); - } + if (dependencies.HasAnyOf(Manifest::DependencyType::WindowsLibrary)) + { + info << " - "_liv << Resource::String::ShowLabelWindowsLibrariesDependencies << ' ' << std::endl; + dependencies.ApplyToType(Manifest::DependencyType::WindowsLibrary, [&info](Manifest::Dependency dependency) {info << " "_liv << dependency.Id() << std::endl; }); + } - if (dependencies.HasAnyOf(Manifest::DependencyType::Package)) - { - info << " - "_liv << Resource::String::ShowLabelPackageDependencies << ' ' << std::endl; - dependencies.ApplyToType(Manifest::DependencyType::Package, [&info](Manifest::Dependency dependency) + if (dependencies.HasAnyOf(Manifest::DependencyType::Package)) + { + info << " - "_liv << Resource::String::ShowLabelPackageDependencies << ' ' << std::endl; + dependencies.ApplyToType(Manifest::DependencyType::Package, [&info](Manifest::Dependency dependency) + { + info << " "_liv << dependency.Id(); + if (dependency.MinVersion) { - info << " "_liv << dependency.Id(); - if (dependency.MinVersion) - { - info << " [>= " << dependency.MinVersion.value().ToString() << "]"; - } - info << std::endl; - }); - } + info << " [>= " << dependency.MinVersion.value().ToString() << "]"; + } + info << std::endl; + }); + } - if (dependencies.HasAnyOf(Manifest::DependencyType::External)) - { - info << " - "_liv << Resource::String::ShowLabelExternalDependencies << ' ' << std::endl; - dependencies.ApplyToType(Manifest::DependencyType::External, [&info](Manifest::Dependency dependency) {info << " "_liv << dependency.Id() << std::endl; }); - } + if (dependencies.HasAnyOf(Manifest::DependencyType::External)) + { + info << " - "_liv << Resource::String::ShowLabelExternalDependencies << ' ' << std::endl; + dependencies.ApplyToType(Manifest::DependencyType::External, [&info](Manifest::Dependency dependency) {info << " "_liv << dependency.Id() << std::endl; }); } } } diff --git a/src/AppInstallerCLIE2ETests/DownloadCommand.cs b/src/AppInstallerCLIE2ETests/DownloadCommand.cs index 9573ffe4eb..f8e0c0582f 100644 --- a/src/AppInstallerCLIE2ETests/DownloadCommand.cs +++ b/src/AppInstallerCLIE2ETests/DownloadCommand.cs @@ -17,16 +17,6 @@ namespace AppInstallerCLIE2ETests /// public class DownloadCommand : BaseCommand { - /// - /// One time setup. - /// - [OneTimeSetUp] - public void OneTimeSetup() - { - WinGetSettingsHelper.ConfigureFeature("download", true); - WinGetSettingsHelper.ConfigureFeature("dependencies", true); - } - /// /// Downloads the test installer and its package dependencies. /// diff --git a/src/AppInstallerCLIE2ETests/FeaturesCommand.cs b/src/AppInstallerCLIE2ETests/FeaturesCommand.cs index 1b15fd8a3a..ce6abf9b0a 100644 --- a/src/AppInstallerCLIE2ETests/FeaturesCommand.cs +++ b/src/AppInstallerCLIE2ETests/FeaturesCommand.cs @@ -53,9 +53,6 @@ public void EnableExperimentalFeatures() WinGetSettingsHelper.ConfigureFeature("experimentalArg", true); WinGetSettingsHelper.ConfigureFeature("experimentalCmd", true); WinGetSettingsHelper.ConfigureFeature("directMSI", true); - WinGetSettingsHelper.ConfigureFeature("windowsFeature", true); - WinGetSettingsHelper.ConfigureFeature("download", true); - WinGetSettingsHelper.ConfigureFeature("dependencies", true); var result = TestCommon.RunAICLICommand("features", string.Empty); Assert.True(result.StdOut.Contains("Enabled")); } diff --git a/src/AppInstallerCLIE2ETests/Helpers/WinGetSettingsHelper.cs b/src/AppInstallerCLIE2ETests/Helpers/WinGetSettingsHelper.cs index 6713582935..3778aef91d 100644 --- a/src/AppInstallerCLIE2ETests/Helpers/WinGetSettingsHelper.cs +++ b/src/AppInstallerCLIE2ETests/Helpers/WinGetSettingsHelper.cs @@ -41,9 +41,7 @@ public static void InitializeWingetSettings() { { "experimentalArg", false }, { "experimentalCmd", false }, - { "dependencies", false }, { "directMSI", false }, - { "download", false }, } }, { @@ -189,12 +187,9 @@ public static void InitializeAllFeatures(bool status) { ConfigureFeature("experimentalArg", status); ConfigureFeature("experimentalCmd", status); - ConfigureFeature("dependencies", status); ConfigureFeature("directMSI", status); ConfigureFeature("pinning", status); ConfigureFeature("configuration", status); - ConfigureFeature("windowsFeature", status); - ConfigureFeature("download", status); } } } diff --git a/src/AppInstallerCLIE2ETests/InstallCommand.cs b/src/AppInstallerCLIE2ETests/InstallCommand.cs index 169cbf445d..dc56739dbf 100644 --- a/src/AppInstallerCLIE2ETests/InstallCommand.cs +++ b/src/AppInstallerCLIE2ETests/InstallCommand.cs @@ -15,16 +15,6 @@ namespace AppInstallerCLIE2ETests /// public class InstallCommand : BaseCommand { - /// - /// One time setup. - /// - [OneTimeSetUp] - public void OneTimeSetup() - { - WinGetSettingsHelper.ConfigureFeature("dependencies", true); - WinGetSettingsHelper.ConfigureFeature("windowsFeature", true); - } - /// /// Set up. /// diff --git a/src/AppInstallerCLIE2ETests/Interop/InteropSetUpFixture.cs b/src/AppInstallerCLIE2ETests/Interop/InteropSetUpFixture.cs index 6e204a589c..655d4a4d05 100644 --- a/src/AppInstallerCLIE2ETests/Interop/InteropSetUpFixture.cs +++ b/src/AppInstallerCLIE2ETests/Interop/InteropSetUpFixture.cs @@ -23,11 +23,6 @@ public class InteropSetUpFixture public void Setup() { TestCommon.SetupTestSource(); - - // For the COM E2E tests, once the settings file is initialized, it persists throughout the entirety of the tests. - // Any experimental features needed must be declared prior to running the COM E2E tests. - WinGetSettingsHelper.ConfigureFeature("dependencies", true); - WinGetSettingsHelper.ConfigureFeature("download", true); } /// diff --git a/src/AppInstallerCLITests/ImportFlow.cpp b/src/AppInstallerCLITests/ImportFlow.cpp index 609cefd3cd..73b0c1106a 100644 --- a/src/AppInstallerCLITests/ImportFlow.cpp +++ b/src/AppInstallerCLITests/ImportFlow.cpp @@ -238,9 +238,6 @@ TEST_CASE("ImportFlow_Dependencies", "[ImportFlow][workflow][dependencies]") OverrideForShellExecute(context); context.Args.AddArg(Execution::Args::Type::ImportFile, TestDataFile("ImportFile-Good-Dependencies.json").GetPath().string()); - TestUserSettings settings; - settings.Set({ true }); - ImportCommand importCommand({}); importCommand.Execute(context); INFO(importOutput.str()); diff --git a/src/AppInstallerCLITests/InstallDependenciesFlow.cpp b/src/AppInstallerCLITests/InstallDependenciesFlow.cpp index d22e9eae6a..fed69d8833 100644 --- a/src/AppInstallerCLITests/InstallDependenciesFlow.cpp +++ b/src/AppInstallerCLITests/InstallDependenciesFlow.cpp @@ -25,22 +25,6 @@ void OverrideOpenSourceForDependencies(TestContext& context) } }); } -void OverrideDependencySource(TestContext& context) -{ - context.Override({ Workflow::OpenDependencySource, [](TestContext& context) - { - context.Add(Source{ std::make_shared() }); - } }); -} - -void OverrideOpenDependencySource(TestContext& context) -{ - context.Override({ Workflow::OpenDependencySource, [](TestContext& context) - { - context.Add(Source{ std::make_shared() }); - } }); -} - void OverrideForProcessMultiplePackages(TestContext& context) { context.Override({ Workflow::ProcessMultiplePackages( @@ -69,9 +53,6 @@ TEST_CASE("DependencyGraph_SkipInstalled", "[InstallFlow][workflow][dependencyGr context.Add(manifest); context.Add(manifest.Installers[0]); - TestUserSettings settings; - settings.Set({ true }); - context << CreateDependencySubContexts(Resource::String::PackageRequiresDependencies); auto& dependencyPackages = context.Get(); @@ -93,9 +74,6 @@ TEST_CASE("DependencyGraph_validMinVersions", "[InstallFlow][workflow][dependenc context.Add(manifest); context.Add(manifest.Installers[0]); - TestUserSettings settings; - settings.Set({ true }); - context << CreateDependencySubContexts(Resource::String::PackageRequiresDependencies); auto& dependencyPackages = context.Get(); @@ -119,9 +97,6 @@ TEST_CASE("DependencyGraph_PathNoLoop", "[InstallFlow][workflow][dependencyGraph context.Add(manifest); context.Add(manifest.Installers[0]); - TestUserSettings settings; - settings.Set({ true }); - context << CreateDependencySubContexts(Resource::String::PackageRequiresDependencies); auto& dependencyPackages = context.Get(); @@ -148,9 +123,6 @@ TEST_CASE("DependencyGraph_StackOrderIsOk", "[InstallFlow][workflow][dependencyG context.Args.AddArg(Execution::Args::Type::Query, "StackOrderIsOk"sv); - TestUserSettings settings; - settings.Set({ true }); - InstallCommand install({}); install.Execute(context); INFO(installOutput.str()); @@ -173,12 +145,10 @@ TEST_CASE("DependencyGraph_MultipleDependenciesFromManifest", "[InstallFlow][wor auto previousThreadGlobals = context.SetForCurrentThread(); OverrideOpenSourceForDependencies(context); OverrideForShellExecute(context, installationOrder); + OverrideEnableWindowsFeaturesDependencies(context); context.Args.AddArg(Execution::Args::Type::Query, "MultipleDependenciesFromManifest"sv); - TestUserSettings settings; - settings.Set({ true }); - InstallCommand install({}); install.Execute(context); INFO(installOutput.str()); @@ -198,13 +168,11 @@ TEST_CASE("InstallerWithoutDependencies_RootDependenciesAreUsed", "[dependencies TestContext context{ installOutput, std::cin }; auto previousThreadGlobals = context.SetForCurrentThread(); OverrideForShellExecute(context); - OverrideDependencySource(context); + OverrideOpenDependencySource(context); + OverrideEnableWindowsFeaturesDependencies(context); context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("Installer_Exe_DependenciesOnRoot.yaml").GetPath().u8string()); - TestUserSettings settings; - settings.Set({ true }); - InstallCommand install({}); install.Execute(context); INFO(installOutput.str()); @@ -225,9 +193,6 @@ TEST_CASE("InstallerWithDependencies_SkipDependencies", "[dependencies]") context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("Installer_Exe_Dependencies.yaml").GetPath().u8string()); context.Args.AddArg(Execution::Args::Type::SkipDependencies); - TestUserSettings settings; - settings.Set({ true }); - InstallCommand install({}); install.Execute(context); INFO(installOutput.str()); @@ -248,7 +213,6 @@ TEST_CASE("InstallerWithDependencies_IgnoreDependenciesSetting", "[dependencies] context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("Installer_Exe_Dependencies.yaml").GetPath().u8string()); TestUserSettings settings; - settings.Set({ true }); settings.Set({ true }); InstallCommand install({}); @@ -266,13 +230,11 @@ TEST_CASE("DependenciesMultideclaration_InstallerDependenciesPreference", "[depe TestContext context{ installOutput, std::cin }; auto previousThreadGlobals = context.SetForCurrentThread(); OverrideForShellExecute(context); - OverrideDependencySource(context); + OverrideOpenDependencySource(context); + OverrideEnableWindowsFeaturesDependencies(context); context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("Installer_Exe_DependenciesMultideclaration.yaml").GetPath().u8string()); - TestUserSettings settings; - settings.Set({ true }); - InstallCommand install({}); install.Execute(context); INFO(installOutput.str()); @@ -290,13 +252,11 @@ TEST_CASE("InstallFlow_Dependencies", "[InstallFlow][workflow][dependencies]") TestContext context{ installOutput, std::cin }; auto previousThreadGlobals = context.SetForCurrentThread(); OverrideForShellExecute(context); - OverrideDependencySource(context); + OverrideOpenDependencySource(context); + OverrideEnableWindowsFeaturesDependencies(context); context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("Installer_Exe_Dependencies.yaml").GetPath().u8string()); - TestUserSettings settings; - settings.Set({ true }); - InstallCommand install({}); install.Execute(context); INFO(installOutput.str()); diff --git a/src/AppInstallerCLITests/ShowFlow.cpp b/src/AppInstallerCLITests/ShowFlow.cpp index 2f4593f649..5a6325935b 100644 --- a/src/AppInstallerCLITests/ShowFlow.cpp +++ b/src/AppInstallerCLITests/ShowFlow.cpp @@ -53,9 +53,6 @@ TEST_CASE("ShowFlow_Dependencies", "[ShowFlow][workflow][dependencies]") auto previousThreadGlobals = context.SetForCurrentThread(); context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("Manifest-Good-AllDependencyTypes.yaml").GetPath().u8string()); - TestUserSettings settings; - settings.Set({ true }); - ShowCommand show({}); show.Execute(context); INFO(showOutput.str()); diff --git a/src/AppInstallerCLITests/UpdateFlow.cpp b/src/AppInstallerCLITests/UpdateFlow.cpp index c833d68f59..7431da4fdd 100644 --- a/src/AppInstallerCLITests/UpdateFlow.cpp +++ b/src/AppInstallerCLITests/UpdateFlow.cpp @@ -623,10 +623,9 @@ TEST_CASE("UpdateFlow_Dependencies", "[UpdateFlow][workflow][dependencies]") auto previousThreadGlobals = context.SetForCurrentThread(); OverrideForCompositeInstalledSource(context, CreateTestSource({ TSR::TestInstaller_Exe_Dependencies })); OverrideForShellExecute(context); - context.Args.AddArg(Execution::Args::Type::Query, TSR::TestInstaller_Exe_Dependencies.Query);; + OverrideEnableWindowsFeaturesDependencies(context); - TestUserSettings settings; - settings.Set({ true }); + context.Args.AddArg(Execution::Args::Type::Query, TSR::TestInstaller_Exe_Dependencies.Query);; UpgradeCommand update({}); update.Execute(context); diff --git a/src/AppInstallerCLITests/WindowsFeature.cpp b/src/AppInstallerCLITests/WindowsFeature.cpp index 0f00b55658..4f4d1a308c 100644 --- a/src/AppInstallerCLITests/WindowsFeature.cpp +++ b/src/AppInstallerCLITests/WindowsFeature.cpp @@ -24,12 +24,11 @@ TEST_CASE("InstallFlow_WindowsFeatureDoesNotExist", "[windowsFeature]") TestCommon::TempFile installResultPath("TestExeInstalled.txt"); - TestCommon::TestUserSettings testSettings; - testSettings.Set(true); - std::ostringstream installOutput; TestContext context{ installOutput, std::cin }; auto previousThreadGlobals = context.SetForCurrentThread(); + OverrideOpenDependencySource(context); + context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("InstallFlowTest_WindowsFeatures.yaml").GetPath().u8string()); auto mockDismHelperOverride = TestHook::MockDismHelper_Override(); @@ -58,12 +57,11 @@ TEST_CASE("InstallFlow_FailedToEnableWindowsFeature", "[windowsFeature]") TestCommon::TempFile installResultPath("TestExeInstalled.txt"); - TestCommon::TestUserSettings testSettings; - testSettings.Set(true); - std::ostringstream installOutput; TestContext context{ installOutput, std::cin }; auto previousThreadGlobals = context.SetForCurrentThread(); + OverrideOpenDependencySource(context); + context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("InstallFlowTest_WindowsFeatures.yaml").GetPath().u8string()); // Override with arbitrary DISM api error (DISMAPI_E_DISMAPI_NOT_INITIALIZED) and make windows feature discoverable. @@ -94,9 +92,6 @@ TEST_CASE("InstallFlow_FailedToEnableWindowsFeature_Force", "[windowsFeature]") TestCommon::TempFile installResultPath("TestExeInstalled.txt"); - TestCommon::TestUserSettings testSettings; - testSettings.Set(true); - // Override with arbitrary DISM api error (DISMAPI_E_DISMAPI_NOT_INITIALIZED) and make windows feature discoverable. HRESULT dismErrorResult = 0xc0040001; LocIndString testFeatureDisplayName = LocIndString{ "Test Windows Feature"_liv }; @@ -111,6 +106,8 @@ TEST_CASE("InstallFlow_FailedToEnableWindowsFeature_Force", "[windowsFeature]") TestContext context{ installOutput, std::cin }; auto previousThreadGlobals = context.SetForCurrentThread(); OverrideForShellExecute(context); + OverrideOpenDependencySource(context); + context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("InstallFlowTest_WindowsFeatures.yaml").GetPath().u8string()); context.Args.AddArg(Execution::Args::Type::Force); @@ -142,9 +139,6 @@ TEST_CASE("InstallFlow_RebootRequired", "[windowsFeature]") TestCommon::TempFile installResultPath("TestExeInstalled.txt"); - TestCommon::TestUserSettings testSettings; - testSettings.Set(true); - // Override with reboot required HRESULT. auto mockDismHelperOverride = TestHook::MockDismHelper_Override(); auto setEnableFeatureOverride = TestHook::SetEnableWindowsFeatureResult_Override(ERROR_SUCCESS_REBOOT_REQUIRED); @@ -156,6 +150,8 @@ TEST_CASE("InstallFlow_RebootRequired", "[windowsFeature]") std::ostringstream installOutput; TestContext context{ installOutput, std::cin }; auto previousThreadGlobals = context.SetForCurrentThread(); + OverrideOpenDependencySource(context); + context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("InstallFlowTest_WindowsFeatures.yaml").GetPath().u8string()); InstallCommand install({}); @@ -177,9 +173,6 @@ TEST_CASE("InstallFlow_RebootRequired_Force", "[windowsFeature]") TestCommon::TempFile installResultPath("TestExeInstalled.txt"); - TestCommon::TestUserSettings testSettings; - testSettings.Set(true); - // Override with reboot required HRESULT. auto mockDismHelperOverride = TestHook::MockDismHelper_Override(); auto setEnableFeatureOverride = TestHook::SetEnableWindowsFeatureResult_Override(ERROR_SUCCESS_REBOOT_REQUIRED); @@ -192,6 +185,8 @@ TEST_CASE("InstallFlow_RebootRequired_Force", "[windowsFeature]") TestContext context{ installOutput, std::cin }; auto previousThreadGlobals = context.SetForCurrentThread(); OverrideForShellExecute(context); + OverrideOpenDependencySource(context); + context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("InstallFlowTest_WindowsFeatures.yaml").GetPath().u8string()); context.Args.AddArg(Execution::Args::Type::Force); diff --git a/src/AppInstallerCLITests/WorkFlow.cpp b/src/AppInstallerCLITests/WorkFlow.cpp index 3d6ada6baa..de7701264d 100644 --- a/src/AppInstallerCLITests/WorkFlow.cpp +++ b/src/AppInstallerCLITests/WorkFlow.cpp @@ -76,9 +76,6 @@ TEST_CASE("ValidateCommand_Dependencies", "[workflow][dependencies]") auto previousThreadGlobals = context.SetForCurrentThread(); context.Args.AddArg(Args::Type::ValidateManifest, TestDataFile("Manifest-Good-AllDependencyTypes.yaml").GetPath().u8string()); - TestUserSettings settings; - settings.Set({ true }); - ValidateCommand validate({}); validate.Execute(context); INFO(validateOutput.str()); diff --git a/src/AppInstallerCLITests/WorkflowCommon.cpp b/src/AppInstallerCLITests/WorkflowCommon.cpp index 8405bc7600..0d3212a521 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.cpp +++ b/src/AppInstallerCLITests/WorkflowCommon.cpp @@ -1,12 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #include "pch.h" +#include "DependenciesTestSource.h" #include "WorkflowCommon.h" #include #include #include #include #include +#include using namespace AppInstaller::CLI; using namespace AppInstaller::CLI::Execution; @@ -677,4 +679,18 @@ namespace TestCommon } }); } + void OverrideOpenDependencySource(TestContext& context) + { + context.Override({ Workflow::OpenDependencySource, [](TestContext& context) + { + context.Add(Source{ std::make_shared() }); + } }); + } + + void OverrideEnableWindowsFeaturesDependencies(TestContext& context) + { + context.Override({ Workflow::EnableWindowsFeaturesDependencies, [](TestContext&) + { + } }); + } } \ No newline at end of file diff --git a/src/AppInstallerCLITests/WorkflowCommon.h b/src/AppInstallerCLITests/WorkflowCommon.h index 8ff394806a..c7bfeb3860 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.h +++ b/src/AppInstallerCLITests/WorkflowCommon.h @@ -133,4 +133,7 @@ namespace TestCommon void OverrideForMSStore(TestContext& context, bool isUpdate); + void OverrideOpenDependencySource(TestContext& context); + + void OverrideEnableWindowsFeaturesDependencies(TestContext& context); } \ No newline at end of file diff --git a/src/AppInstallerCommonCore/ExperimentalFeature.cpp b/src/AppInstallerCommonCore/ExperimentalFeature.cpp index 8c4089915a..4a4b882ff5 100644 --- a/src/AppInstallerCommonCore/ExperimentalFeature.cpp +++ b/src/AppInstallerCommonCore/ExperimentalFeature.cpp @@ -38,16 +38,10 @@ namespace AppInstaller::Settings return userSettings.Get() || userSettings.Get(); case ExperimentalFeature::Feature::ExperimentalArg: return userSettings.Get(); - case ExperimentalFeature::Feature::Dependencies: - return userSettings.Get(); case ExperimentalFeature::Feature::DirectMSI: return userSettings.Get(); case ExperimentalFeature::Feature::Configuration: return userSettings.Get(); - case ExperimentalFeature::Feature::WindowsFeature: - return userSettings.Get(); - case ExperimentalFeature::Feature::Download: - return userSettings.Get(); default: THROW_HR(E_UNEXPECTED); } @@ -75,16 +69,10 @@ namespace AppInstaller::Settings return ExperimentalFeature{ "Command Sample", "experimentalCmd", "https://aka.ms/winget-settings", Feature::ExperimentalCmd }; case Feature::ExperimentalArg: return ExperimentalFeature{ "Argument Sample", "experimentalArg", "https://aka.ms/winget-settings", Feature::ExperimentalArg }; - case Feature::Dependencies: - return ExperimentalFeature{ "Show Dependencies Information", "dependencies", "https://aka.ms/winget-settings", Feature::Dependencies }; case Feature::DirectMSI: return ExperimentalFeature{ "Direct MSI Installation", "directMSI", "https://aka.ms/winget-settings", Feature::DirectMSI }; case Feature::Configuration: return ExperimentalFeature{ "Configuration", "configuration", "https://aka.ms/winget-settings#configuration", Feature::Configuration }; - case Feature::WindowsFeature: - return ExperimentalFeature{ "Windows Feature Dependencies", "windowsFeature", "https://aka.ms/winget-settings", Feature::WindowsFeature }; - case Feature::Download: - return ExperimentalFeature{ "Download", "download", "https://aka.ms/winget-settings", Feature::Download }; default: THROW_HR(E_UNEXPECTED); } diff --git a/src/AppInstallerCommonCore/Public/winget/ExperimentalFeature.h b/src/AppInstallerCommonCore/Public/winget/ExperimentalFeature.h index 99ad8fd8b3..4ce8e05a3d 100644 --- a/src/AppInstallerCommonCore/Public/winget/ExperimentalFeature.h +++ b/src/AppInstallerCommonCore/Public/winget/ExperimentalFeature.h @@ -21,12 +21,9 @@ namespace AppInstaller::Settings enum class Feature : unsigned { None = 0x0, - Dependencies = 0x1, // Before making DirectMSI non-experimental, it should be part of manifest validation. - DirectMSI = 0x2, - Configuration = 0x4, - WindowsFeature = 0x8, - Download = 0x10, + DirectMSI = 0x1, + Configuration = 0x2, Max, // This MUST always be after all experimental features // Features listed after Max will not be shown with the features command diff --git a/src/AppInstallerCommonCore/Public/winget/UserSettings.h b/src/AppInstallerCommonCore/Public/winget/UserSettings.h index 6435a3121f..2d29616ac7 100644 --- a/src/AppInstallerCommonCore/Public/winget/UserSettings.h +++ b/src/AppInstallerCommonCore/Public/winget/UserSettings.h @@ -69,11 +69,8 @@ namespace AppInstaller::Settings // Experimental EFExperimentalCmd, EFExperimentalArg, - EFDependencies, EFDirectMSI, EFConfiguration, - EFWindowsFeature, - EFDownload, // Telemetry TelemetryDisable, // Install behavior @@ -146,11 +143,8 @@ namespace AppInstaller::Settings // Experimental SETTINGMAPPING_SPECIALIZATION(Setting::EFExperimentalCmd, bool, bool, false, ".experimentalFeatures.experimentalCmd"sv); SETTINGMAPPING_SPECIALIZATION(Setting::EFExperimentalArg, bool, bool, false, ".experimentalFeatures.experimentalArg"sv); - SETTINGMAPPING_SPECIALIZATION(Setting::EFDependencies, bool, bool, false, ".experimentalFeatures.dependencies"sv); SETTINGMAPPING_SPECIALIZATION(Setting::EFDirectMSI, bool, bool, false, ".experimentalFeatures.directMSI"sv); SETTINGMAPPING_SPECIALIZATION(Setting::EFConfiguration, bool, bool, false, ".experimentalFeatures.configuration"sv); - SETTINGMAPPING_SPECIALIZATION(Setting::EFWindowsFeature, bool, bool, false, ".experimentalFeatures.windowsFeature"sv); - SETTINGMAPPING_SPECIALIZATION(Setting::EFDownload, bool, bool, false, ".experimentalFeatures.download"sv); // Telemetry SETTINGMAPPING_SPECIALIZATION(Setting::TelemetryDisable, bool, bool, false, ".telemetry.disable"sv); // Install behavior diff --git a/src/AppInstallerCommonCore/UserSettings.cpp b/src/AppInstallerCommonCore/UserSettings.cpp index 60e1d92d3a..7a7a28af9b 100644 --- a/src/AppInstallerCommonCore/UserSettings.cpp +++ b/src/AppInstallerCommonCore/UserSettings.cpp @@ -258,11 +258,8 @@ namespace AppInstaller::Settings WINGET_VALIDATE_PASS_THROUGH(EFExperimentalCmd) WINGET_VALIDATE_PASS_THROUGH(EFExperimentalArg) - WINGET_VALIDATE_PASS_THROUGH(EFDependencies) WINGET_VALIDATE_PASS_THROUGH(EFDirectMSI) WINGET_VALIDATE_PASS_THROUGH(EFConfiguration) - WINGET_VALIDATE_PASS_THROUGH(EFWindowsFeature) - WINGET_VALIDATE_PASS_THROUGH(EFDownload) WINGET_VALIDATE_PASS_THROUGH(AnonymizePathForDisplay) WINGET_VALIDATE_PASS_THROUGH(TelemetryDisable) WINGET_VALIDATE_PASS_THROUGH(InteractivityDisable) diff --git a/src/Microsoft.Management.Deployment/PackageManager.cpp b/src/Microsoft.Management.Deployment/PackageManager.cpp index 0cbbebc9f6..aa5d808ae4 100644 --- a/src/Microsoft.Management.Deployment/PackageManager.cpp +++ b/src/Microsoft.Management.Deployment/PackageManager.cpp @@ -987,12 +987,6 @@ namespace winrt::Microsoft::Management::Deployment::implementation winrt::Windows::Foundation::IAsyncOperationWithProgress PackageManager::DownloadPackageAsync(winrt::Microsoft::Management::Deployment::CatalogPackage package, winrt::Microsoft::Management::Deployment::DownloadOptions options) { - // TODO: Remove once 'download' experimental feature is stable. Dependencies experimental feature is also required to handle multiple package downloads. - if (!AppInstaller::Settings::ExperimentalFeature::IsEnabled(AppInstaller::Settings::ExperimentalFeature::Feature::Download)) - { - THROW_HR(APPINSTALLER_CLI_ERROR_EXPERIMENTAL_FEATURE_DISABLED); - } - hstring correlationData = (options) ? options.CorrelationData() : L""; // options and catalog can both be null, package must be set. @@ -1018,12 +1012,6 @@ namespace winrt::Microsoft::Management::Deployment::implementation winrt::Windows::Foundation::IAsyncOperationWithProgress PackageManager::GetDownloadProgress(winrt::Microsoft::Management::Deployment::CatalogPackage package, winrt::Microsoft::Management::Deployment::PackageCatalogInfo catalogInfo) { - // TODO: Remove once 'download' experimental feature is stable. - if (!AppInstaller::Settings::ExperimentalFeature::IsEnabled(AppInstaller::Settings::ExperimentalFeature::Feature::Download)) - { - THROW_HR(APPINSTALLER_CLI_ERROR_EXPERIMENTAL_FEATURE_DISABLED); - } - hstring correlationData; WINGET_RETURN_DOWNLOAD_RESULT_HR_IF(APPINSTALLER_CLI_ERROR_INVALID_CL_ARGUMENTS, !package);