Add per-user MSI installer for Windows; strip Mark-of-the-Web in frozen ZIP builds
Files extracted from a downloaded ZIP carry a Zone.Identifier stream and the .NET Framework CLR refuses to load such assemblies, so pythonnet failed with 'Failed to resolve Python.Runtime.Loader.Initialize'. MSI-installed files have no MOTW; the winmain strip fixes the ZIP distribution.
This commit is contained in:
+6
-4
@@ -67,13 +67,14 @@ def load_token() -> str:
|
||||
# ZIP + dist helpers
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Matches MediaHive-1.2.3-win64.zip, MediaHive-1.2.3-macos-arm64.dmg, etc.
|
||||
# Matches MediaHive-1.2.3-win64.zip, MediaHive-1.2.3-win64.msi,
|
||||
# MediaHive-1.2.3-macos-arm64.dmg, etc.
|
||||
# Rejects dev/dirty versions like MediaHive-1.2.3.dev0+gabcd-win64.zip
|
||||
_CLEAN_ARTIFACT_RE = re.compile(r"^MediaHive-(\d+(?:\.\d+)*)-([A-Za-z0-9._-]+)\.(?:zip|dmg)$")
|
||||
_CLEAN_ARTIFACT_RE = re.compile(r"^MediaHive-(\d+(?:\.\d+)*)-([A-Za-z0-9._-]+)\.(?:zip|dmg|msi)$")
|
||||
|
||||
|
||||
def find_releasable_artifacts() -> list[tuple[Path, str, str]]:
|
||||
"""Return (path, version, platform_tag) for clean-versioned ZIPs/DMGs in build/."""
|
||||
"""Return (path, version, platform_tag) for clean-versioned ZIPs/DMGs/MSIs in build/."""
|
||||
build_dir = REPO_ROOT / "build"
|
||||
results = []
|
||||
for p in sorted(build_dir.glob("MediaHive-*")):
|
||||
@@ -183,6 +184,7 @@ def upload_asset(
|
||||
mime = {
|
||||
".zip": "application/zip",
|
||||
".dmg": "application/x-apple-diskimage",
|
||||
".msi": "application/x-msi",
|
||||
}.get(path.suffix, "application/octet-stream")
|
||||
print(f"Uploading {path.name} ({size_mb:.1f} MB) ...")
|
||||
with Path(path).open("rb") as fh:
|
||||
@@ -228,7 +230,7 @@ def main() -> None:
|
||||
artifacts = find_releasable_artifacts()
|
||||
if not artifacts:
|
||||
print(
|
||||
"No clean-versioned ZIPs/DMGs found in build/.\n"
|
||||
"No clean-versioned ZIPs/DMGs/MSIs found in build/.\n"
|
||||
"Run scripts/guibuild.py first.",
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user