Show More
@@ -341,7 +341,6 b' def build_installer(' | |||||
341 |
|
341 | |||
342 | hg_build_dir = source_dir / 'build' |
|
342 | hg_build_dir = source_dir / 'build' | |
343 | dist_dir = source_dir / 'dist' |
|
343 | dist_dir = source_dir / 'dist' | |
344 | wix_dir = source_dir / 'contrib' / 'packaging' / 'wix' |
|
|||
345 |
|
344 | |||
346 | requirements_txt = ( |
|
345 | requirements_txt = ( | |
347 | source_dir / 'contrib' / 'packaging' / 'requirements_win32.txt' |
|
346 | source_dir / 'contrib' / 'packaging' / 'requirements_win32.txt' | |
@@ -388,13 +387,41 b' def build_installer(' | |||||
388 | print('removing %s' % p) |
|
387 | print('removing %s' % p) | |
389 | p.unlink() |
|
388 | p.unlink() | |
390 |
|
389 | |||
391 | wix_pkg, wix_entry = download_entry('wix', hg_build_dir) |
|
390 | return run_wix_packaging( | |
392 | wix_path = hg_build_dir / ('wix-%s' % wix_entry['version']) |
|
391 | source_dir, | |
|
392 | build_dir, | |||
|
393 | staging_dir, | |||
|
394 | arch, | |||
|
395 | version=version, | |||
|
396 | orig_version=orig_version, | |||
|
397 | msi_name=msi_name, | |||
|
398 | extra_wxs=extra_wxs, | |||
|
399 | extra_features=extra_features, | |||
|
400 | ) | |||
|
401 | ||||
|
402 | ||||
|
403 | def run_wix_packaging( | |||
|
404 | source_dir: pathlib.Path, | |||
|
405 | build_dir: pathlib.Path, | |||
|
406 | staging_dir: pathlib.Path, | |||
|
407 | arch: str, | |||
|
408 | version: str, | |||
|
409 | orig_version: str, | |||
|
410 | msi_name: typing.Optional[str] = "mercurial", | |||
|
411 | extra_wxs: typing.Optional[typing.Dict[str, str]] = None, | |||
|
412 | extra_features: typing.Optional[typing.List[str]] = None, | |||
|
413 | ): | |||
|
414 | """Invokes WiX to package up a built Mercurial.""" | |||
|
415 | ||||
|
416 | wix_dir = source_dir / 'contrib' / 'packaging' / 'wix' | |||
|
417 | ||||
|
418 | wix_pkg, wix_entry = download_entry('wix', build_dir) | |||
|
419 | wix_path = build_dir / ('wix-%s' % wix_entry['version']) | |||
393 |
|
420 | |||
394 | if not wix_path.exists(): |
|
421 | if not wix_path.exists(): | |
395 | extract_zip_to_directory(wix_pkg, wix_path) |
|
422 | extract_zip_to_directory(wix_pkg, wix_path) | |
396 |
|
423 | |||
397 |
ensure_vc90_merge_modules( |
|
424 | ensure_vc90_merge_modules(build_dir) | |
398 |
|
425 | |||
399 | source_build_rel = pathlib.Path(os.path.relpath(source_dir, build_dir)) |
|
426 | source_build_rel = pathlib.Path(os.path.relpath(source_dir, build_dir)) | |
400 |
|
427 | |||
@@ -413,7 +440,7 b' def build_installer(' | |||||
413 | source = wix_dir / 'mercurial.wxs' |
|
440 | source = wix_dir / 'mercurial.wxs' | |
414 | defines['Version'] = version |
|
441 | defines['Version'] = version | |
415 | defines['Comments'] = 'Installs Mercurial version %s' % version |
|
442 | defines['Comments'] = 'Installs Mercurial version %s' % version | |
416 |
defines['VCRedistSrcDir'] = str( |
|
443 | defines['VCRedistSrcDir'] = str(build_dir) | |
417 | if extra_features: |
|
444 | if extra_features: | |
418 | assert all(';' not in f for f in extra_features) |
|
445 | assert all(';' not in f for f in extra_features) | |
419 | defines['MercurialExtraFeatures'] = ';'.join(extra_features) |
|
446 | defines['MercurialExtraFeatures'] = ';'.join(extra_features) |
General Comments 0
You need to be logged in to leave comments.
Login now