summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-15 00:51:16 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-15 00:51:16 +0000
commit140842a9b3410cba8b48a3f933b2d9779f413cd5 (patch)
treee6bf7c222948a209e4e1be803241a75d419edd2d /chrome/installer
parenta42e17147a581df63c1da69ab6bd645119915b4c (diff)
downloadchromium_src-140842a9b3410cba8b48a3f933b2d9779f413cd5.zip
chromium_src-140842a9b3410cba8b48a3f933b2d9779f413cd5.tar.gz
chromium_src-140842a9b3410cba8b48a3f933b2d9779f413cd5.tar.bz2
Write installer success result to the registry even for user level installs.
BUG=1549439 Review URL: http://codereview.chromium.org/18249 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8056 0039d316-1c4b-4281-b951-d872f2087c98
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) {