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

Side by Side Diff: chrome/installer/util/prebuild/create_string_rc.py

Issue 27258: Before installing Chrome check that the installation directory doesn't exist (or can be deleted). (Closed)
Patch Set: Created 11 years, 10 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 | « chrome/installer/setup/main.cc ('k') | chrome/installer/util/util_constants.h » ('j') | 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/python 1 #!/usr/bin/python
2 # Copyright 2008 Google Inc. All rights reserved. 2 # Copyright 2008 Google Inc. All rights reserved.
3 3
4 """This script generates an rc file and header (setup_strings.{rc,h}) to be 4 """This script generates an rc file and header (setup_strings.{rc,h}) to be
5 included in setup.exe. The rc file includes translations for strings pulled 5 included in setup.exe. The rc file includes translations for strings pulled
6 from generated_resource.grd and the localized .xtb files. 6 from generated_resource.grd and the localized .xtb files.
7 7
8 The header file includes IDs for each string, but also has values to allow 8 The header file includes IDs for each string, but also has values to allow
9 getting a string based on a language offset. For example, the header file 9 getting a string based on a language offset. For example, the header file
10 looks like this: 10 looks like this:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 'IDS_INSTALL_USER_LEVEL_EXISTS', 43 'IDS_INSTALL_USER_LEVEL_EXISTS',
44 'IDS_INSTALL_SYSTEM_LEVEL_EXISTS', 44 'IDS_INSTALL_SYSTEM_LEVEL_EXISTS',
45 'IDS_INSTALL_FAILED', 45 'IDS_INSTALL_FAILED',
46 'IDS_INSTALL_OS_NOT_SUPPORTED', 46 'IDS_INSTALL_OS_NOT_SUPPORTED',
47 'IDS_INSTALL_OS_ERROR', 47 'IDS_INSTALL_OS_ERROR',
48 'IDS_INSTALL_TEMP_DIR_FAILED', 48 'IDS_INSTALL_TEMP_DIR_FAILED',
49 'IDS_INSTALL_UNCOMPRESSION_FAILED', 49 'IDS_INSTALL_UNCOMPRESSION_FAILED',
50 'IDS_INSTALL_INVALID_ARCHIVE', 50 'IDS_INSTALL_INVALID_ARCHIVE',
51 'IDS_INSTALL_INSUFFICIENT_RIGHTS', 51 'IDS_INSTALL_INSUFFICIENT_RIGHTS',
52 'IDS_UNINSTALL_FAILED', 52 'IDS_UNINSTALL_FAILED',
53 'IDS_INSTALL_DIR_IN_USE',
53 ] 54 ]
54 55
55 # The ID of the first resource string. 56 # The ID of the first resource string.
56 kFirstResourceID = 1600 57 kFirstResourceID = 1600
57 58
58 class TranslationStruct: 59 class TranslationStruct:
59 """A helper struct that holds information about a single translation.""" 60 """A helper struct that holds information about a single translation."""
60 def __init__(self, resource_id_str, language, translation): 61 def __init__(self, resource_id_str, language, translation):
61 self.resource_id_str = resource_id_str 62 self.resource_id_str = resource_id_str
62 self.language = language 63 self.language = language
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 translated_strings = CollectTranslatedStrings() 185 translated_strings = CollectTranslatedStrings()
185 kFilebase = os.path.join(argv[1], 'installer_util_strings') 186 kFilebase = os.path.join(argv[1], 'installer_util_strings')
186 WriteRCFile(translated_strings, kFilebase) 187 WriteRCFile(translated_strings, kFilebase)
187 WriteHeaderFile(translated_strings, kFilebase) 188 WriteHeaderFile(translated_strings, kFilebase)
188 189
189 if '__main__' == __name__: 190 if '__main__' == __name__:
190 if len(sys.argv) < 2: 191 if len(sys.argv) < 2:
191 print 'Usage:\n %s <output_directory>' % sys.argv[0] 192 print 'Usage:\n %s <output_directory>' % sys.argv[0]
192 sys.exit(1) 193 sys.exit(1)
193 main(sys.argv) 194 main(sys.argv)
OLDNEW
« no previous file with comments | « chrome/installer/setup/main.cc ('k') | chrome/installer/util/util_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698