From 413a31ccde4cbdebb1773a009704126012f0a8bb Mon Sep 17 00:00:00 2001 From: Paul Yim Date: Thu, 23 Mar 2023 18:47:55 -0700 Subject: [PATCH 1/9] added store bypass flag --- doc/specs/#888 - Com Api.md | 2 ++ src/AppInstallerCLICore/ExecutionContext.h | 1 + .../Workflows/MSStoreInstallerHandler.cpp | 10 +++++++- .../Interop/InstallInterop.cs | 23 +++++++++++++++++++ .../InstallOptions.cpp | 8 +++++++ .../InstallOptions.h | 3 +++ .../PackageManager.cpp | 6 +++++ .../PackageManager.idl | 2 ++ .../Commands/Common/BaseInstallCommand.cs | 9 +++++++- 9 files changed, 62 insertions(+), 2 deletions(-) diff --git a/doc/specs/#888 - Com Api.md b/doc/specs/#888 - Com Api.md index 35123edd20..18c6805637 100644 --- a/doc/specs/#888 - Com Api.md +++ b/doc/specs/#888 - Com Api.md @@ -802,6 +802,8 @@ namespace Microsoft.Management.Deployment String LogOutputPath; /// Continues the install even if the hash in the catalog does not match the linked installer. Boolean AllowHashMismatch; + /// Allows Store installs when Store is disabled. + Boolean BypassStorePolicy; /// A string that will be passed to the installer. /// IMPLEMENTATION NOTE: maps to "--override" in the winget cmd line String ReplacementInstallerArguments; diff --git a/src/AppInstallerCLICore/ExecutionContext.h b/src/AppInstallerCLICore/ExecutionContext.h index 9255289269..4f54c38626 100644 --- a/src/AppInstallerCLICore/ExecutionContext.h +++ b/src/AppInstallerCLICore/ExecutionContext.h @@ -64,6 +64,7 @@ namespace AppInstaller::CLI::Execution TreatSourceFailuresAsWarning = 0x8, ShowSearchResultsOnPartialFailure = 0x10, DisableInteractivity = 0x40, + BypassStorePolicy = 0x80, }; DEFINE_ENUM_FLAG_OPERATORS(ContextFlag); diff --git a/src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp b/src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp index e6ccc228a1..0bec97b8f8 100644 --- a/src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp +++ b/src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp @@ -115,6 +115,12 @@ namespace AppInstaller::CLI::Workflow } else if (result.Status() == GetEntitlementStatus::ServerError) { + bool bypassStorePolicy = WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::BypassStorePolicy); + if (bypassStorePolicy) + { + // Entitlement fails because the store is disabled + return true; + } context.Reporter.Info() << Resource::String::MSStoreInstallGetEntitlementServerError << std::endl; AICLI_LOG(CLI, Error, << "Get entitlement failed Server error. ProductId: " << Utility::ConvertToUTF8(productId)); } @@ -249,7 +255,9 @@ namespace AppInstaller::CLI::Workflow // Policy check AppInstallManager installManager; - if (installManager.IsStoreBlockedByPolicyAsync(s_StoreClientName, s_StoreClientPublisher).get()) + bool bypassStorePolicy = WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::BypassStorePolicy); + + if (installManager.IsStoreBlockedByPolicyAsync(s_StoreClientName, s_StoreClientPublisher).get() && !bypassStorePolicy) { context.Reporter.Error() << Resource::String::MSStoreStoreClientBlocked << std::endl; AICLI_LOG(CLI, Error, << "Store client is blocked by policy. MSStore execution failed."); diff --git a/src/AppInstallerCLIE2ETests/Interop/InstallInterop.cs b/src/AppInstallerCLIE2ETests/Interop/InstallInterop.cs index 3f69ec3e4d..1340f3c892 100644 --- a/src/AppInstallerCLIE2ETests/Interop/InstallInterop.cs +++ b/src/AppInstallerCLIE2ETests/Interop/InstallInterop.cs @@ -599,5 +599,28 @@ public void GetApplicableInstaller() Assert.AreEqual(PackageInstallerScope.User, packageInstallerInfo.Scope); Assert.AreEqual("en-US", packageInstallerInfo.Locale); } + + /// + /// Test install with BypassStorePolicy Enabled. + /// + /// A representing the asynchronous unit test. + [Test] + public async Task InstallMsixStoreBypass() + { + // Find package + var searchResult = this.FindOnePackage(this.testSource, PackageMatchField.Name, PackageFieldMatchOption.Equals, "AppInstallerTest.CatalogPackageMetadata"); + + // Configure installation + var installOptions = this.TestFactory.CreateInstallOptions(); + installOptions.BypassStorePolicy = true; + installOptions.AcceptPackageAgreements = true; + + // Install + var installResult = await this.packageManager.InstallPackageAsync(searchResult.CatalogPackage, installOptions); + + // Assert + Assert.AreEqual(InstallResultStatus.DownloadError, installResult.Status); + Assert.False(TestCommon.VerifyTestMsixInstalledAndCleanup()); + } } } \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment/InstallOptions.cpp b/src/Microsoft.Management.Deployment/InstallOptions.cpp index 46f3e64707..9a1d7eaab6 100644 --- a/src/Microsoft.Management.Deployment/InstallOptions.cpp +++ b/src/Microsoft.Management.Deployment/InstallOptions.cpp @@ -76,6 +76,14 @@ namespace winrt::Microsoft::Management::Deployment::implementation { m_allowHashMismatch = value; } + bool InstallOptions::BypassStorePolicy() + { + return m_bypassStorePolicy; + } + void InstallOptions::BypassStorePolicy(bool value) + { + m_bypassStorePolicy = value; + } hstring InstallOptions::ReplacementInstallerArguments() { return hstring(m_replacementInstallerArguments); diff --git a/src/Microsoft.Management.Deployment/InstallOptions.h b/src/Microsoft.Management.Deployment/InstallOptions.h index 0433fb3254..603b6cb7c1 100644 --- a/src/Microsoft.Management.Deployment/InstallOptions.h +++ b/src/Microsoft.Management.Deployment/InstallOptions.h @@ -23,6 +23,8 @@ namespace winrt::Microsoft::Management::Deployment::implementation void LogOutputPath(hstring const& value); bool AllowHashMismatch(); void AllowHashMismatch(bool value); + bool BypassStorePolicy(); + void BypassStorePolicy(bool value); hstring ReplacementInstallerArguments(); void ReplacementInstallerArguments(hstring const& value); hstring AdditionalInstallerArguments(); @@ -47,6 +49,7 @@ namespace winrt::Microsoft::Management::Deployment::implementation winrt::Microsoft::Management::Deployment::PackageInstallMode m_packageInstallMode = winrt::Microsoft::Management::Deployment::PackageInstallMode::Default; std::wstring m_logOutputPath = L""; bool m_allowHashMismatch = false; + bool m_bypassStorePolicy = false; std::wstring m_replacementInstallerArguments = L""; std::wstring m_additionalInstallerArguments = L""; std::wstring m_correlationData = L""; diff --git a/src/Microsoft.Management.Deployment/PackageManager.cpp b/src/Microsoft.Management.Deployment/PackageManager.cpp index 451da773a9..ff9071367c 100644 --- a/src/Microsoft.Management.Deployment/PackageManager.cpp +++ b/src/Microsoft.Management.Deployment/PackageManager.cpp @@ -349,6 +349,12 @@ namespace winrt::Microsoft::Management::Deployment::implementation { context->Args.AddArg(Execution::Args::Type::HashOverride); } + + if (options.BypassStorePolicy()) + { + context->SetFlags(Execution::ContextFlag::BypassStorePolicy); + } + if (options.Force()) { context->Args.AddArg(Execution::Args::Type::Force); diff --git a/src/Microsoft.Management.Deployment/PackageManager.idl b/src/Microsoft.Management.Deployment/PackageManager.idl index c363db4b2d..03480972ae 100644 --- a/src/Microsoft.Management.Deployment/PackageManager.idl +++ b/src/Microsoft.Management.Deployment/PackageManager.idl @@ -777,6 +777,8 @@ namespace Microsoft.Management.Deployment String LogOutputPath; /// Continues the install even if the hash in the catalog does not match the linked installer. Boolean AllowHashMismatch; + /// Bypasses the Disabled Store Policy + Boolean BypassStorePolicy; /// A string that will be passed to the installer. /// IMPLEMENTATION NOTE: maps to "--override" in the winget cmd line String ReplacementInstallerArguments; diff --git a/src/PowerShell/Microsoft.WinGet.Client/Commands/Common/BaseInstallCommand.cs b/src/PowerShell/Microsoft.WinGet.Client/Commands/Common/BaseInstallCommand.cs index f5fc4d187e..ff47992bfb 100644 --- a/src/PowerShell/Microsoft.WinGet.Client/Commands/Common/BaseInstallCommand.cs +++ b/src/PowerShell/Microsoft.WinGet.Client/Commands/Common/BaseInstallCommand.cs @@ -57,7 +57,13 @@ public string Location /// Gets or sets a value indicating whether to skip the installer hash validation check. /// [Parameter(ValueFromPipelineByPropertyName = true)] - public SwitchParameter AllowHashMismatch { get; set; } + public SwitchParameter AllowHashMismatch { get; set; } + + /// + /// Gets or sets a value indicating whether to skip the installer hash validation check. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + public SwitchParameter BypassStorePolicy { get; set; } /// /// Gets or sets a value indicating whether to continue upon non security related failures. @@ -80,6 +86,7 @@ protected virtual InstallOptions GetInstallOptions(PackageVersionId version) { InstallOptions options = ComObjectFactory.Value.CreateInstallOptions(); options.AllowHashMismatch = this.AllowHashMismatch.ToBool(); + options.BypassStorePolicy = this.BypassStorePolicy.ToBool(); options.Force = this.Force.ToBool(); options.PackageInstallMode = this.Mode; if (version != null) From 8bb8ff67a02f2961b81bc17baf32a83d50337d1f Mon Sep 17 00:00:00 2001 From: Paul Yim Date: Thu, 23 Mar 2023 20:02:51 -0700 Subject: [PATCH 2/9] moving to new contract version --- src/Microsoft.Management.Deployment/PackageManager.idl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Management.Deployment/PackageManager.idl b/src/Microsoft.Management.Deployment/PackageManager.idl index 03480972ae..b19406e07a 100644 --- a/src/Microsoft.Management.Deployment/PackageManager.idl +++ b/src/Microsoft.Management.Deployment/PackageManager.idl @@ -777,8 +777,6 @@ namespace Microsoft.Management.Deployment String LogOutputPath; /// Continues the install even if the hash in the catalog does not match the linked installer. Boolean AllowHashMismatch; - /// Bypasses the Disabled Store Policy - Boolean BypassStorePolicy; /// A string that will be passed to the installer. /// IMPLEMENTATION NOTE: maps to "--override" in the winget cmd line String ReplacementInstallerArguments; @@ -819,6 +817,9 @@ namespace Microsoft.Management.Deployment /// Accept the package agreements required for installation. Boolean AcceptPackageAgreements; + + /// Bypasses the Disabled Store Policy + Boolean BypassStorePolicy; } } From 0b9eb44ff250ebc838662a586c4544f57df373f4 Mon Sep 17 00:00:00 2001 From: Paul Yim Date: Fri, 24 Mar 2023 16:35:31 -0700 Subject: [PATCH 3/9] addressing comments --- src/AppInstallerCLICore/ExecutionContext.h | 2 +- .../Workflows/MSStoreInstallerHandler.cpp | 13 +++------- .../Interop/InstallInterop.cs | 23 ------------------ src/AppInstallerCLITests/InstallFlow.cpp | 24 +++++++++++++++++++ src/AppInstallerCLITests/WorkflowCommon.cpp | 2 +- .../InstallOptions.cpp | 4 ++-- .../InstallOptions.h | 4 ++-- .../PackageManager.cpp | 4 ++-- .../PackageManager.idl | 2 +- .../Commands/Common/BaseInstallCommand.cs | 9 +------ 10 files changed, 37 insertions(+), 50 deletions(-) diff --git a/src/AppInstallerCLICore/ExecutionContext.h b/src/AppInstallerCLICore/ExecutionContext.h index 4f54c38626..23658fe495 100644 --- a/src/AppInstallerCLICore/ExecutionContext.h +++ b/src/AppInstallerCLICore/ExecutionContext.h @@ -64,7 +64,7 @@ namespace AppInstaller::CLI::Execution TreatSourceFailuresAsWarning = 0x8, ShowSearchResultsOnPartialFailure = 0x10, DisableInteractivity = 0x40, - BypassStorePolicy = 0x80, + BypassIsStoreClientBlockedPolicyCheck = 0x80, }; DEFINE_ENUM_FLAG_OPERATORS(ContextFlag); diff --git a/src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp b/src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp index 0bec97b8f8..a4df6a873a 100644 --- a/src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp +++ b/src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp @@ -115,12 +115,6 @@ namespace AppInstaller::CLI::Workflow } else if (result.Status() == GetEntitlementStatus::ServerError) { - bool bypassStorePolicy = WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::BypassStorePolicy); - if (bypassStorePolicy) - { - // Entitlement fails because the store is disabled - return true; - } context.Reporter.Info() << Resource::String::MSStoreInstallGetEntitlementServerError << std::endl; AICLI_LOG(CLI, Error, << "Get entitlement failed Server error. ProductId: " << Utility::ConvertToUTF8(productId)); } @@ -254,10 +248,9 @@ namespace AppInstaller::CLI::Workflow constexpr std::wstring_view s_StoreClientPublisher = L"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"sv; // Policy check - AppInstallManager installManager; - bool bypassStorePolicy = WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::BypassStorePolicy); - - if (installManager.IsStoreBlockedByPolicyAsync(s_StoreClientName, s_StoreClientPublisher).get() && !bypassStorePolicy) + AppInstallManager installManager; + + if (!WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::BypassIsStoreClientBlockedPolicyCheck) && installManager.IsStoreBlockedByPolicyAsync(s_StoreClientName, s_StoreClientPublisher).get()) { context.Reporter.Error() << Resource::String::MSStoreStoreClientBlocked << std::endl; AICLI_LOG(CLI, Error, << "Store client is blocked by policy. MSStore execution failed."); diff --git a/src/AppInstallerCLIE2ETests/Interop/InstallInterop.cs b/src/AppInstallerCLIE2ETests/Interop/InstallInterop.cs index 1340f3c892..3f69ec3e4d 100644 --- a/src/AppInstallerCLIE2ETests/Interop/InstallInterop.cs +++ b/src/AppInstallerCLIE2ETests/Interop/InstallInterop.cs @@ -599,28 +599,5 @@ public void GetApplicableInstaller() Assert.AreEqual(PackageInstallerScope.User, packageInstallerInfo.Scope); Assert.AreEqual("en-US", packageInstallerInfo.Locale); } - - /// - /// Test install with BypassStorePolicy Enabled. - /// - /// A representing the asynchronous unit test. - [Test] - public async Task InstallMsixStoreBypass() - { - // Find package - var searchResult = this.FindOnePackage(this.testSource, PackageMatchField.Name, PackageFieldMatchOption.Equals, "AppInstallerTest.CatalogPackageMetadata"); - - // Configure installation - var installOptions = this.TestFactory.CreateInstallOptions(); - installOptions.BypassStorePolicy = true; - installOptions.AcceptPackageAgreements = true; - - // Install - var installResult = await this.packageManager.InstallPackageAsync(searchResult.CatalogPackage, installOptions); - - // Assert - Assert.AreEqual(InstallResultStatus.DownloadError, installResult.Status); - Assert.False(TestCommon.VerifyTestMsixInstalledAndCleanup()); - } } } \ No newline at end of file diff --git a/src/AppInstallerCLITests/InstallFlow.cpp b/src/AppInstallerCLITests/InstallFlow.cpp index e66e2682ef..a35b1077fd 100644 --- a/src/AppInstallerCLITests/InstallFlow.cpp +++ b/src/AppInstallerCLITests/InstallFlow.cpp @@ -536,6 +536,30 @@ TEST_CASE("MSStoreInstallFlowWithTestManifest", "[InstallFlow][workflow]") REQUIRE(installResultStr.find("9WZDNCRFJ364") != std::string::npos); } +TEST_CASE("MSStoreInstallFlowWithTestManifestBypassStoreClientBlockedByPolicy", "[InstallFlow][workflow]") +{ + TestCommon::TempFile installResultPath("TestMSStoreInstalled.txt"); + + std::ostringstream installOutput; + TestContext context{ installOutput, std::cin }; + auto previousThreadGlobals = context.SetForCurrentThread(); + OverrideForMSStore(context, false); + context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("InstallFlowTest_MSStore.yaml").GetPath().u8string()); + context.SetFlags(Execution::ContextFlag::BypassIsStoreClientBlockedPolicyCheck); + + InstallCommand install({}); + install.Execute(context); + INFO(installOutput.str()); + + // Verify Installer is called and parameters are passed in. + REQUIRE(std::filesystem::exists(installResultPath.GetPath())); + std::ifstream installResultFile(installResultPath.GetPath()); + REQUIRE(installResultFile.is_open()); + std::string installResultStr; + std::getline(installResultFile, installResultStr); + REQUIRE(installResultStr.find("9WZDNCRFJ364") != std::string::npos); +} + TEST_CASE("MsixInstallFlow_DownloadFlow", "[InstallFlow][workflow]") { TestCommon::TempFile installResultPath("TestMsixInstalled.txt"); diff --git a/src/AppInstallerCLITests/WorkflowCommon.cpp b/src/AppInstallerCLITests/WorkflowCommon.cpp index de8cc4144e..2426516198 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.cpp +++ b/src/AppInstallerCLITests/WorkflowCommon.cpp @@ -662,7 +662,7 @@ namespace TestCommon } else { - context.Override({ MSStoreInstall, [](TestContext& context) + context.Override({ MSStoreInstall, [](TestContext& context) { std::filesystem::path temp = std::filesystem::temp_directory_path(); temp /= "TestMSStoreInstalled.txt"; diff --git a/src/Microsoft.Management.Deployment/InstallOptions.cpp b/src/Microsoft.Management.Deployment/InstallOptions.cpp index 9a1d7eaab6..42b11a0add 100644 --- a/src/Microsoft.Management.Deployment/InstallOptions.cpp +++ b/src/Microsoft.Management.Deployment/InstallOptions.cpp @@ -76,11 +76,11 @@ namespace winrt::Microsoft::Management::Deployment::implementation { m_allowHashMismatch = value; } - bool InstallOptions::BypassStorePolicy() + bool InstallOptions::BypassIsStoreClientBlockedPolicyCheck() { return m_bypassStorePolicy; } - void InstallOptions::BypassStorePolicy(bool value) + void InstallOptions::BypassIsStoreClientBlockedPolicyCheck(bool value) { m_bypassStorePolicy = value; } diff --git a/src/Microsoft.Management.Deployment/InstallOptions.h b/src/Microsoft.Management.Deployment/InstallOptions.h index 603b6cb7c1..e56dae0dbe 100644 --- a/src/Microsoft.Management.Deployment/InstallOptions.h +++ b/src/Microsoft.Management.Deployment/InstallOptions.h @@ -23,8 +23,8 @@ namespace winrt::Microsoft::Management::Deployment::implementation void LogOutputPath(hstring const& value); bool AllowHashMismatch(); void AllowHashMismatch(bool value); - bool BypassStorePolicy(); - void BypassStorePolicy(bool value); + bool BypassIsStoreClientBlockedPolicyCheck(); + void BypassIsStoreClientBlockedPolicyCheck(bool value); hstring ReplacementInstallerArguments(); void ReplacementInstallerArguments(hstring const& value); hstring AdditionalInstallerArguments(); diff --git a/src/Microsoft.Management.Deployment/PackageManager.cpp b/src/Microsoft.Management.Deployment/PackageManager.cpp index ff9071367c..a5214db7ba 100644 --- a/src/Microsoft.Management.Deployment/PackageManager.cpp +++ b/src/Microsoft.Management.Deployment/PackageManager.cpp @@ -350,9 +350,9 @@ namespace winrt::Microsoft::Management::Deployment::implementation context->Args.AddArg(Execution::Args::Type::HashOverride); } - if (options.BypassStorePolicy()) + if (options.BypassIsStoreClientBlockedPolicyCheck()) { - context->SetFlags(Execution::ContextFlag::BypassStorePolicy); + context->SetFlags(Execution::ContextFlag::BypassIsStoreClientBlockedPolicyCheck); } if (options.Force()) diff --git a/src/Microsoft.Management.Deployment/PackageManager.idl b/src/Microsoft.Management.Deployment/PackageManager.idl index b19406e07a..58d42748cc 100644 --- a/src/Microsoft.Management.Deployment/PackageManager.idl +++ b/src/Microsoft.Management.Deployment/PackageManager.idl @@ -819,7 +819,7 @@ namespace Microsoft.Management.Deployment Boolean AcceptPackageAgreements; /// Bypasses the Disabled Store Policy - Boolean BypassStorePolicy; + Boolean BypassIsStoreClientBlockedPolicyCheck; } } diff --git a/src/PowerShell/Microsoft.WinGet.Client/Commands/Common/BaseInstallCommand.cs b/src/PowerShell/Microsoft.WinGet.Client/Commands/Common/BaseInstallCommand.cs index ff47992bfb..f5fc4d187e 100644 --- a/src/PowerShell/Microsoft.WinGet.Client/Commands/Common/BaseInstallCommand.cs +++ b/src/PowerShell/Microsoft.WinGet.Client/Commands/Common/BaseInstallCommand.cs @@ -57,13 +57,7 @@ public string Location /// Gets or sets a value indicating whether to skip the installer hash validation check. /// [Parameter(ValueFromPipelineByPropertyName = true)] - public SwitchParameter AllowHashMismatch { get; set; } - - /// - /// Gets or sets a value indicating whether to skip the installer hash validation check. - /// - [Parameter(ValueFromPipelineByPropertyName = true)] - public SwitchParameter BypassStorePolicy { get; set; } + public SwitchParameter AllowHashMismatch { get; set; } /// /// Gets or sets a value indicating whether to continue upon non security related failures. @@ -86,7 +80,6 @@ protected virtual InstallOptions GetInstallOptions(PackageVersionId version) { InstallOptions options = ComObjectFactory.Value.CreateInstallOptions(); options.AllowHashMismatch = this.AllowHashMismatch.ToBool(); - options.BypassStorePolicy = this.BypassStorePolicy.ToBool(); options.Force = this.Force.ToBool(); options.PackageInstallMode = this.Mode; if (version != null) From 4bf9eae750be262de05fc4ec4994dc3beb177069 Mon Sep 17 00:00:00 2001 From: Paul Yim Date: Tue, 28 Mar 2023 19:08:10 -0700 Subject: [PATCH 4/9] Addressing Comments and Adding Tests --- doc/specs/#888 - Com Api.md | 4 +- src/AppInstallerCLITests/InstallFlow.cpp | 72 ++++++++++++++++++- src/AppInstallerCLITests/WorkflowCommon.cpp | 25 +++++++ src/AppInstallerCLITests/WorkflowCommon.h | 4 +- .../InstallOptions.cpp | 4 +- .../InstallOptions.h | 2 +- 6 files changed, 102 insertions(+), 9 deletions(-) diff --git a/doc/specs/#888 - Com Api.md b/doc/specs/#888 - Com Api.md index 18c6805637..abf6236649 100644 --- a/doc/specs/#888 - Com Api.md +++ b/doc/specs/#888 - Com Api.md @@ -802,8 +802,8 @@ namespace Microsoft.Management.Deployment String LogOutputPath; /// Continues the install even if the hash in the catalog does not match the linked installer. Boolean AllowHashMismatch; - /// Allows Store installs when Store is disabled. - Boolean BypassStorePolicy; + /// Allows Store installs when Store Client is disabled. + Boolean BypassIsStoreClientBlockedPolicyCheck; /// A string that will be passed to the installer. /// IMPLEMENTATION NOTE: maps to "--override" in the winget cmd line String ReplacementInstallerArguments; diff --git a/src/AppInstallerCLITests/InstallFlow.cpp b/src/AppInstallerCLITests/InstallFlow.cpp index a35b1077fd..ab219fd716 100644 --- a/src/AppInstallerCLITests/InstallFlow.cpp +++ b/src/AppInstallerCLITests/InstallFlow.cpp @@ -536,21 +536,82 @@ TEST_CASE("MSStoreInstallFlowWithTestManifest", "[InstallFlow][workflow]") REQUIRE(installResultStr.find("9WZDNCRFJ364") != std::string::npos); } -TEST_CASE("MSStoreInstallFlowWithTestManifestBypassStoreClientBlockedByPolicy", "[InstallFlow][workflow]") +TEST_CASE("MSStoreInstallFlowWithStoreDisabled", "[InstallFlow][workflow]") { + if (!AppInstaller::Runtime::IsRunningAsAdmin()) + { + WARN("Test requires admin privilege. Skipped."); + return; + } + TestCommon::TempFile installResultPath("TestMSStoreInstalled.txt"); std::ostringstream installOutput; TestContext context{ installOutput, std::cin }; auto previousThreadGlobals = context.SetForCurrentThread(); - OverrideForMSStore(context, false); + + // Disable the store client app and verify + std::wstring disableStoreSubKey = L"RemoveWindowsStore"; + wil::unique_hkey result; + RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &result); + SetRegistryValue(result.get(), disableStoreSubKey, 1); + + AppInstaller::Registry::Key key{ result.get(), L"" }; + std::optional value = key[disableStoreSubKey]; + REQUIRE(value); + REQUIRE(value->GetValue() == 1); + context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("InstallFlowTest_MSStore.yaml").GetPath().u8string()); - context.SetFlags(Execution::ContextFlag::BypassIsStoreClientBlockedPolicyCheck); InstallCommand install({}); install.Execute(context); INFO(installOutput.str()); + // Verify installation failed + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_MSSTORE_BLOCKED_BY_POLICY); + REQUIRE_FALSE(std::filesystem::exists(installResultPath.GetPath())); + REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::MSStoreStoreClientBlocked).get()) != std::string::npos); + + // Enable store client app and verify + SetRegistryValue(result.get(), disableStoreSubKey, 0); + + value = key[disableStoreSubKey]; + REQUIRE(value->GetValue() == 0); +} + +TEST_CASE("MSStoreInstallFlowWithStoreDisabledBypassStoreClientBlockedByPolicy", "[InstallFlow][workflow]") +{ + if (!AppInstaller::Runtime::IsRunningAsAdmin()) + { + WARN("Test requires admin privilege. Skipped."); + return; + } + + TestCommon::TempFile installResultPath("TestMSStoreInstalled.txt"); + + std::ostringstream installOutput; + TestContext context{ installOutput, std::cin }; + auto previousThreadGlobals = context.SetForCurrentThread(); + OverrideForMSStoreWithEnsureStorePolicySatisfied(context, false); + + // Disable the store client app and verify + std::wstring disableStoreSubKey = L"RemoveWindowsStore"; + wil::unique_hkey result; + RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &result); + SetRegistryValue(result.get(), disableStoreSubKey, 1); + + AppInstaller::Registry::Key key{ result.get(), L"" }; + std::optional value = key[disableStoreSubKey]; + REQUIRE(value); + REQUIRE(value->GetValue() == 1); + + context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("InstallFlowTest_MSStore.yaml").GetPath().u8string()); + context.SetFlags(Execution::ContextFlag::BypassIsStoreClientBlockedPolicyCheck); + + InstallCommand install({}); + install.Execute(context); + INFO(installOutput.str()); + // Verify Installer is called and parameters are passed in. REQUIRE(std::filesystem::exists(installResultPath.GetPath())); std::ifstream installResultFile(installResultPath.GetPath()); @@ -558,6 +619,11 @@ TEST_CASE("MSStoreInstallFlowWithTestManifestBypassStoreClientBlockedByPolicy", std::string installResultStr; std::getline(installResultFile, installResultStr); REQUIRE(installResultStr.find("9WZDNCRFJ364") != std::string::npos); + + // Enable store client app and verify + SetRegistryValue(result.get(), disableStoreSubKey, 0); + value = key[disableStoreSubKey]; + REQUIRE(value->GetValue() == 0); } TEST_CASE("MsixInstallFlow_DownloadFlow", "[InstallFlow][workflow]") diff --git a/src/AppInstallerCLITests/WorkflowCommon.cpp b/src/AppInstallerCLITests/WorkflowCommon.cpp index 2426516198..412df155cd 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.cpp +++ b/src/AppInstallerCLITests/WorkflowCommon.cpp @@ -676,5 +676,30 @@ namespace TestCommon { } }); } + void OverrideForMSStoreWithEnsureStorePolicySatisfied(TestContext& context, bool isUpdate) + { + if (isUpdate) + { + context.Override({ MSStoreUpdate, [](TestContext& context) + { + std::filesystem::path temp = std::filesystem::temp_directory_path(); + temp /= "TestMSStoreUpdated.txt"; + std::ofstream file(temp, std::ofstream::out); + file << context.Get()->ProductId; + file.close(); + } }); + } + else + { + context.Override({ MSStoreInstall, [](TestContext& context) + { + std::filesystem::path temp = std::filesystem::temp_directory_path(); + temp /= "TestMSStoreInstalled.txt"; + std::ofstream file(temp, std::ofstream::out); + file << context.Get()->ProductId; + file.close(); + } }); + } + } } \ No newline at end of file diff --git a/src/AppInstallerCLITests/WorkflowCommon.h b/src/AppInstallerCLITests/WorkflowCommon.h index 8ff394806a..7f1266522a 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.h +++ b/src/AppInstallerCLITests/WorkflowCommon.h @@ -129,8 +129,10 @@ namespace TestCommon void OverrideForVerifyAndSetNestedInstaller(TestContext& context); - void OverrideForMSIX(TestContext& context); + void OverrideForMSIX(TestContext& context); void OverrideForMSStore(TestContext& context, bool isUpdate); + void OverrideForMSStoreWithEnsureStorePolicySatisfied(TestContext& context, bool isUpdate); + } \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment/InstallOptions.cpp b/src/Microsoft.Management.Deployment/InstallOptions.cpp index 42b11a0add..2f62add6d3 100644 --- a/src/Microsoft.Management.Deployment/InstallOptions.cpp +++ b/src/Microsoft.Management.Deployment/InstallOptions.cpp @@ -78,11 +78,11 @@ namespace winrt::Microsoft::Management::Deployment::implementation } bool InstallOptions::BypassIsStoreClientBlockedPolicyCheck() { - return m_bypassStorePolicy; + return m_bypassIsStoreClientBlockedPolicyCheck; } void InstallOptions::BypassIsStoreClientBlockedPolicyCheck(bool value) { - m_bypassStorePolicy = value; + m_bypassIsStoreClientBlockedPolicyCheck = value; } hstring InstallOptions::ReplacementInstallerArguments() { diff --git a/src/Microsoft.Management.Deployment/InstallOptions.h b/src/Microsoft.Management.Deployment/InstallOptions.h index e56dae0dbe..37c91b4c4c 100644 --- a/src/Microsoft.Management.Deployment/InstallOptions.h +++ b/src/Microsoft.Management.Deployment/InstallOptions.h @@ -49,7 +49,7 @@ namespace winrt::Microsoft::Management::Deployment::implementation winrt::Microsoft::Management::Deployment::PackageInstallMode m_packageInstallMode = winrt::Microsoft::Management::Deployment::PackageInstallMode::Default; std::wstring m_logOutputPath = L""; bool m_allowHashMismatch = false; - bool m_bypassStorePolicy = false; + bool m_bypassIsStoreClientBlockedPolicyCheck = false; std::wstring m_replacementInstallerArguments = L""; std::wstring m_additionalInstallerArguments = L""; std::wstring m_correlationData = L""; From 8ab5cdc11e1e8739de5625e9f64777f9c98fdb4b Mon Sep 17 00:00:00 2001 From: Paul Yim Date: Wed, 29 Mar 2023 13:52:21 -0700 Subject: [PATCH 5/9] Fixing tests --- src/AppInstallerCLITests/InstallFlow.cpp | 2 +- src/AppInstallerCLITests/WorkflowCommon.cpp | 30 ++++++--------------- src/AppInstallerCLITests/WorkflowCommon.h | 2 +- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/AppInstallerCLITests/InstallFlow.cpp b/src/AppInstallerCLITests/InstallFlow.cpp index ab219fd716..5d6d1c8d1c 100644 --- a/src/AppInstallerCLITests/InstallFlow.cpp +++ b/src/AppInstallerCLITests/InstallFlow.cpp @@ -592,7 +592,7 @@ TEST_CASE("MSStoreInstallFlowWithStoreDisabledBypassStoreClientBlockedByPolicy", std::ostringstream installOutput; TestContext context{ installOutput, std::cin }; auto previousThreadGlobals = context.SetForCurrentThread(); - OverrideForMSStoreWithEnsureStorePolicySatisfied(context, false); + OverrideForMSStoreWithEnsureStorePolicySatisfied(context); // Disable the store client app and verify std::wstring disableStoreSubKey = L"RemoveWindowsStore"; diff --git a/src/AppInstallerCLITests/WorkflowCommon.cpp b/src/AppInstallerCLITests/WorkflowCommon.cpp index 412df155cd..d05e9c9e3e 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.cpp +++ b/src/AppInstallerCLITests/WorkflowCommon.cpp @@ -676,30 +676,16 @@ namespace TestCommon { } }); } - void OverrideForMSStoreWithEnsureStorePolicySatisfied(TestContext& context, bool isUpdate) + void OverrideForMSStoreWithEnsureStorePolicySatisfied(TestContext& context) { - if (isUpdate) - { - context.Override({ MSStoreUpdate, [](TestContext& context) - { - std::filesystem::path temp = std::filesystem::temp_directory_path(); - temp /= "TestMSStoreUpdated.txt"; - std::ofstream file(temp, std::ofstream::out); - file << context.Get()->ProductId; - file.close(); - } }); - } - else + context.Override({ MSStoreInstall, [](TestContext& context) { - context.Override({ MSStoreInstall, [](TestContext& context) - { - std::filesystem::path temp = std::filesystem::temp_directory_path(); - temp /= "TestMSStoreInstalled.txt"; - std::ofstream file(temp, std::ofstream::out); - file << context.Get()->ProductId; - file.close(); - } }); - } + std::filesystem::path temp = std::filesystem::temp_directory_path(); + temp /= "TestMSStoreInstalled.txt"; + std::ofstream file(temp, std::ofstream::out); + file << context.Get()->ProductId; + file.close(); + } }); } } \ No newline at end of file diff --git a/src/AppInstallerCLITests/WorkflowCommon.h b/src/AppInstallerCLITests/WorkflowCommon.h index 7f1266522a..442f1038db 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.h +++ b/src/AppInstallerCLITests/WorkflowCommon.h @@ -133,6 +133,6 @@ namespace TestCommon void OverrideForMSStore(TestContext& context, bool isUpdate); - void OverrideForMSStoreWithEnsureStorePolicySatisfied(TestContext& context, bool isUpdate); + void OverrideForMSStoreWithEnsureStorePolicySatisfied(TestContext& context); } \ No newline at end of file From a52b056a4c5f5cd189e4697cd713bd1ab63c5ea3 Mon Sep 17 00:00:00 2001 From: Paul Yim Date: Wed, 29 Mar 2023 17:55:37 -0700 Subject: [PATCH 6/9] fixing tests --- src/AppInstallerCLITests/InstallFlow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AppInstallerCLITests/InstallFlow.cpp b/src/AppInstallerCLITests/InstallFlow.cpp index 5d6d1c8d1c..7262b21124 100644 --- a/src/AppInstallerCLITests/InstallFlow.cpp +++ b/src/AppInstallerCLITests/InstallFlow.cpp @@ -553,7 +553,7 @@ TEST_CASE("MSStoreInstallFlowWithStoreDisabled", "[InstallFlow][workflow]") // Disable the store client app and verify std::wstring disableStoreSubKey = L"RemoveWindowsStore"; wil::unique_hkey result; - RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &result); + RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, nullptr, REG_OPTION_VOLATILE, KEY_ALL_ACCESS | KEY_WOW64_64KEY, nullptr, &result, nullptr); SetRegistryValue(result.get(), disableStoreSubKey, 1); AppInstaller::Registry::Key key{ result.get(), L"" }; @@ -597,7 +597,7 @@ TEST_CASE("MSStoreInstallFlowWithStoreDisabledBypassStoreClientBlockedByPolicy", // Disable the store client app and verify std::wstring disableStoreSubKey = L"RemoveWindowsStore"; wil::unique_hkey result; - RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &result); + RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, nullptr, REG_OPTION_VOLATILE, KEY_ALL_ACCESS | KEY_WOW64_64KEY, nullptr, &result, nullptr); SetRegistryValue(result.get(), disableStoreSubKey, 1); AppInstaller::Registry::Key key{ result.get(), L"" }; From c0841fdc52e717cbe08c7a9c0232e2f4d4db4817 Mon Sep 17 00:00:00 2001 From: Paul Yim Date: Thu, 30 Mar 2023 17:02:35 -0700 Subject: [PATCH 7/9] Fixing tests --- src/AppInstallerCLITests/InstallFlow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AppInstallerCLITests/InstallFlow.cpp b/src/AppInstallerCLITests/InstallFlow.cpp index 7262b21124..326139a773 100644 --- a/src/AppInstallerCLITests/InstallFlow.cpp +++ b/src/AppInstallerCLITests/InstallFlow.cpp @@ -553,7 +553,7 @@ TEST_CASE("MSStoreInstallFlowWithStoreDisabled", "[InstallFlow][workflow]") // Disable the store client app and verify std::wstring disableStoreSubKey = L"RemoveWindowsStore"; wil::unique_hkey result; - RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, nullptr, REG_OPTION_VOLATILE, KEY_ALL_ACCESS | KEY_WOW64_64KEY, nullptr, &result, nullptr); + THROW_IF_WIN32_ERROR(RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, nullptr, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, nullptr, &result, nullptr)); SetRegistryValue(result.get(), disableStoreSubKey, 1); AppInstaller::Registry::Key key{ result.get(), L"" }; @@ -597,7 +597,7 @@ TEST_CASE("MSStoreInstallFlowWithStoreDisabledBypassStoreClientBlockedByPolicy", // Disable the store client app and verify std::wstring disableStoreSubKey = L"RemoveWindowsStore"; wil::unique_hkey result; - RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, nullptr, REG_OPTION_VOLATILE, KEY_ALL_ACCESS | KEY_WOW64_64KEY, nullptr, &result, nullptr); + THROW_IF_WIN32_ERROR(RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, nullptr, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, nullptr, &result, nullptr)); SetRegistryValue(result.get(), disableStoreSubKey, 1); AppInstaller::Registry::Key key{ result.get(), L"" }; From 842d052a36295272c8ee3d1af2c5736ead3ce146 Mon Sep 17 00:00:00 2001 From: Paul Yim Date: Thu, 30 Mar 2023 20:54:39 -0700 Subject: [PATCH 8/9] Removing tests due to build server errors --- src/AppInstallerCLITests/InstallFlow.cpp | 90 --------------------- src/AppInstallerCLITests/WorkflowCommon.cpp | 12 --- src/AppInstallerCLITests/WorkflowCommon.h | 3 - 3 files changed, 105 deletions(-) diff --git a/src/AppInstallerCLITests/InstallFlow.cpp b/src/AppInstallerCLITests/InstallFlow.cpp index 326139a773..e66e2682ef 100644 --- a/src/AppInstallerCLITests/InstallFlow.cpp +++ b/src/AppInstallerCLITests/InstallFlow.cpp @@ -536,96 +536,6 @@ TEST_CASE("MSStoreInstallFlowWithTestManifest", "[InstallFlow][workflow]") REQUIRE(installResultStr.find("9WZDNCRFJ364") != std::string::npos); } -TEST_CASE("MSStoreInstallFlowWithStoreDisabled", "[InstallFlow][workflow]") -{ - if (!AppInstaller::Runtime::IsRunningAsAdmin()) - { - WARN("Test requires admin privilege. Skipped."); - return; - } - - TestCommon::TempFile installResultPath("TestMSStoreInstalled.txt"); - - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); - - // Disable the store client app and verify - std::wstring disableStoreSubKey = L"RemoveWindowsStore"; - wil::unique_hkey result; - THROW_IF_WIN32_ERROR(RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, nullptr, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, nullptr, &result, nullptr)); - SetRegistryValue(result.get(), disableStoreSubKey, 1); - - AppInstaller::Registry::Key key{ result.get(), L"" }; - std::optional value = key[disableStoreSubKey]; - REQUIRE(value); - REQUIRE(value->GetValue() == 1); - - context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("InstallFlowTest_MSStore.yaml").GetPath().u8string()); - - InstallCommand install({}); - install.Execute(context); - INFO(installOutput.str()); - - // Verify installation failed - REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_MSSTORE_BLOCKED_BY_POLICY); - REQUIRE_FALSE(std::filesystem::exists(installResultPath.GetPath())); - REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::MSStoreStoreClientBlocked).get()) != std::string::npos); - - // Enable store client app and verify - SetRegistryValue(result.get(), disableStoreSubKey, 0); - - value = key[disableStoreSubKey]; - REQUIRE(value->GetValue() == 0); -} - -TEST_CASE("MSStoreInstallFlowWithStoreDisabledBypassStoreClientBlockedByPolicy", "[InstallFlow][workflow]") -{ - if (!AppInstaller::Runtime::IsRunningAsAdmin()) - { - WARN("Test requires admin privilege. Skipped."); - return; - } - - TestCommon::TempFile installResultPath("TestMSStoreInstalled.txt"); - - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); - OverrideForMSStoreWithEnsureStorePolicySatisfied(context); - - // Disable the store client app and verify - std::wstring disableStoreSubKey = L"RemoveWindowsStore"; - wil::unique_hkey result; - THROW_IF_WIN32_ERROR(RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\WindowsStore", 0, nullptr, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, nullptr, &result, nullptr)); - SetRegistryValue(result.get(), disableStoreSubKey, 1); - - AppInstaller::Registry::Key key{ result.get(), L"" }; - std::optional value = key[disableStoreSubKey]; - REQUIRE(value); - REQUIRE(value->GetValue() == 1); - - context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("InstallFlowTest_MSStore.yaml").GetPath().u8string()); - context.SetFlags(Execution::ContextFlag::BypassIsStoreClientBlockedPolicyCheck); - - InstallCommand install({}); - install.Execute(context); - INFO(installOutput.str()); - - // Verify Installer is called and parameters are passed in. - REQUIRE(std::filesystem::exists(installResultPath.GetPath())); - std::ifstream installResultFile(installResultPath.GetPath()); - REQUIRE(installResultFile.is_open()); - std::string installResultStr; - std::getline(installResultFile, installResultStr); - REQUIRE(installResultStr.find("9WZDNCRFJ364") != std::string::npos); - - // Enable store client app and verify - SetRegistryValue(result.get(), disableStoreSubKey, 0); - value = key[disableStoreSubKey]; - REQUIRE(value->GetValue() == 0); -} - TEST_CASE("MsixInstallFlow_DownloadFlow", "[InstallFlow][workflow]") { TestCommon::TempFile installResultPath("TestMsixInstalled.txt"); diff --git a/src/AppInstallerCLITests/WorkflowCommon.cpp b/src/AppInstallerCLITests/WorkflowCommon.cpp index d05e9c9e3e..bdb96d8d54 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.cpp +++ b/src/AppInstallerCLITests/WorkflowCommon.cpp @@ -676,16 +676,4 @@ namespace TestCommon { } }); } - void OverrideForMSStoreWithEnsureStorePolicySatisfied(TestContext& context) - { - context.Override({ MSStoreInstall, [](TestContext& context) - { - std::filesystem::path temp = std::filesystem::temp_directory_path(); - temp /= "TestMSStoreInstalled.txt"; - std::ofstream file(temp, std::ofstream::out); - file << context.Get()->ProductId; - file.close(); - } }); - } - } \ No newline at end of file diff --git a/src/AppInstallerCLITests/WorkflowCommon.h b/src/AppInstallerCLITests/WorkflowCommon.h index 442f1038db..f7b256adef 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.h +++ b/src/AppInstallerCLITests/WorkflowCommon.h @@ -132,7 +132,4 @@ namespace TestCommon void OverrideForMSIX(TestContext& context); void OverrideForMSStore(TestContext& context, bool isUpdate); - - void OverrideForMSStoreWithEnsureStorePolicySatisfied(TestContext& context); - } \ No newline at end of file From 455b121017e94a24bd56029a13462f28920da58d Mon Sep 17 00:00:00 2001 From: Paul Yim Date: Thu, 30 Mar 2023 20:58:43 -0700 Subject: [PATCH 9/9] reverting white space changes --- src/AppInstallerCLITests/WorkflowCommon.cpp | 3 ++- src/AppInstallerCLITests/WorkflowCommon.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/AppInstallerCLITests/WorkflowCommon.cpp b/src/AppInstallerCLITests/WorkflowCommon.cpp index bdb96d8d54..de8cc4144e 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.cpp +++ b/src/AppInstallerCLITests/WorkflowCommon.cpp @@ -662,7 +662,7 @@ namespace TestCommon } else { - context.Override({ MSStoreInstall, [](TestContext& context) + context.Override({ MSStoreInstall, [](TestContext& context) { std::filesystem::path temp = std::filesystem::temp_directory_path(); temp /= "TestMSStoreInstalled.txt"; @@ -676,4 +676,5 @@ namespace TestCommon { } }); } + } \ No newline at end of file diff --git a/src/AppInstallerCLITests/WorkflowCommon.h b/src/AppInstallerCLITests/WorkflowCommon.h index f7b256adef..8ff394806a 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.h +++ b/src/AppInstallerCLITests/WorkflowCommon.h @@ -129,7 +129,8 @@ namespace TestCommon void OverrideForVerifyAndSetNestedInstaller(TestContext& context); - void OverrideForMSIX(TestContext& context); + void OverrideForMSIX(TestContext& context); void OverrideForMSStore(TestContext& context, bool isUpdate); + } \ No newline at end of file