Installers for all platforms and related fixes #1
@@ -381,8 +381,6 @@ def build_velopack(version: str) -> Path:
|
||||
setup = next(iter(sorted(releases_dir.glob(f"*{artifact_ext}"))), None)
|
||||
if setup is None:
|
||||
raise RuntimeError(f"vpk produced no *{artifact_ext} in {releases_dir}")
|
||||
if sys.platform == "darwin":
|
||||
minimize_macos_installer(setup)
|
||||
artifact = (
|
||||
_REPO_ROOT
|
||||
/ "build"
|
||||
@@ -393,28 +391,6 @@ def build_velopack(version: str) -> Path:
|
||||
return artifact
|
||||
|
||||
|
||||
def minimize_macos_installer(pkg: Path) -> None:
|
||||
"""Strip the Destination Select page from the Velopack-generated pkg.
|
||||
|
||||
Velopack hardcodes two install domains (currentUserHome + localSystem) in
|
||||
the distribution XML, which makes macOS Installer show a Destination
|
||||
Select page. With a single domain that page is skipped, leaving Apple's
|
||||
minimum: Introduction, Install, Summary. Installs go to /Applications as
|
||||
before (the component pkg is non-relocatable with a fixed location).
|
||||
"""
|
||||
expanded = pkg.with_name(pkg.stem + "-expanded")
|
||||
shutil.rmtree(expanded, ignore_errors=True)
|
||||
subprocess.run(["pkgutil", "--expand", str(pkg), str(expanded)], check=True)
|
||||
dist_xml = expanded / "Distribution"
|
||||
xml = dist_xml.read_text()
|
||||
new_xml, count = re.subn(r"<domains [^>]*/>", '<domains enable_localSystem="true" />', xml)
|
||||
if count != 1:
|
||||
raise RuntimeError("Unexpected distribution.xml: <domains> not found")
|
||||
dist_xml.write_text(new_xml)
|
||||
subprocess.run(["pkgutil", "--flatten", str(expanded), str(pkg)], check=True)
|
||||
shutil.rmtree(expanded)
|
||||
|
||||
|
||||
def read_version() -> str:
|
||||
"""Read version via setuptools_scm (same logic as hatch-vcs)."""
|
||||
return setuptools_scm.get_version(root=str(_REPO_ROOT))
|
||||
|
||||
Reference in New Issue
Block a user