Cross-platform Python library for creating, extracting and signing MSIX packages. Wraps makeappx.exe (Windows) or makemsix (Linux/macOS) — binaries are resolved automatically and built from source if needed.
- Python 3.10+
| Platform | Requirements |
|---|---|
| Windows | Windows 10 SDK |
| Linux | git, cmake ≥ 3.29.0, clang, osslsigncode (for signing) |
| macOS | git, cmake ≥ 3.29.0, clang (Xcode CLT), osslsigncode (for signing) |
On Linux/macOS, makemsix is compiled automatically from microsoft/msix-packaging on first use and cached in ~/.cache/pymsix/.
pip install pymsixfrom msix import MsixPacker
packer = MsixPacker()
packer.pack("path/to/app-content/", "output/MyApp.msix")
packer.unpack("output/MyApp.msix", "path/to/extracted/")The app-content/ directory must contain a valid AppxManifest.xml.
packer = MsixPacker(sign_binary="/usr/local/bin/osslsigncode")
packer.sign("output/MyApp.msix", "cert.pfx", pfx_password="s3cr3t")| Parameter | Description |
|---|---|
binary |
Path to makeappx.exe or makemsix. Auto-resolved if omitted. |
sign_binary |
Path to signtool.exe (Windows) or osslsigncode (Linux/macOS). Auto-resolved if omitted. |
verbose |
Print the command being executed. |
pack(content_dir, output_package, *, overwrite=True, skip_validation=False, hash_algorithm="SHA256")
Creates an MSIX package from a directory. Returns the path to the created file.
Note:
overwrite,skip_validation, andhash_algorithmare only supported on Windows (makeappx.exe). These parameters are silently ignored on Linux and macOS, asmakemsixdoes not support them.
Extracts an MSIX package into a directory. Returns the path to the extraction directory.
Note:
overwriteis only supported on Windows (makeappx.exe). These parameter is silently ignored on Linux and macOS, asmakemsixdoes not support it.
sign(package, pfx, *, pfx_password=None, timestamp_url="http://timestamp.digicert.com", digest_algorithm="SHA256")
Signs an MSIX package in-place using a PFX certificate. Returns the path to the signed file.
On Windows, signtool.exe is used (auto-detected from the Windows SDK). On Linux and macOS, osslsigncode must be installed:
# Debian/Ubuntu
sudo apt install osslsigncode
# Fedora/RHEL
sudo dnf install osslsigncode
# macOS
brew install osslsigncode| Parameter | Description |
|---|---|
package |
Path to the .msix file to sign. |
pfx |
Path to the .pfx certificate file. |
pfx_password |
Password for the .pfx file. Omit if not password-protected. |
timestamp_url |
RFC 3161 timestamp server URL. Set to "" to disable timestamping. |
digest_algorithm |
Digest algorithm for the signature (default "SHA256"). |
binaryconstructor argumentPYMSIX_BINARYenvironment variable- Cached binary at
~/.cache/pymsix/ - Windows SDK
makeappx.exe(Windows only) - Build from source (Linux/macOS)
sign_binaryconstructor argumentPYMSIX_SIGN_BINARYenvironment variable- Windows SDK
signtool.exe(Windows only) osslsigncodeonPATH(Linux/macOS)
MIT