OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 # A script to generate a windows installer for the editor bundle. | 7 # A script to generate a windows installer for the editor bundle. |
8 # As input the script takes a zip file, a version and the location | 8 # As input the script takes a zip file, a version and the location |
9 # to store the resulting msi file in. | 9 # to store the resulting msi file in. |
10 # | 10 # |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 ExtractZipFile(options.zip_file_location, temp_dir) | 76 ExtractZipFile(options.zip_file_location, temp_dir) |
77 return os.path.join(temp_dir, 'dart') | 77 return os.path.join(temp_dir, 'dart') |
78 return options.input_directory | 78 return options.input_directory |
79 | 79 |
80 # We combine the build and patch into a single entry since | 80 # We combine the build and patch into a single entry since |
81 # the windows installer does _not_ consider a change in Patch | 81 # the windows installer does _not_ consider a change in Patch |
82 # to require a new install. | 82 # to require a new install. |
83 # In addition to that, the limits on the size are: | 83 # In addition to that, the limits on the size are: |
84 # Major: 256 | 84 # Major: 256 |
85 # Minor: 256 | 85 # Minor: 256 |
86 # Build: 65536 | 86 # Patch: 65536 |
87 # To circumvent this we create the version like this: | 87 # To circumvent this we create the version like this: |
88 # Major.Minor.X | 88 # Major.Minor.X |
89 # where X is Build<<9 + Patch | 89 # from "major.minor.patch-prerelease.prerelease_patch" |
90 # Example version 1.2.4.14 will go to 1.2.2062 | 90 # where X is "patch<<10 + prerelease<<5 + prerelease_patch" |
| 91 # Example version 1.2.4-dev.2.3 will go to 1.2.4163 |
91 def GetMicrosoftProductVersion(version): | 92 def GetMicrosoftProductVersion(version): |
92 version_parts = version.split('.') | 93 version_parts = version.split('.') |
93 if len(version_parts) is not 4: | 94 if len(version_parts) is not 5: |
94 raise Exception( | 95 raise Exception( |
95 "Version string (%s) does not follow specification" % version) | 96 "Version string (%s) does not follow specification" % version) |
96 (major, minor, build, patch) = map(int, version_parts) | 97 (major, minor, patch, prerelease, prerelease_patch) = map(int, version_parts) |
97 | 98 |
98 if build > 127 or patch > 511: | |
99 raise Exception('Build/Patch can not be above 127/511') | |
100 if major > 255 or minor > 255: | 99 if major > 255 or minor > 255: |
101 raise Exception('Major/Minor can not be above 256') | 100 raise Exception('Major/Minor can not be above 256') |
| 101 if patch > 63: |
| 102 raise Exception('Patch can not be above 63') |
| 103 if prerelease > 31: |
| 104 raise Exception('Prerelease can not be above 31') |
| 105 if prerelease_patch > 31: |
| 106 raise Exception('PrereleasePatch can not be above 31') |
102 | 107 |
103 combined = (build << 9) + patch | 108 combined = (patch << 10) + (prerelease << 5) + prerelease_patch |
104 return '%s.%s.%s' % (major, minor, combined) | 109 return '%s.%s.%s' % (major, minor, combined) |
105 | 110 |
106 # Append using the current indentation level | 111 # Append using the current indentation level |
107 def Append(data, new_line=True): | 112 def Append(data, new_line=True): |
108 str = ((' ' * current_indentation) + | 113 str = ((' ' * current_indentation) + |
109 data + | 114 data + |
110 ('\n' if new_line else '')) | 115 ('\n' if new_line else '')) |
111 xml_content.append(str) | 116 xml_content.append(str) |
112 | 117 |
113 # Append without any indentation at the current position | 118 # Append without any indentation at the current position |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 # We have only one feature and that consist of all the | 383 # We have only one feature and that consist of all the |
379 # files=components we have listed above" | 384 # files=components we have listed above" |
380 ComponentRefs() | 385 ComponentRefs() |
381 xml = GetContent() | 386 xml = GetContent() |
382 if options.print_wxs: | 387 if options.print_wxs: |
383 print xml | 388 print xml |
384 GenerateInstaller(xml, options, temp_dir) | 389 GenerateInstaller(xml, options, temp_dir) |
385 | 390 |
386 if __name__ == '__main__': | 391 if __name__ == '__main__': |
387 sys.exit(Main(sys.argv)) | 392 sys.exit(Main(sys.argv)) |
OLD | NEW |