blob: def4e171b791d35ca59dc94d07e4289f52daf0d9 [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2012 The Chromium Authors
[email protected]bc38c252011-04-12 21:46:572// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Daniel Cheng7d9e3d52022-02-26 09:03:245#include "chrome/browser/first_run/upgrade_util_win.h"
[email protected]bc38c252011-04-12 21:46:576
Takuto Ikutac8d6b16f2024-04-15 16:59:197#include <objbase.h>
8
[email protected]770c6d82012-09-06 22:21:329#include <windows.h>
Nico Webereaa08412019-08-14 01:24:3710
[email protected]fdbea98d2014-05-16 19:29:2011#include <psapi.h>
[email protected]770c6d82012-09-06 22:21:3212#include <shellapi.h>
Robert Liaob2bc703d2017-10-17 20:52:3513#include <wrl/client.h>
[email protected]770c6d82012-09-06 22:21:3214
[email protected]bc38c252011-04-12 21:46:5715#include <algorithm>
Greg Thompsona1f95122019-01-31 22:46:4516#include <ios>
[email protected]bc38c252011-04-12 21:46:5717#include <string>
18
19#include "base/base_paths.h"
Etienne Bergeron7a0ef612023-09-15 18:28:0820#include "base/check.h"
[email protected]bc38c252011-04-12 21:46:5721#include "base/command_line.h"
[email protected]57999812013-02-24 05:40:5222#include "base/files/file_path.h"
thestig18dfb7a52014-08-26 10:44:0423#include "base/files/file_util.h"
S. Ganeshcad45032024-07-18 17:43:1124#include "base/functional/bind.h"
S. Ganesh6822d2a2025-03-31 20:26:4825#include "base/functional/function_ref.h"
[email protected]bc38c252011-04-12 21:46:5726#include "base/logging.h"
S. Ganeshcad45032024-07-18 17:43:1127#include "base/memory/ref_counted.h"
28#include "base/memory/scoped_refptr.h"
S. Ganesh48540862024-08-12 18:09:3929#include "base/metrics/histogram_functions.h"
[email protected]bc38c252011-04-12 21:46:5730#include "base/path_service.h"
[email protected]d09a4ce1c2013-07-24 17:37:0231#include "base/process/launch.h"
32#include "base/process/process_handle.h"
[email protected]3ea1b182013-02-08 22:38:4133#include "base/strings/string_number_conversions.h"
[email protected]d8830562013-06-10 22:01:5434#include "base/strings/string_util.h"
S. Ganeshcad45032024-07-18 17:43:1135#include "base/synchronization/waitable_event.h"
S. Ganeshbb1d4fc2024-08-14 19:16:3236#include "base/system/sys_info.h"
S. Ganeshcad45032024-07-18 17:43:1137#include "base/task/sequenced_task_runner.h"
38#include "base/task/task_traits.h"
39#include "base/task/thread_pool.h"
S. Ganesh6822d2a2025-03-31 20:26:4840#include "base/threading/platform_thread.h"
Gabriel Charette12b58ac2021-09-22 18:08:5541#include "base/time/time.h"
S. Ganesh48540862024-08-12 18:09:3942#include "base/timer/elapsed_timer.h"
Gabriel Charette12b58ac2021-09-22 18:08:5543#include "base/trace_event/trace_event.h"
S. Ganesh48540862024-08-12 18:09:3944#include "base/values.h"
[email protected]bc38c252011-04-12 21:46:5745#include "base/win/registry.h"
S. Ganesh6822d2a2025-03-31 20:26:4846#include "base/win/scoped_bstr.h"
47#include "base/win/scoped_variant.h"
[email protected]770c6d82012-09-06 22:21:3248#include "base/win/windows_version.h"
Nico Webereaa08412019-08-14 01:24:3749#include "build/branding_buildflags.h"
ananta069fc882014-09-13 01:22:1250#include "chrome/browser/browser_process.h"
Etienne Bergeron7a0ef612023-09-15 18:28:0851#include "chrome/browser/chrome_process_singleton.h"
Daniel Cheng7d9e3d52022-02-26 09:03:2452#include "chrome/browser/first_run/upgrade_util.h"
[email protected]3f69d6e612012-08-03 18:52:2753#include "chrome/browser/shell_integration.h"
Javier Flores Assad9c26f9b92022-05-21 01:20:4354#include "chrome/browser/win/browser_util.h"
[email protected]80274b92011-07-15 17:20:3855#include "chrome/common/chrome_switches.h"
ananta069fc882014-09-13 01:22:1256#include "chrome/common/pref_names.h"
grt4474dad2017-02-27 21:00:4657#include "chrome/install_static/install_util.h"
S. Ganeshf77e2a52022-11-22 18:40:1958#include "chrome/installer/util/app_command.h"
S. Ganesh48540862024-08-12 18:09:3959#include "chrome/installer/util/per_install_values.h"
[email protected]bc38c252011-04-12 21:46:5760#include "chrome/installer/util/util_constants.h"
brettwb1fc1b82016-02-02 00:19:0861#include "components/prefs/pref_service.h"
S. Ganeshcad45032024-07-18 17:43:1162#include "third_party/abseil-cpp/absl/cleanup/cleanup.h"
ananta069fc882014-09-13 01:22:1263#include "ui/base/ui_base_switches.h"
[email protected]bc38c252011-04-12 21:46:5764
Nico Webereaa08412019-08-14 01:24:3765#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
S. Ganesh6adf04c2023-06-07 19:34:5566#include "chrome/updater/app/server/win/updater_legacy_idl.h"
grt235b3f092015-05-27 21:42:4867#endif
68
[email protected]bc38c252011-04-12 21:46:5769namespace {
70
[email protected]650b2d52013-02-10 03:41:4571bool GetNewerChromeFile(base::FilePath* path) {
Avi Drissman9098f9002018-05-04 00:11:5272 if (!base::PathService::Get(base::DIR_EXE, path))
[email protected]bc38c252011-04-12 21:46:5773 return false;
74 *path = path->Append(installer::kChromeNewExe);
75 return true;
76}
77
S. Ganeshcad45032024-07-18 17:43:1178#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
S. Ganesh6822d2a2025-03-31 20:26:4879// Holds the result of the IPC to CoCreate `GoogleUpdate3Web`.
80struct CreateGoogleUpdate3WebResult
81 : public base::RefCountedThreadSafe<CreateGoogleUpdate3WebResult> {
S. Ganeshcad45032024-07-18 17:43:1182 Microsoft::WRL::ComPtr<IStream> stream;
83 base::WaitableEvent completion_event;
84
85 private:
S. Ganesh6822d2a2025-03-31 20:26:4886 friend class base::RefCountedThreadSafe<CreateGoogleUpdate3WebResult>;
87 ~CreateGoogleUpdate3WebResult() = default;
S. Ganeshcad45032024-07-18 17:43:1188};
89
S. Ganesh6822d2a2025-03-31 20:26:4890// CoCreates the `GoogleUpdate3Web` class, and if successful, marshals the
S. Ganeshcad45032024-07-18 17:43:1191// resulting interface into `result->stream`. Signals `result->completion_event`
92// on successful or failed completion.
S. Ganesh6822d2a2025-03-31 20:26:4893void CreateAndMarshalGoogleUpdate3Web(
94 scoped_refptr<CreateGoogleUpdate3WebResult> result) {
S. Ganeshcad45032024-07-18 17:43:1195 const absl::Cleanup signal_completion_event = [&result] {
96 result->completion_event.Signal();
97 };
98
99 Microsoft::WRL::ComPtr<IUnknown> unknown;
100 {
101 TRACE_EVENT0("startup", "InvokeGoogleUpdateForRename CoCreateInstance");
102 const HRESULT hr =
S. Ganesh6822d2a2025-03-31 20:26:48103 ::CoCreateInstance(__uuidof(GoogleUpdate3WebSystemClass), nullptr,
104 CLSCTX_ALL, IID_PPV_ARGS(&unknown));
S. Ganeshcad45032024-07-18 17:43:11105 if (FAILED(hr)) {
106 TRACE_EVENT_INSTANT1(
107 "startup", "InvokeGoogleUpdateForRename CoCreateInstance failed",
108 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
S. Ganesh6822d2a2025-03-31 20:26:48109 LOG(ERROR) << "CoCreate GoogleUpdate3WebSystemClass failed; hr = "
110 << std::hex << hr;
S. Ganeshcad45032024-07-18 17:43:11111 return;
112 }
113 }
S. Ganeshcad45032024-07-18 17:43:11114 const HRESULT hr = ::CoMarshalInterThreadInterfaceInStream(
115 __uuidof(IUnknown), unknown.Get(), &result->stream);
116 if (FAILED(hr)) {
117 TRACE_EVENT_INSTANT1("startup",
118 "InvokeGoogleUpdateForRename "
119 "CoMarshalInterThreadInterfaceInStream failed",
120 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
121 LOG(ERROR) << "CoMarshalInterThreadInterfaceInStream "
S. Ganesh6822d2a2025-03-31 20:26:48122 "GoogleUpdate3WebSystemClass failed; hr = "
S. Ganeshcad45032024-07-18 17:43:11123 << std::hex << hr;
124 }
125}
126
S. Ganesh6822d2a2025-03-31 20:26:48127// CoCreates the Google Update `GoogleUpdate3WebSystemClass` in a `ThreadPool`
128// thread with a timeout, if the `ThreadPool` is operational. The starting value
129// for the timeout is 15 seconds. If the CoCreate times out, the timeout is
S. Ganesh48540862024-08-12 18:09:39130// increased by 15 seconds at each failed attempt and persisted for the next
131// attempt.
132//
133// If the `ThreadPool` is not operational, the CoCreate is done
S. Ganeshcad45032024-07-18 17:43:11134// without a timeout.
S. Ganesh6822d2a2025-03-31 20:26:48135Microsoft::WRL::ComPtr<IUnknown> CreateGoogleUpdate3Web() {
S. Ganesh48540862024-08-12 18:09:39136 constexpr int kDefaultTimeoutIncrementSeconds = 15;
S. Ganeshbb1d4fc2024-08-14 19:16:32137 constexpr base::TimeDelta kMaxTimeAfterSystemStartup = base::Seconds(150);
S. Ganesh48540862024-08-12 18:09:39138
S. Ganesh6822d2a2025-03-31 20:26:48139 auto result = base::MakeRefCounted<CreateGoogleUpdate3WebResult>();
S. Ganeshcad45032024-07-18 17:43:11140 if (base::ThreadPool::CreateCOMSTATaskRunner(
141 {base::MayBlock(), base::TaskPriority::USER_BLOCKING})
S. Ganesh6822d2a2025-03-31 20:26:48142 ->PostTask(
143 FROM_HERE,
144 base::BindOnce(&CreateAndMarshalGoogleUpdate3Web, result))) {
S. Ganesh48540862024-08-12 18:09:39145 installer::PerInstallValue creation_timeout(
146 L"ProcessLauncherCreationTimeout");
147 const base::TimeDelta timeout = base::Seconds(
148 creation_timeout.Get()
149 .value_or(base::Value(kDefaultTimeoutIncrementSeconds))
150 .GetIfInt()
151 .value_or(kDefaultTimeoutIncrementSeconds));
152 const base::ElapsedTimer timer;
S. Ganeshbb1d4fc2024-08-14 19:16:32153 const bool is_at_startup =
154 base::SysInfo::Uptime() <= kMaxTimeAfterSystemStartup;
S. Ganesh48540862024-08-12 18:09:39155 if (!result->completion_event.TimedWait(timeout)) {
156 base::UmaHistogramMediumTimes(
S. Ganeshbb1d4fc2024-08-14 19:16:32157 is_at_startup
158 ? "Startup.CreateProcessLauncher2.TimedWaitFailedAtStartup"
159 : "Startup.CreateProcessLauncher2.TimedWaitFailed",
160 timer.Elapsed());
S. Ganesh48540862024-08-12 18:09:39161 creation_timeout.Set(base::Value(static_cast<int>(timeout.InSeconds()) +
162 kDefaultTimeoutIncrementSeconds));
S. Ganeshcad45032024-07-18 17:43:11163 TRACE_EVENT_INSTANT0(
164 "startup", "InvokeGoogleUpdateForRename CoCreateInstance timed out",
165 TRACE_EVENT_SCOPE_THREAD);
S. Ganesh6822d2a2025-03-31 20:26:48166 LOG(ERROR) << "CoCreate GoogleUpdate3WebSystemClass timed out";
S. Ganeshcad45032024-07-18 17:43:11167 return {};
168 }
169
170 if (!result->stream) {
171 return {};
172 }
S. Ganesh48540862024-08-12 18:09:39173 base::UmaHistogramMediumTimes(
S. Ganeshbb1d4fc2024-08-14 19:16:32174 is_at_startup
175 ? "Startup.CreateProcessLauncher2.TimedWaitSucceededAtStartup"
176 : "Startup.CreateProcessLauncher2.TimedWaitSucceeded",
177 timer.Elapsed());
S. Ganeshcad45032024-07-18 17:43:11178
179 Microsoft::WRL::ComPtr<IUnknown> unknown;
180 const HRESULT hr =
181 ::CoUnmarshalInterface(result->stream.Get(), __uuidof(IUnknown),
182 IID_PPV_ARGS_Helper(&unknown));
183 if (FAILED(hr)) {
184 TRACE_EVENT_INSTANT1(
185 "startup", "InvokeGoogleUpdateForRename CoUnmarshalInterface failed",
186 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
S. Ganesh6822d2a2025-03-31 20:26:48187 LOG(ERROR)
188 << "CoUnmarshalInterface GoogleUpdate3WebSystemClass failed; hr = "
189 << std::hex << hr;
S. Ganeshcad45032024-07-18 17:43:11190 return {};
191 }
192
193 return unknown;
194 }
195
196 // The task could not be posted to the task runner, so CoCreate without a
197 // timeout. This could happen in shutdown, where the `ThreadPool` is not
198 // operational.
199 {
200 TRACE_EVENT0("startup", "InvokeGoogleUpdateForRename CoCreateInstance");
201 Microsoft::WRL::ComPtr<IUnknown> unknown;
202 const HRESULT hr =
S. Ganesh6822d2a2025-03-31 20:26:48203 ::CoCreateInstance(__uuidof(GoogleUpdate3WebSystemClass), nullptr,
204 CLSCTX_ALL, IID_PPV_ARGS(&unknown));
S. Ganeshcad45032024-07-18 17:43:11205 if (FAILED(hr)) {
206 TRACE_EVENT_INSTANT1(
207 "startup", "InvokeGoogleUpdateForRename CoCreateInstance failed",
208 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
S. Ganesh6822d2a2025-03-31 20:26:48209 LOG(ERROR) << "CoCreate GoogleUpdate3WebSystemClass failed; hr = "
210 << std::hex << hr;
S. Ganeshcad45032024-07-18 17:43:11211 return {};
212 }
213
214 return unknown;
215 }
216}
217#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
218
[email protected]bc38c252011-04-12 21:46:57219bool InvokeGoogleUpdateForRename() {
Nico Webereaa08412019-08-14 01:24:37220#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
Gabriel Charettef7e85712021-12-10 20:46:22221 // This has been identified as very slow on some startups. Detailed trace
222 // events below try to shine a light on each steps. crbug.com/1252004
Gabriel Charette12b58ac2021-09-22 18:08:55223 TRACE_EVENT0("startup", "upgrade_util::InvokeGoogleUpdateForRename");
224
S. Ganesh6822d2a2025-03-31 20:26:48225 Microsoft::WRL::ComPtr<IUnknown> unknown = CreateGoogleUpdate3Web();
S. Ganeshcad45032024-07-18 17:43:11226 if (!unknown) {
227 return false;
228 }
229
S. Ganeshea7ef0872024-03-21 16:28:32230 // Chrome queries for the SxS IIDs first, with a fallback to the legacy IID,
231 // to make sure that marshaling loads the proxy/stub from the correct (HKLM)
232 // hive.
S. Ganesh6822d2a2025-03-31 20:26:48233 Microsoft::WRL::ComPtr<IGoogleUpdate3Web> update3web;
234 if (HRESULT hr = unknown.CopyTo(__uuidof(IGoogleUpdate3WebSystem),
235 IID_PPV_ARGS_Helper(&update3web));
236 FAILED(hr)) {
237 hr = unknown.As(&update3web);
S. Ganeshea7ef0872024-03-21 16:28:32238 if (FAILED(hr)) {
S. Ganesh6822d2a2025-03-31 20:26:48239 TRACE_EVENT_INSTANT1(
240 "startup", "InvokeGoogleUpdateForRename QI IGoogleUpdate3Web failed",
241 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
242 LOG(ERROR) << "QI IGoogleUpdate3Web failed; hr = " << std::hex << hr;
S. Ganeshea7ef0872024-03-21 16:28:32243 return false;
244 }
[email protected]bc38c252011-04-12 21:46:57245 }
Greg Thompsona1f95122019-01-31 22:46:45246
S. Ganesh6822d2a2025-03-31 20:26:48247 Microsoft::WRL::ComPtr<IAppBundleWeb> bundle;
Gabriel Charettef7e85712021-12-10 20:46:22248 {
S. Ganesh6822d2a2025-03-31 20:26:48249 Microsoft::WRL::ComPtr<IDispatch> dispatch;
250 if (HRESULT hr = update3web->createAppBundleWeb(&dispatch); FAILED(hr)) {
251 TRACE_EVENT_INSTANT1(
252 "startup", "InvokeGoogleUpdateForRename createAppBundleWeb failed",
253 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
254 LOG(ERROR) << "createAppBundleWeb failed; hr = " << std::hex << hr;
255 return false;
256 }
257
258 if (HRESULT hr = dispatch.CopyTo(__uuidof(IAppBundleWebSystem),
259 IID_PPV_ARGS_Helper(&bundle));
260 FAILED(hr)) {
261 hr = dispatch.As(&bundle);
262 if (FAILED(hr)) {
263 TRACE_EVENT_INSTANT1(
264 "startup", "InvokeGoogleUpdateForRename QI IAppBundleWeb failed",
265 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
266 LOG(ERROR) << "QI IAppBundleWeb failed; hr = " << std::hex << hr;
267 return false;
268 }
269 }
270 }
271
272 if (HRESULT hr = bundle->initialize(); FAILED(hr)) {
273 TRACE_EVENT_INSTANT1(
274 "startup", "InvokeGoogleUpdateForRename bundle->initialize failed",
275 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
276 LOG(ERROR) << "bundle->initialize failed; hr = " << std::hex << hr;
277 return false;
278 }
279
280 if (HRESULT hr = bundle->createInstalledApp(
281 base::win::ScopedBstr(install_static::GetAppGuid()).Get());
282 FAILED(hr)) {
283 TRACE_EVENT_INSTANT1(
284 "startup",
285 "InvokeGoogleUpdateForRename bundle->createInstalledApp failed",
286 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
287 LOG(ERROR) << "bundle->createInstalledApp failed; hr = " << std::hex << hr;
288 return false;
289 }
290
291 Microsoft::WRL::ComPtr<IAppWeb> app;
292 {
293 Microsoft::WRL::ComPtr<IDispatch> app_dispatch;
294 if (HRESULT hr = bundle->get_appWeb(0, &app_dispatch); FAILED(hr)) {
295 TRACE_EVENT_INSTANT1(
296 "startup", "InvokeGoogleUpdateForRename bundle->get_appWeb failed",
297 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
298 LOG(ERROR) << "bundle->get_appWeb failed; hr = " << std::hex << hr;
299 return false;
300 }
301
302 if (HRESULT hr = app_dispatch.CopyTo(__uuidof(IAppWebSystem),
303 IID_PPV_ARGS_Helper(&app));
304 FAILED(hr)) {
305 hr = app_dispatch.As(&app);
306 if (FAILED(hr)) {
307 TRACE_EVENT_INSTANT1("startup",
308 "InvokeGoogleUpdateForRename QI IAppWeb failed",
309 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
310 LOG(ERROR) << "QI IAppWeb failed; hr = " << std::hex << hr;
311 return false;
312 }
313 }
314 }
315
316 Microsoft::WRL::ComPtr<IAppCommandWeb> app_command_web;
317 {
318 Microsoft::WRL::ComPtr<IDispatch> command_dispatch;
319 if (HRESULT hr = app->get_command(
320 base::win::ScopedBstr(installer::kCmdRenameChromeExe).Get(),
321 &command_dispatch);
322 FAILED(hr)) {
323 TRACE_EVENT_INSTANT1(
324 "startup", "InvokeGoogleUpdateForRename app->get_command failed",
325 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
326 LOG(ERROR) << "app->get_command failed; hr = " << std::hex << hr;
327 return false;
328 }
329
330 if (HRESULT hr =
331 command_dispatch.CopyTo(__uuidof(IAppCommandWebSystem),
332 IID_PPV_ARGS_Helper(&app_command_web));
333 FAILED(hr)) {
334 hr = command_dispatch.As(&app_command_web);
335 if (FAILED(hr)) {
336 TRACE_EVENT_INSTANT1(
337 "startup", "InvokeGoogleUpdateForRename QI IAppCommandWeb failed",
338 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
339 LOG(ERROR) << "QI IAppCommandWeb failed; hr = " << std::hex << hr;
340 return false;
341 }
342 }
343 }
344
345 {
346 TRACE_EVENT0("startup", "InvokeGoogleUpdateForRename execute");
347 if (HRESULT hr =
348 app_command_web->execute(base::win::ScopedVariant::kEmptyVariant,
349 base::win::ScopedVariant::kEmptyVariant,
350 base::win::ScopedVariant::kEmptyVariant,
351 base::win::ScopedVariant::kEmptyVariant,
352 base::win::ScopedVariant::kEmptyVariant,
353 base::win::ScopedVariant::kEmptyVariant,
354 base::win::ScopedVariant::kEmptyVariant,
355 base::win::ScopedVariant::kEmptyVariant,
356 base::win::ScopedVariant::kEmptyVariant);
357 FAILED(hr)) {
358 TRACE_EVENT_INSTANT1(
359 "startup",
360 "InvokeGoogleUpdateForRename app_command_web->execute failed",
361 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
362 LOG(ERROR) << "app_command_web->execute failed; hr = " << std::hex << hr;
Gabriel Charettef7e85712021-12-10 20:46:22363 return false;
364 }
Greg Thompsona1f95122019-01-31 22:46:45365 }
366
Gabriel Charettef7e85712021-12-10 20:46:22367 {
S. Ganesh6822d2a2025-03-31 20:26:48368 UINT status = 0;
369 for (const auto deadline = base::TimeTicks::Now() + base::Seconds(60);
370 base::TimeTicks::Now() < deadline;
371 base::PlatformThread::Sleep(base::Seconds(1))) {
372 if (HRESULT hr = app_command_web->get_status(&status); FAILED(hr)) {
373 TRACE_EVENT_INSTANT1(
374 "startup",
375 "InvokeGoogleUpdateForRename app_command_web->get_status failed",
376 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
377 LOG(ERROR) << "app_command_web->get_status failed; hr = " << std::hex
378 << hr;
379 return false;
380 }
381 if (status == COMMAND_STATUS_COMPLETE) {
382 break;
383 }
384 }
385 if (status != COMMAND_STATUS_COMPLETE) {
386 TRACE_EVENT_INSTANT1(
387 "startup", "InvokeGoogleUpdateForRename !COMMAND_STATUS_COMPLETE",
388 TRACE_EVENT_SCOPE_THREAD, "status", status);
389 LOG(ERROR) << "AppCommand timed out with status code " << status;
Gabriel Charettef7e85712021-12-10 20:46:22390 return false;
391 }
Greg Thompsona1f95122019-01-31 22:46:45392 }
393
S. Ganesh6822d2a2025-03-31 20:26:48394 DWORD exit_code = 0;
395 if (HRESULT hr = app_command_web->get_exitCode(&exit_code); FAILED(hr)) {
396 TRACE_EVENT_INSTANT1(
397 "startup",
398 "InvokeGoogleUpdateForRename app_command_web->get_exitCode failed",
399 TRACE_EVENT_SCOPE_THREAD, "hr", hr);
400 LOG(ERROR) << "app_command_web->get_exitCode failed; hr = " << std::hex
401 << hr;
402 return false;
403 }
404
Greg Thompsona1f95122019-01-31 22:46:45405 if (exit_code != installer::RENAME_SUCCESSFUL) {
S. Ganesh6822d2a2025-03-31 20:26:48