Show More
@@ -179,8 +179,9 b' def make_libraries_xml(wix_dir: pathlib.' | |||
|
179 | 179 | |
|
180 | 180 | def build_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, |
|
181 | 181 | msi_name='mercurial', version=None, post_build_fn=None, |
|
182 |
extra_packages_script |
|
|
183 |
extra_wxs:typing.Optional[typing.Dict[str,str]]=None |
|
|
182 | extra_packages_script=None, | |
|
183 | extra_wxs:typing.Optional[typing.Dict[str,str]]=None, | |
|
184 | extra_features:typing.Optional[typing.List[str]]=None): | |
|
184 | 185 | """Build a WiX MSI installer. |
|
185 | 186 | |
|
186 | 187 | ``source_dir`` is the path to the Mercurial source tree to use. |
@@ -197,6 +198,8 b' def build_installer(source_dir: pathlib.' | |||
|
197 | 198 | print a null byte followed by a newline-separated list of packages that |
|
198 | 199 | should be included in the exe. |
|
199 | 200 | ``extra_wxs`` is a dict of {wxs_name: working_dir_for_wxs_build}. |
|
201 | ``extra_features`` is a list of additional named Features to include in | |
|
202 | the build. These must match Feature names in one of the wxs scripts. | |
|
200 | 203 | """ |
|
201 | 204 | arch = 'x64' if r'\x64' in os.environ.get('LIB', '') else 'x86' |
|
202 | 205 | |
@@ -256,6 +259,9 b' def build_installer(source_dir: pathlib.' | |||
|
256 | 259 | defines['Version'] = version |
|
257 | 260 | defines['Comments'] = 'Installs Mercurial version %s' % version |
|
258 | 261 | defines['VCRedistSrcDir'] = str(hg_build_dir) |
|
262 | if extra_features: | |
|
263 | assert all(';' not in f for f in extra_features) | |
|
264 | defines['MercurialExtraFeatures'] = ';'.join(extra_features) | |
|
259 | 265 | |
|
260 | 266 | run_candle(wix_path, build_dir, source, source_build_rel, defines=defines) |
|
261 | 267 | |
@@ -298,7 +304,7 b' def build_signed_installer(source_dir: p' | |||
|
298 | 304 | name: str, version=None, subject_name=None, |
|
299 | 305 | cert_path=None, cert_password=None, |
|
300 | 306 | timestamp_url=None, extra_packages_script=None, |
|
301 | extra_wxs=None): | |
|
307 | extra_wxs=None, extra_features=None): | |
|
302 | 308 | """Build an installer with signed executables.""" |
|
303 | 309 | |
|
304 | 310 | post_build_fn = make_post_build_signing_fn( |
@@ -312,7 +318,7 b' def build_signed_installer(source_dir: p' | |||
|
312 | 318 | msi_name=name.lower(), version=version, |
|
313 | 319 | post_build_fn=post_build_fn, |
|
314 | 320 | extra_packages_script=extra_packages_script, |
|
315 | extra_wxs=extra_wxs) | |
|
321 | extra_wxs=extra_wxs, extra_features=extra_features) | |
|
316 | 322 | |
|
317 | 323 | description = '%s %s' % (name, version) |
|
318 | 324 |
@@ -39,6 +39,9 b" if __name__ == '__main__':" | |||
|
39 | 39 | 'py2exe binary.')) |
|
40 | 40 | parser.add_argument('--extra-wxs', |
|
41 | 41 | help='CSV of path_to_wxs_file=working_dir_for_wxs_file') |
|
42 | parser.add_argument('--extra-features', | |
|
43 | help=('CSV of extra feature names to include ' | |
|
44 | 'in the installer from the extra wxs files')) | |
|
42 | 45 | |
|
43 | 46 | args = parser.parse_args() |
|
44 | 47 | |
@@ -64,6 +67,8 b" if __name__ == '__main__':" | |||
|
64 | 67 | if args.extra_wxs: |
|
65 | 68 | kwargs['extra_wxs'] = dict( |
|
66 | 69 | thing.split("=") for thing in args.extra_wxs.split(',')) |
|
70 | if args.extra_features: | |
|
71 | kwargs['extra_features'] = args.extra_features.split(',') | |
|
67 | 72 | |
|
68 | 73 | if args.sign_sn or args.sign_cert: |
|
69 | 74 | fn = build_signed_installer |
@@ -129,6 +129,11 b'' | |||
|
129 | 129 | <MergeRef Id='VCRuntime' /> |
|
130 | 130 | <MergeRef Id='VCRuntimePolicy' /> |
|
131 | 131 | </Feature> |
|
132 | <?if $(var.MercurialExtraFeatures)?> | |
|
133 | <?foreach EXTRAFEAT in $(var.MercurialExtraFeatures)?> | |
|
134 | <FeatureRef Id="$(var.EXTRAFEAT)" /> | |
|
135 | <?endforeach?> | |
|
136 | <?endif?> | |
|
132 | 137 | <Feature Id='Locales' Title='Translations' Description='Translations' Level='1'> |
|
133 | 138 | <ComponentGroupRef Id='localeFolder' /> |
|
134 | 139 | <ComponentRef Id='i18nFolder' /> |
General Comments 0
You need to be logged in to leave comments.
Login now