summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/installer')
-rwxr-xr-xchrome/installer/setup/main.cc32
-rwxr-xr-xchrome/installer/setup/setup.cc6
2 files changed, 20 insertions, 18 deletions
diff --git a/chrome/installer/setup/main.cc b/chrome/installer/setup/main.cc
index 5307c1c..e888f0b 100755
--- a/chrome/installer/setup/main.cc
+++ b/chrome/installer/setup/main.cc
@@ -369,23 +369,31 @@ installer_util::InstallStatus InstallChrome(const CommandLine& cmd_line,
install_status = installer::InstallOrUpdateChrome(
cmd_line.program(), archive_to_copy, temp_path, options,
*installer_version, installed_version);
+
+ int install_msg_base = IDS_INSTALL_FAILED_BASE;
+ std::wstring chrome_exe;
+ if (install_status != installer_util::INSTALL_FAILED) {
+ chrome_exe = installer::GetChromeInstallPath(system_install);
+ if (chrome_exe.empty()) {
+ // If we failed to construct install path, it means the OS call to
+ // get %ProgramFiles% or %AppData% failed. Report this as failure.
+ install_msg_base = IDS_INSTALL_OS_ERROR_BASE;
+ install_status = installer_util::OS_ERROR;
+ } else {
+ file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe);
+ chrome_exe = L"\"" + chrome_exe + L"\"";
+ install_msg_base = 0;
+ }
+ }
+ InstallUtil::WriteInstallerResult(system_install, install_status,
+ install_msg_base, &chrome_exe);
if (install_status == installer_util::FIRST_INSTALL_SUCCESS) {
LOG(INFO) << "First install successful.";
CopyPreferenceFileForFirstRun(options, cmd_line);
// We never want to launch Chrome in system level install mode.
- if ((options & installer_util::DO_NOT_LAUNCH_CHROME) ||
- (options & installer_util::SYSTEM_LEVEL)) {
- std::wstring chrome_exe =
- installer::GetChromeInstallPath(system_install);
- if (!chrome_exe.empty()) {
- file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe);
- chrome_exe = L"\"" + chrome_exe + L"\"";
- InstallUtil::WriteInstallerResult(system_install, install_status,
- 0, &chrome_exe);
- }
- } else {
+ if (!(options & installer_util::DO_NOT_LAUNCH_CHROME) &&
+ !(options & installer_util::SYSTEM_LEVEL))
installer::LaunchChrome(system_install);
- }
} else if (install_status == installer_util::NEW_VERSION_UPDATED) {
// This is temporary hack and will be deleted after one release.
UpdateChromeOpenCmd(system_install);
diff --git a/chrome/installer/setup/setup.cc b/chrome/installer/setup/setup.cc
index b5d0ea8..27475242 100755
--- a/chrome/installer/setup/setup.cc
+++ b/chrome/installer/setup/setup.cc
@@ -198,9 +198,6 @@ installer_util::InstallStatus installer::InstallOrUpdateChrome(
std::wstring install_path(GetChromeInstallPath(system_install));
if (install_path.empty()) {
LOG(ERROR) << "Could not get installation destination path.";
- InstallUtil::WriteInstallerResult(system_install,
- installer_util::INSTALL_FAILED,
- IDS_INSTALL_FAILED_BASE, NULL);
return installer_util::INSTALL_FAILED;
} else {
LOG(INFO) << "install destination path: " << install_path;
@@ -217,9 +214,6 @@ installer_util::InstallStatus installer::InstallOrUpdateChrome(
installer_util::InstallStatus result;
if (!install_success) {
LOG(ERROR) << "Install failed.";
- InstallUtil::WriteInstallerResult(system_install,
- installer_util::INSTALL_FAILED,
- IDS_INSTALL_FAILED_BASE, NULL);
result = installer_util::INSTALL_FAILED;
} else {
if (!installed_version) {