blob: 9e1ee385cb7245e5e040ad10b6fbbd6b2f5d6d03 [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/updater/installer.h"
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/strings/strcat.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/mac/install_from_archive.h"
namespace updater {
Installer::Result Installer::RunApplicationInstaller(
const base::FilePath& app_installer,
const std::string& arguments,
ProgressCallback /*progress_callback*/) {
DVLOG(1) << "Running application install from DMG";
// InstallFromArchive() returns the exit code of the script. 0 is success and
// anything else should be an error.
const int exit_code =
InstallFromArchive(app_installer, checker_path_,
base::StrCat({pv_.GetString(), " ", arguments}));
return exit_code == 0 ? Result()
: Result(kErrorApplicationInstallerFailed, exit_code);
}
} // namespace updater