Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: chrome/installer/mini_installer/mini_installer.cc

Issue 2559053002: Instrument setup.exe in the SyzyAsan builds.
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // mini_installer.exe is the first exe that is run when chrome is being 5 // mini_installer.exe is the first exe that is run when chrome is being
6 // installed or upgraded. It is designed to be extremely small (~5KB with no 6 // installed or upgraded. It is designed to be extremely small (~5KB with no
7 // extra resources linked) and it has two main jobs: 7 // extra resources linked) and it has two main jobs:
8 // 1) unpack the resources (possibly decompressing some) 8 // 1) unpack the resources (possibly decompressing some)
9 // 2) run the real installer (setup.exe) with appropriate flags. 9 // 2) run the real installer (setup.exe) with appropriate flags.
10 // 10 //
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 return FALSE; 293 return FALSE;
294 } else { 294 } else {
295 // Resources should either start with 'chrome' or 'setup'. We don't handle 295 // Resources should either start with 'chrome' or 'setup'. We don't handle
296 // anything else. 296 // anything else.
297 return FALSE; 297 return FALSE;
298 } 298 }
299 299
300 return TRUE; 300 return TRUE;
301 } 301 }
302 302
303 #if defined(COMPONENT_BUILD) 303 #if defined(COMPONENT_BUILD) || defined(SYZYASAN)
304 // An EnumResNameProc callback that writes the resource |name| to disk in the 304 // An EnumResNameProc callback that writes the resource |name| to disk in the
305 // directory |base_path_ptr| (which must end with a path separator). 305 // directory |base_path_ptr| (which must end with a path separator).
306 BOOL CALLBACK WriteResourceToDirectory(HMODULE module, 306 BOOL CALLBACK WriteResourceToDirectory(HMODULE module,
307 const wchar_t* type, 307 const wchar_t* type,
308 wchar_t* name, 308 wchar_t* name,
309 LONG_PTR base_path_ptr) { 309 LONG_PTR base_path_ptr) {
310 const wchar_t* base_path = reinterpret_cast<const wchar_t*>(base_path_ptr); 310 const wchar_t* base_path = reinterpret_cast<const wchar_t*>(base_path_ptr);
311 PathString full_path; 311 PathString full_path;
312 312
313 PEResource resource(name, type, module); 313 PEResource resource(name, type, module);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 ::DeleteFile(setup_path->get()); 419 ::DeleteFile(setup_path->get());
420 if (success) { 420 if (success) {
421 if (!setup_path->assign(setup_dest_path.get())) { 421 if (!setup_path->assign(setup_dest_path.get())) {
422 ::DeleteFile(setup_dest_path.get()); 422 ::DeleteFile(setup_dest_path.get());
423 exit_code = ProcessExitResult(PATH_STRING_OVERFLOW); 423 exit_code = ProcessExitResult(PATH_STRING_OVERFLOW);
424 } 424 }
425 } else { 425 } else {
426 exit_code = ProcessExitResult(UNABLE_TO_EXTRACT_SETUP_EXE); 426 exit_code = ProcessExitResult(UNABLE_TO_EXTRACT_SETUP_EXE);
427 } 427 }
428 428
429 #if defined(COMPONENT_BUILD) 429 #if defined(COMPONENT_BUILD) || defined(SYZYASAN)
430 if (exit_code.IsSuccess()) { 430 if (exit_code.IsSuccess()) {
431 // Extract the (uncompressed) modules required by setup.exe. 431 // Extract the (uncompressed) modules required by setup.exe.
432 if (!::EnumResourceNames(module, kBinResourceType, WriteResourceToDirectory, 432 if (!::EnumResourceNames(module, kBinResourceType, WriteResourceToDirectory,
433 reinterpret_cast<LONG_PTR>(base_path))) { 433 reinterpret_cast<LONG_PTR>(base_path))) {
434 return ProcessExitResult(UNABLE_TO_EXTRACT_SETUP, ::GetLastError()); 434 return ProcessExitResult(UNABLE_TO_EXTRACT_SETUP, ::GetLastError());
435 } 435 }
436 } 436 }
437 #endif 437 #endif
438 438
439 return exit_code; 439 return exit_code;
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 DeleteExtractedFiles(base_path.get(), archive_path.get(), setup_path.get()); 859 DeleteExtractedFiles(base_path.get(), archive_path.get(), setup_path.get());
860 860
861 #if defined(GOOGLE_CHROME_BUILD) 861 #if defined(GOOGLE_CHROME_BUILD)
862 WriteInstallResults(configuration, exit_code); 862 WriteInstallResults(configuration, exit_code);
863 #endif 863 #endif
864 864
865 return exit_code; 865 return exit_code;
866 } 866 }
867 867
868 } // namespace mini_installer 868 } // namespace mini_installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698