Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ namespace AppInstaller::CLI::Workflow
{
context.Reporter.Info() << "Installing ..." << std::endl;

const auto& installer = context.Get<Execution::Data::Installer>();
const std::string& installerArgs = context.Get<Execution::Data::InstallerArgs>();

auto installResult = context.Reporter.ExecuteWithProgress(
Expand All @@ -151,7 +152,7 @@ namespace AppInstaller::CLI::Workflow
context.Reporter.Warn() << "Installation abandoned" << std::endl;
AICLI_TERMINATE_CONTEXT(E_ABORT);
}
else if (installResult.value() != 0)
else if (installResult.value() != installer->SuccessExitCode)
{
const auto& manifest = context.Get<Execution::Data::Manifest>();
Logging::Telemetry().LogInstallerFailure(manifest.Id, manifest.Version, manifest.Channel, "ShellExecute", installResult.value());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace AppInstaller::Manifest
YAML::Node switchesNode;
this->InstallerType = defaultInstaller.InstallerType;
this->Scope = "user";
this->SuccessExitCode = 0;

std::vector<ManifestFieldInfo> fieldInfos;

Expand All @@ -30,6 +31,7 @@ namespace AppInstaller::Manifest
{ "Scope", [this](const YAML::Node& value) { Scope = value.as<std::string>(); } },
{ "InstallerType", [this](const YAML::Node& value) { InstallerType = ConvertToInstallerTypeEnum(value.as<std::string>()); } },
{ "Switches", [&](const YAML::Node& value) { switchesNode = value; } },
{ "SuccessExitCode", [&](const YAML::Node& value) { SuccessExitCode = value.as<DWORD>(); } },
};

std::move(previewFieldInfos.begin(), previewFieldInfos.end(), std::inserter(fieldInfos, fieldInfos.end()));
Expand Down
3 changes: 3 additions & 0 deletions src/AppInstallerRepositoryCore/Manifest/ManifestInstaller.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ namespace AppInstaller::Manifest
// If present, has more precedence than root
std::map<InstallerSwitchType, string_t> Switches;

// Optional. Default is zero.
DWORD SuccessExitCode;

static InstallerTypeEnum ConvertToInstallerTypeEnum(const std::string& in);

static std::map<InstallerSwitchType, string_t> GetDefaultKnownSwitches(InstallerTypeEnum installerType);
Expand Down