diff options
author | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-05 03:13:33 +0000 |
---|---|---|
committer | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-05 03:13:33 +0000 |
commit | a6ea126034ade23d94df94e2b105538152f6d86e (patch) | |
tree | 24b3059668f27f4a2e29fca025f77eefe14987a5 /chrome/installer/util/install_util.cc | |
parent | 269bb3a69e402a893bc8d01a99347c7ef6a5a38a (diff) | |
download | chromium_src-a6ea126034ade23d94df94e2b105538152f6d86e.zip chromium_src-a6ea126034ade23d94df94e2b105538152f6d86e.tar.gz chromium_src-a6ea126034ade23d94df94e2b105538152f6d86e.tar.bz2 |
- WriteInstallerResult is now back in InstallUtil and only writes the result where it is needed
- WriteInstallerResult is no longer called on uninstall (Google Update doesn't check it on uninstall)
- Introduced the poorly named InstallationState (state of the system based on registry inspection) and InstallerState (state of the current operation) classes
- Product::GetInstalledVersion and Product::IsInstalled are gone; use InstallationState instead
- A few cleanups to make the code comply with the style guide
- UpdateDiffInstallStatus has been renamed to UpdateInstallStatus
- Chromium builds noop in UpdateInstallStatus (this was always the case for the browser, but now also is for GCF and the multi-installer package).
- The -multifail suffixes is now added to/removed from the Google Update "ap" value by UpdateInstallStatus on the basis of multi-install success/failure.
- Added code to update the Google Update "ap" value based on the set up products/options installed
- ChannelInfo is now an ordered list of modifiers and suffixes. We're careful to keep -full at the end since that was an operating assumption previously.
- ActivePackageProperties is a typedef to either the Chrome or Chromium PackageProperties class
TEST=Some existing unit tests updated; more new unit tests to follow.
BUG=61609
Review URL: http://codereview.chromium.org/5988007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/install_util.cc')
-rw-r--r-- | chrome/installer/util/install_util.cc | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index 2592429..2223b15 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -34,7 +34,7 @@ using installer::MasterPreferences; bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) { FilePath::StringType program(cmd.GetProgram().value()); DCHECK(!program.empty()); - DCHECK(program[0] != '\"'); + DCHECK_NE(program[0], L'\"'); CommandLine::StringType params(cmd.command_line_string()); if (params[0] == '"') { @@ -110,6 +110,34 @@ bool InstallUtil::IsOSSupported() { (version == base::win::VERSION_XP && major >= 2); } +void InstallUtil::WriteInstallerResult(bool system_install, + const std::wstring& state_key, + installer::InstallStatus status, + int string_resource_id, + const std::wstring* const launch_cmd) { + const HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; + int installer_result = (GetInstallReturnCode(status) == 0) ? 0 : 1; + scoped_ptr<WorkItemList> install_list(WorkItem::CreateWorkItemList()); + install_list->AddCreateRegKeyWorkItem(root, state_key); + install_list->AddSetRegValueWorkItem(root, state_key, + installer::kInstallerResult, + installer_result, true); + install_list->AddSetRegValueWorkItem(root, state_key, + installer::kInstallerError, status, + true); + if (string_resource_id != 0) { + std::wstring msg = installer::GetLocalizedString(string_resource_id); + install_list->AddSetRegValueWorkItem(root, state_key, + installer::kInstallerResultUIString, msg, true); + } + if (launch_cmd != NULL && !launch_cmd->empty()) { + install_list->AddSetRegValueWorkItem(root, state_key, + installer::kInstallerSuccessLaunchCmdLine, *launch_cmd, true); + } + if (!install_list->Do()) + LOG(ERROR) << "Failed to record installer error information in registry."; +} + bool InstallUtil::IsPerUserInstall(const wchar_t* const exe_path) { wchar_t program_files_path[MAX_PATH] = {0}; if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, |