Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/AppInstallerCLICore/ExecutionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ namespace AppInstaller::CLI::Execution
RebootRequired = 0x400,
RegisterResume = 0x800,
InstallerExecutionUseRepair = 0x1000,
// InstallPackageInstaller: suppress immediate success until post-install checks complete.
DeferInstallSuccessMessage = 0x2000,
// MSIX registration deferred: do not emit generic success after checks (warning already shown).
SuppressDeferredInstallSuccess = 0x4000,
// Set when an install would have reported success but output was deferred.
PendingDeferredInstallSuccess = 0x8000,
};

DEFINE_ENUM_FLAG_OPERATORS(ContextFlag);
Expand Down
52 changes: 51 additions & 1 deletion src/AppInstallerCLICore/Workflows/InstallFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ namespace AppInstaller::CLI::Workflow
if (registrationDeferred)
{
context.Reporter.Warn() << Resource::String::InstallFlowRegistrationDeferred << std::endl;
if (WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::DeferInstallSuccessMessage))
{
context.SetFlags(Execution::ContextFlag::SuppressDeferredInstallSuccess);
}
}
else if (WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::DeferInstallSuccessMessage))
{
context.SetFlags(Execution::ContextFlag::PendingDeferredInstallSuccess);
}
else
{
Expand Down Expand Up @@ -575,7 +583,11 @@ namespace AppInstaller::CLI::Workflow
}
else
{
if (isRepair)
if (WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::DeferInstallSuccessMessage))
{
context.SetFlags(Execution::ContextFlag::PendingDeferredInstallSuccess);
}
else if (isRepair)
{
context.Reporter.Info() << Resource::String::RepairFlowRepairSuccess << std::endl;
}
Expand All @@ -586,6 +598,40 @@ namespace AppInstaller::CLI::Workflow
}
}

void ReportDeferredInstallSuccess(Execution::Context& context)
{
if (!WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::DeferInstallSuccessMessage))
{
return;
}
context.ClearFlags(Execution::ContextFlag::DeferInstallSuccessMessage);
if (WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::SuppressDeferredInstallSuccess))
{
context.ClearFlags(Execution::ContextFlag::SuppressDeferredInstallSuccess);
context.ClearFlags(Execution::ContextFlag::PendingDeferredInstallSuccess);
return;
}
if (context.IsTerminated())
{
context.ClearFlags(Execution::ContextFlag::PendingDeferredInstallSuccess);
return;
}
if (!WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::PendingDeferredInstallSuccess))
{
return;
}
context.ClearFlags(Execution::ContextFlag::PendingDeferredInstallSuccess);
const bool isRepair = WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::InstallerExecutionUseRepair);
if (isRepair)
{
context.Reporter.Info() << Resource::String::RepairFlowRepairSuccess << std::endl;
}
else
{
context.Reporter.Info() << Resource::String::InstallFlowInstallSuccess << std::endl;
}
}

void ReportIdentityAndInstallationDisclaimer(Execution::Context& context)
{
context <<
Expand All @@ -595,6 +641,9 @@ namespace AppInstaller::CLI::Workflow

void InstallPackageInstaller(Execution::Context& context)
{
context.ClearFlags(
Execution::ContextFlag::PendingDeferredInstallSuccess | Execution::ContextFlag::SuppressDeferredInstallSuccess);
context.SetFlags(Execution::ContextFlag::DeferInstallSuccessMessage);
context <<
Workflow::ReportExecutionStage(ExecutionStage::PreExecution) <<
Workflow::SnapshotARPEntries <<
Expand All @@ -606,6 +655,7 @@ namespace AppInstaller::CLI::Workflow
Workflow::ForceInstalledCacheUpdate <<
Workflow::RemoveInstaller <<
Workflow::DisplayInstallationNotes;
ReportDeferredInstallSuccess(context);
}

void InstallDependencies(Execution::Context& context)
Expand Down
3 changes: 3 additions & 0 deletions src/AppInstallerCLICore/Workflows/InstallFlow.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ namespace AppInstaller::CLI::Workflow
// Inputs: InstallerPath, Manifest, Installer, PackageVersion, InstalledPackageVersion?
// Outputs: None
void InstallPackageInstaller(Execution::Context& context);

// Emits deferred install/repair success after post-install steps (ARP verification, etc.).
void ReportDeferredInstallSuccess(Execution::Context& context);

// Installs the dependencies for a specific package. CreateDependencySubContexts should have been called before this task.
// Required Args: None
Expand Down
28 changes: 25 additions & 3 deletions src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "pch.h"
#include "MSStoreInstallerHandler.h"
#include "WorkflowBase.h"
#include "ExecutionContext.h"
#include <AppInstallerSHA256.h>
#include <AppInstallerDownloader.h>
#include <AppInstallerRuntime.h>
Expand Down Expand Up @@ -159,7 +160,14 @@ namespace AppInstaller::CLI::Workflow

if (SUCCEEDED(hr))
{
context.Reporter.Info() << Resource::String::InstallFlowInstallSuccess << std::endl;
if (WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::DeferInstallSuccessMessage))
{
context.SetFlags(Execution::ContextFlag::PendingDeferredInstallSuccess);
}
else
{
context.Reporter.Info() << Resource::String::InstallFlowInstallSuccess << std::endl;
}
}
else
{
Expand Down Expand Up @@ -200,7 +208,14 @@ namespace AppInstaller::CLI::Workflow

if (SUCCEEDED(hr))
{
context.Reporter.Info() << Resource::String::InstallFlowInstallSuccess << std::endl;
if (WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::DeferInstallSuccessMessage))
{
context.SetFlags(Execution::ContextFlag::PendingDeferredInstallSuccess);
}
else
{
context.Reporter.Info() << Resource::String::InstallFlowInstallSuccess << std::endl;
}
}
else
{
Expand Down Expand Up @@ -241,7 +256,14 @@ namespace AppInstaller::CLI::Workflow

if (SUCCEEDED(hr))
{
context.Reporter.Info() << Resource::String::RepairFlowRepairSuccess << std::endl;
if (WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::DeferInstallSuccessMessage))
{
context.SetFlags(Execution::ContextFlag::PendingDeferredInstallSuccess);
}
else
{
context.Reporter.Info() << Resource::String::RepairFlowRepairSuccess << std::endl;
}
}
else
{
Expand Down
Loading