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

Side by Side Diff: chrome/tools/build/win/create_installer_archive.py

Issue 10407053: Copy VC CRT DLLs for component build even when VS is not installed. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 "C:/Program Files (x86)/Microsoft Visual Studio */VC/redist/" 359 "C:/Program Files (x86)/Microsoft Visual Studio */VC/redist/"
360 "Debug_NonRedist/x86/Microsoft.*.DebugCRT/*.dll") 360 "Debug_NonRedist/x86/Microsoft.*.DebugCRT/*.dll")
361 elif build_dir.endswith('Release/'): 361 elif build_dir.endswith('Release/'):
362 crt_dlls = glob.glob( 362 crt_dlls = glob.glob(
363 "C:/Program Files (x86)/Microsoft Visual Studio */VC/redist/x86/" 363 "C:/Program Files (x86)/Microsoft Visual Studio */VC/redist/x86/"
364 "Microsoft.*.CRT/*.dll") 364 "Microsoft.*.CRT/*.dll")
365 else: 365 else:
366 print ("Warning: CRT DLLs not copied, could not determine build " 366 print ("Warning: CRT DLLs not copied, could not determine build "
367 "configuration from output directory.") 367 "configuration from output directory.")
368 368
369 # Also handle the case where someone is building using only winsdk and
370 # doesn't have Visual Studio installed.
371 if not crt_dlls:
gab 2012/05/20 14:42:54 Now that this is getting bigger I would extract al
dmazzoni 2012/05/21 21:28:39 Done.
372 if os.access("C:/Windows/SysWOW64", os.F_OK):
373 sys_dll_dir = "C:/Windows/SysWOW64"
gab 2012/05/20 14:42:54 Aren't these the 64-bit DLLs? Chrome is always 32-
robertshield 2012/05/20 17:36:16 Wow64 means "Windows 32-bit on Windows 64 bit", so
dmazzoni 2012/05/21 21:28:39 Worth a comment; I certainly wouldn't have guessed
374 else:
375 sys_dll_dir = "C:/Windows/System32"
gab 2012/05/20 15:05:01 These DLLs are found all over the place. I'm not c
robertshield 2012/05/20 17:36:16 I don't know offhand which dlls are picked up when
dmazzoni 2012/05/21 21:28:39 FWIW, I searched my system and did not find them a
robertshield 2012/05/22 02:39:58 Ok, interesting. Since all that really matters is
376
377 if build_dir.endswith('Debug/'):
378 crt_dlls = glob.glob("%s/msvc*0d.dll" % sys_dll_dir)
gab 2012/05/20 14:42:54 I'd do this inside the "if build_dir.endswith('Deb
dmazzoni 2012/05/21 21:28:39 I'd argue that the "if os.access" is by far the mo
gab 2012/05/22 15:44:46 Yep.
379 elif build_dir.endswith('Release/'):
380 crt_dlls = glob.glob("%s/msvc*0.dll" % sys_dll_dir)
gab 2012/05/20 15:05:01 .format() has been preferred over % for string for
dmazzoni 2012/05/21 21:28:39 Actually in this case a simple string append might
gab 2012/05/22 15:44:46 Works for me.
381
369 for dll in crt_dlls: 382 for dll in crt_dlls:
370 shutil.copy(dll, build_dir) 383 shutil.copy(dll, build_dir)
371 384
372 # Copy all the DLLs in |build_dir| to the version directory. Simultaneously 385 # Copy all the DLLs in |build_dir| to the version directory. Simultaneously
373 # build a list of their names to mark them as dependencies of chrome.exe and 386 # build a list of their names to mark them as dependencies of chrome.exe and
374 # setup.exe later. 387 # setup.exe later.
375 dlls = glob.glob(os.path.join(build_dir, '*.dll')) 388 dlls = glob.glob(os.path.join(build_dir, '*.dll'))
376 dll_names = [] 389 dll_names = []
377 for dll in dlls: 390 for dll in dlls:
378 shutil.copy(dll, version_dir) 391 shutil.copy(dll, version_dir)
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 if not options.resource_file_path: 564 if not options.resource_file_path:
552 options.resource_file_path = os.path.join(options.build_dir, 565 options.resource_file_path = os.path.join(options.build_dir,
553 MINI_INSTALLER_INPUT_FILE) 566 MINI_INSTALLER_INPUT_FILE)
554 567
555 return options 568 return options
556 569
557 570
558 if '__main__' == __name__: 571 if '__main__' == __name__:
559 print sys.argv 572 print sys.argv
560 sys.exit(main(_ParseOptions())) 573 sys.exit(main(_ParseOptions()))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698