diff options
author | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 16:20:18 +0000 |
---|---|---|
committer | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 16:20:18 +0000 |
commit | b08bd73ea5e7de0a09dd4676271683b564d01bde (patch) | |
tree | 0b41c37c805bed4bcb44bc404512e6b8a8e3decc /chrome/installer/mini_installer | |
parent | 6a7aa33a9cf09eb8b034c420a225a0b1a96e44f0 (diff) | |
download | chromium_src-b08bd73ea5e7de0a09dd4676271683b564d01bde.zip chromium_src-b08bd73ea5e7de0a09dd4676271683b564d01bde.tar.gz chromium_src-b08bd73ea5e7de0a09dd4676271683b564d01bde.tar.bz2 |
Write installer results in all relevant registry keys so that we're sure that Google Update will pick them up regardless of which one it happens to be monitoring.
BUG=none
TEST=Google Update continues to properly report install errors to its servers.
Review URL: http://codereview.chromium.org/7036017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/mini_installer')
-rw-r--r-- | chrome/installer/mini_installer/mini_installer.cc | 78 |
1 files changed, 42 insertions, 36 deletions
diff --git a/chrome/installer/mini_installer/mini_installer.cc b/chrome/installer/mini_installer/mini_installer.cc index 515e0d4..c74738a 100644 --- a/chrome/installer/mini_installer/mini_installer.cc +++ b/chrome/installer/mini_installer/mini_installer.cc @@ -305,6 +305,42 @@ bool RunProcessAndWait(const wchar_t* exe_path, wchar_t* cmdline, return ret; } +// Append any command line params passed to mini_installer to the given buffer +// so that they can be passed on to setup.exe. We do not return any error from +// this method and simply skip making any changes in case of error. +void AppendCommandLineFlags(CommandString* buffer) { + PathString full_exe_path; + size_t len = ::GetModuleFileName(NULL, full_exe_path.get(), + full_exe_path.capacity()); + if (!len || len >= full_exe_path.capacity()) + return; + + const wchar_t* exe_name = GetNameFromPathExt(full_exe_path.get(), len); + if (exe_name == NULL) + return; + + int args_num; + wchar_t* cmd_line = ::GetCommandLine(); + wchar_t** args = ::CommandLineToArgvW(cmd_line, &args_num); + if (args_num <= 0) + return; + + const wchar_t* cmd_to_append = L""; + if (!StrEndsWith(args[0], exe_name)) { + // Current executable name not in the command line so just append + // the whole command line. + cmd_to_append = cmd_line; + } else if (args_num > 1) { + const wchar_t* tmp = SearchStringI(cmd_line, exe_name); + tmp = SearchStringI(tmp, L" "); + cmd_to_append = tmp; + } + + buffer->append(cmd_to_append); + + LocalFree(args); +} + // Windows defined callback used in the EnumResourceNames call. For each // matching resource found, the callback is invoked and at this point we write @@ -395,6 +431,12 @@ bool UnpackBinaryResources(HMODULE module, const wchar_t* base_path, success = false; } + // Get any command line option specified for mini_installer and pass them + // on to setup.exe. This is important since switches such as + // --multi-install and --chrome-frame affect where setup.exe will write + // installer results for consumption by Google Update. + AppendCommandLineFlags(&cmd_line); + int exit_code = 0; if (success && (!RunProcessAndWait(NULL, cmd_line.get(), &exit_code) || @@ -455,42 +497,6 @@ bool UnpackBinaryResources(HMODULE module, const wchar_t* base_path, return setup_path->length() > 0; } -// Append any command line params passed to mini_installer to the given buffer -// so that they can be passed on to setup.exe. We do not return any error from -// this method and simply skip making any changes in case of error. -void AppendCommandLineFlags(CommandString* buffer) { - PathString full_exe_path; - size_t len = ::GetModuleFileName(NULL, full_exe_path.get(), - full_exe_path.capacity()); - if (!len || len >= full_exe_path.capacity()) - return; - - const wchar_t* exe_name = GetNameFromPathExt(full_exe_path.get(), len); - if (exe_name == NULL) - return; - - int args_num; - wchar_t* cmd_line = ::GetCommandLine(); - wchar_t** args = ::CommandLineToArgvW(cmd_line, &args_num); - if (args_num <= 0) - return; - - const wchar_t* cmd_to_append = L""; - if (!StrEndsWith(args[0], exe_name)) { - // Current executable name not in the command line so just append - // the whole command line. - cmd_to_append = cmd_line; - } else if (args_num > 1) { - const wchar_t* tmp = SearchStringI(cmd_line, exe_name); - tmp = SearchStringI(tmp, L" "); - cmd_to_append = tmp; - } - - buffer->append(cmd_to_append); - - LocalFree(args); -} - // Executes setup.exe, waits for it to finish and returns the exit code. bool RunSetup(const wchar_t* archive_path, const wchar_t* setup_path, int* exit_code) { |