Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Script to create Chrome Installer archive. | 6 """Script to create Chrome Installer archive. |
| 7 | 7 |
| 8 This script is used to create an archive of all the files required for a | 8 This script is used to create an archive of all the files required for a |
| 9 Chrome install in appropriate directory structure. It reads chrome.release | 9 Chrome install in appropriate directory structure. It reads chrome.release |
| 10 file as input, creates chrome.7z archive, compresses setup.exe and | 10 file as input, creates chrome.7z archive, compresses setup.exe and |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 451 glob.glob(os.path.join(version_dir, '*.dll'))] | 451 glob.glob(os.path.join(version_dir, '*.dll'))] |
| 452 component_dll_filenames = [] | 452 component_dll_filenames = [] |
| 453 for component_dll in [dll for dll in build_dlls if \ | 453 for component_dll in [dll for dll in build_dlls if \ |
| 454 os.path.basename(dll) not in staged_dll_basenames]: | 454 os.path.basename(dll) not in staged_dll_basenames]: |
| 455 # remoting_*.dll's don't belong in the archive (it doesn't depend on them | 455 # remoting_*.dll's don't belong in the archive (it doesn't depend on them |
| 456 # in gyp). Trying to copy them causes a build race when creating the | 456 # in gyp). Trying to copy them causes a build race when creating the |
| 457 # installer archive in component mode. See: crbug.com/180996 | 457 # installer archive in component mode. See: crbug.com/180996 |
| 458 if os.path.basename(component_dll).startswith('remoting_'): | 458 if os.path.basename(component_dll).startswith('remoting_'): |
| 459 continue | 459 continue |
| 460 # Copy them to the version_dir (for the version assembly to be able to refer | 460 # Copy them to the version_dir (for the version assembly to be able to refer |
| 461 # to them below and thus for chrome.exe to be able to load them at runtime). | 461 # to them below and make sure chrome.exe can find them at runtime). |
| 462 shutil.copy(component_dll, version_dir) | 462 shutil.copy(component_dll, version_dir) |
| 463 # Also copy them directly to the Installer directory for the installed | 463 # Also copy them directly to the Installer directory for the installed |
| 464 # setup.exe to be able to run (as it doesn't statically link in component | 464 # setup.exe to be able to run (as it doesn't statically link in component |
| 465 # DLLs). | 465 # DLLs). |
| 466 # TODO(gab): This makes the archive ~278MB instead of ~185MB; consider | 466 # This makes the archive ~1.5X bigger (Release ~185MB => ~278MB; |
|
grt (UTC plus 2)
2013/11/15 17:27:53
I agree that this is a sound decision.
| |
| 467 # copying the DLLs over from the installer. | 467 # Debug ~520MB => ~875MB) this is however simpler than any other installer |
| 468 # change and doesn't make archive generation itself slower so it only | |
| 469 # matters when copying the archive to other test machines. This approach | |
| 470 # can be revised if this is a problem. | |
| 468 shutil.copy(component_dll, installer_dir) | 471 shutil.copy(component_dll, installer_dir) |
| 469 component_dll_filenames.append(os.path.basename(component_dll)) | 472 component_dll_filenames.append(os.path.basename(component_dll)) |
| 470 | 473 |
| 471 # Copy chrome.exe.manifest as-is. It is required, among other things, to | 474 # Copy chrome.exe.manifest as-is. It is required, among other things, to |
| 472 # declare a dependency on the version dir assembly. | 475 # declare a dependency on the version dir assembly. |
| 473 shutil.copy(os.path.join(build_dir, 'chrome.exe.manifest'), chrome_dir) | 476 shutil.copy(os.path.join(build_dir, 'chrome.exe.manifest'), chrome_dir) |
| 474 | 477 |
| 475 # Also copy setup.exe.manifest as-is. It is required, among other things, to | 478 # Also copy setup.exe.manifest as-is. It is required, among other things, to |
| 476 # let setup.exe UAC when it wants to, by specifying that it handles elevation | 479 # let setup.exe UAC when it wants to, by specifying that it handles elevation |
| 477 # "asInvoker", rather than have Windows auto-elevate it when launched. | 480 # "asInvoker", rather than have Windows auto-elevate it when launched. |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 603 if not options.resource_file_path: | 606 if not options.resource_file_path: |
| 604 options.resource_file_path = os.path.join(options.build_dir, | 607 options.resource_file_path = os.path.join(options.build_dir, |
| 605 MINI_INSTALLER_INPUT_FILE) | 608 MINI_INSTALLER_INPUT_FILE) |
| 606 | 609 |
| 607 return options | 610 return options |
| 608 | 611 |
| 609 | 612 |
| 610 if '__main__' == __name__: | 613 if '__main__' == __name__: |
| 611 print sys.argv | 614 print sys.argv |
| 612 sys.exit(main(_ParseOptions())) | 615 sys.exit(main(_ParseOptions())) |
| OLD | NEW |