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

Side by Side Diff: tools/win/split_link/install_split_link.py

Issue 14850021: Generate, merge, and embed manifest when doing split_link (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 | Annotate | Revision Log
« no previous file with comments | « build/split_link_partition.py ('k') | tools/win/split_link/split_link.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 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 import _winreg 5 import _winreg
6 import os 6 import os
7 import shutil 7 import shutil
8 import subprocess 8 import subprocess
9 import sys 9 import sys
10 10
(...skipping 26 matching lines...) Expand all
37 to be turned into a string in the target C program.""" 37 to be turned into a string in the target C program."""
38 path = '"' + path + '"' 38 path = '"' + path + '"'
39 return path.replace('\\', '\\\\').replace('"', '\\"') 39 return path.replace('\\', '\\\\').replace('"', '\\"')
40 40
41 41
42 def main(): 42 def main():
43 # Switch to our own dir. 43 # Switch to our own dir.
44 os.chdir(BASE_DIR) 44 os.chdir(BASE_DIR)
45 45
46 link = FindInPath('link.exe') 46 link = FindInPath('link.exe')
47 if not link: 47 mt = FindInPath('mt.exe')
48 print("Couldn't find link.exe in PATH. Must run from Administrator " 48 if not link or not mt:
49 "Visual Studio Command Prompt.") 49 print("Couldn't find link.exe or mt.exe in PATH. "
50 "Must run from Administrator Visual Studio Command Prompt.")
50 return 1 51 return 1
51 52
52 link_backup = os.path.join(os.path.split(link)[0], 'link.exe.split_link.exe') 53 link_backup = os.path.join(os.path.split(link)[0], 'link.exe.split_link.exe')
53 54
54 # Don't re-backup link.exe, so only copy link.exe to backup if it's 55 # Don't re-backup link.exe, so only copy link.exe to backup if it's
55 # not there already. 56 # not there already.
56 if not os.path.exists(link_backup): 57 if not os.path.exists(link_backup):
57 try: 58 try:
58 print 'Saving original link.exe...' 59 print 'Saving original link.exe...'
59 shutil.copyfile(link, link_backup) 60 shutil.copyfile(link, link_backup)
(...skipping 16 matching lines...) Expand all
76 python, script_path)) 77 python, script_path))
77 78
78 # Copy shim into place. 79 # Copy shim into place.
79 print 'Copying split_link.exe over link.exe...' 80 print 'Copying split_link.exe over link.exe...'
80 try: 81 try:
81 shutil.copyfile('split_link.exe', link) 82 shutil.copyfile('split_link.exe', link)
82 _winreg.SetValue(_winreg.HKEY_CURRENT_USER, 83 _winreg.SetValue(_winreg.HKEY_CURRENT_USER,
83 'Software\\Chromium\\split_link_installed', 84 'Software\\Chromium\\split_link_installed',
84 _winreg.REG_SZ, 85 _winreg.REG_SZ,
85 link_backup) 86 link_backup)
87 _winreg.SetValue(_winreg.HKEY_CURRENT_USER,
88 'Software\\Chromium\\split_link_mt_path',
89 _winreg.REG_SZ,
90 mt)
86 except IOError: 91 except IOError:
87 print("Wasn't able to copy split_link.exe over %s. " 92 print("Wasn't able to copy split_link.exe over %s. "
88 "Not running with Administrator privileges?" % link) 93 "Not running with Administrator privileges?" % link)
89 return 1 94 return 1
90 95
91 return 0 96 return 0
92 97
93 98
94 if __name__ == '__main__': 99 if __name__ == '__main__':
95 sys.exit(main()) 100 sys.exit(main())
OLDNEW
« no previous file with comments | « build/split_link_partition.py ('k') | tools/win/split_link/split_link.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698