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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 def DoComponentBuildTasks(staging_dir, build_dir, current_version): | 320 def DoComponentBuildTasks(staging_dir, build_dir, current_version): |
321 # Get the required directories for the upcoming operations. | 321 # Get the required directories for the upcoming operations. |
322 chrome_dir = os.path.join(staging_dir, CHROME_DIR) | 322 chrome_dir = os.path.join(staging_dir, CHROME_DIR) |
323 version_dir = os.path.join(chrome_dir, current_version) | 323 version_dir = os.path.join(chrome_dir, current_version) |
324 installer_dir = os.path.join(version_dir, 'Installer') | 324 installer_dir = os.path.join(version_dir, 'Installer') |
325 # |installer_dir| is technically only created post-install, but we need it | 325 # |installer_dir| is technically only created post-install, but we need it |
326 # now to add setup.exe's config and manifest to the archive. | 326 # now to add setup.exe's config and manifest to the archive. |
327 if not os.path.exists(installer_dir): | 327 if not os.path.exists(installer_dir): |
328 os.mkdir(installer_dir) | 328 os.mkdir(installer_dir) |
329 | 329 |
330 # Copy the VS2010 CRT DLLs to |build_dir|. | |
331 crt_dlls = [] | |
332 if build_dir.endswith('Debug/'): | |
333 crt_dlls = glob.glob( | |
334 "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/redist/" | |
335 "Debug_NonRedist/x86/Microsoft.*.DebugCRT/*.dll") | |
336 elif build_dir.endswith('Release/'): | |
337 crt_dlls = glob.glob( | |
338 "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/redist/x86/" | |
339 "Microsoft.*.CRT/*.dll") | |
340 else: | |
341 print ("Warning: CRT DLLs not copied, could not determine build " | |
342 "configuration from output directory.") | |
343 | |
344 for dll in crt_dlls: | |
345 shutil.copy(dll, build_dir) | |
346 | |
330 # Copy all the DLLs in |build_dir| to the version directory. | 347 # Copy all the DLLs in |build_dir| to the version directory. |
331 dlls = glob.glob(os.path.join(build_dir, '*.dll')) | 348 dlls = glob.glob(os.path.join(build_dir, '*.dll')) |
332 for dll in dlls: | 349 for dll in dlls: |
333 shutil.copy(dll, version_dir) | 350 shutil.copy(dll, version_dir) |
334 | 351 |
335 exe_config = ( | 352 exe_config = ( |
336 "<configuration>\n" | 353 "<configuration>\n" |
337 " <windows>\n" | 354 " <windows>\n" |
338 " <assemblyBinding xmlns='urn:schemas-microsoft-com:asm.v1'>\n" | 355 " <assemblyBinding xmlns='urn:schemas-microsoft-com:asm.v1'>\n" |
339 " <probing privatePath='{rel_path}'/>\n" | 356 " <probing privatePath='{rel_path}'/>\n" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 help='Whether to include HiDPI resource files.') | 521 help='Whether to include HiDPI resource files.') |
505 parser.add_option('--enable_metro', default='0', | 522 parser.add_option('--enable_metro', default='0', |
506 help='Whether to include resource files from the "METRO" section of the ' | 523 help='Whether to include resource files from the "METRO" section of the ' |
507 'input file.') | 524 'input file.') |
508 parser.add_option('--component_build', default='0', | 525 parser.add_option('--component_build', default='0', |
509 help='Whether this archive is packaging a component build.') | 526 help='Whether this archive is packaging a component build.') |
510 | 527 |
511 options, args = parser.parse_args() | 528 options, args = parser.parse_args() |
512 if not options.build_dir: | 529 if not options.build_dir: |
513 parser.error('You must provide a build dir.') | 530 parser.error('You must provide a build dir.') |
531 elif not options.build_dir.endswith('/'): | |
gab
2012/05/15 23:02:19
The way create_installer_archive is currently bein
| |
532 options.build_dir += '/' | |
514 | 533 |
515 if not options.staging_dir: | 534 if not options.staging_dir: |
516 parser.error('You must provide a staging dir.') | 535 parser.error('You must provide a staging dir.') |
517 | 536 |
518 if not options.input_file: | 537 if not options.input_file: |
519 parser.error('You must provide an input file') | 538 parser.error('You must provide an input file') |
520 | 539 |
521 if not options.output_dir: | 540 if not options.output_dir: |
522 options.output_dir = options.build_dir | 541 options.output_dir = options.build_dir |
523 | 542 |
524 if not options.resource_file_path: | 543 if not options.resource_file_path: |
525 options.resource_file_path = os.path.join(options.build_dir, | 544 options.resource_file_path = os.path.join(options.build_dir, |
526 MINI_INSTALLER_INPUT_FILE) | 545 MINI_INSTALLER_INPUT_FILE) |
527 | 546 |
528 return options | 547 return options |
529 | 548 |
530 | 549 |
531 if '__main__' == __name__: | 550 if '__main__' == __name__: |
532 print sys.argv | 551 print sys.argv |
533 sys.exit(main(_ParseOptions())) | 552 sys.exit(main(_ParseOptions())) |
OLD | NEW |