Skip to content

Add Windows installation packages in .msixbundle format - #698

Open
linghengqian wants to merge 2 commits into
version-fox:mainfrom
linghengqian:msix
Open

Add Windows installation packages in .msixbundle format#698
linghengqian wants to merge 2 commits into
version-fox:mainfrom
linghengqian:msix

Conversation

@linghengqian

Copy link
Copy Markdown
Contributor

@linghengqian
linghengqian marked this pull request as ready for review August 21, 2026 16:28
Copilot AI lite review requested due to automatic review settings August 21, 2026 16:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Windows .msixbundle packages with multi-architecture builds, signing support, CI validation, release publishing, and English/Chinese documentation.

Changes:

  • Adds MSIX manifests, assets, packaging scripts, and E2E tests.
  • Integrates release and CI workflows.
  • Adds installation documentation and generated-artifact exclusions.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Review result
scripts/e2e-msix-test.ps1 Critical (1 vote): Uninstall uses a wildcard and may remove an unrelated or multiple existing packages; scope it to the exact package identity.
packaging/msix/make-msix.ps1 Moderate (4 votes): main.version does not set internal.RuntimeVersion, so packaged binaries can report the wrong version. Moderate (4 votes): Dropping prerelease components causes prerelease and stable packages to share the same MSIX version.
packaging/msix/gen-assets.ps1 No issue identified in the final review.
packaging/msix/AppxManifest.xml Critical (1 vote): The packaged self-updater cannot write beside an MSIX-installed executable; disable or redirect self-upgrade and clearly report the limitation.
docs/zh-hans/guides/uninstallation.md No issue identified in the final review.
docs/zh-hans/guides/quick-start.md No issue identified in the final review.
docs/zh-hans/guides/msix.md No issue identified in the final review.
docs/guides/uninstallation.md No issue identified in the final review.
docs/guides/quick-start.md No issue identified in the final review.
docs/guides/msix.md No issue identified in the final review.
docs/.vitepress/zh.ts No issue identified in the final review.
docs/.vitepress/en.ts No issue identified in the final review.
AGENTS.md No issue identified in the final review.
.gitignore Moderate (3 votes): Add packaging/msix/signing.pfx to prevent generated private signing keys from being accidentally committed.
.github/workflows/e2e-tests.yml Critical (2 votes): The uploaded artifact includes the private PFX signing key; exclude it from the artifact or store and delete it outside the uploaded directory.
.github/workflows/compile-msix.yml No issue identified in the final review.
Suppressed comments (5)

docs/guides/msix.md:36

  • Importing into Cert:\LocalMachine\TrustedPeople requires an elevated PowerShell session. Without documenting that requirement, the command commonly fails with access denied for a normal user; mention the elevation requirement or use the current-user trusted store if that is the intended installation path.
Import-PfxCertificate -FilePath vfox.pfx -CertStoreLocation Cert:\LocalMachine\TrustedPeople -Password $password

docs/zh-hans/guides/msix.md:36

  • 导入 Cert:\LocalMachine\TrustedPeople 需要以提升权限运行 PowerShell。当前文档没有说明这一点,普通用户执行该命令通常会收到拒绝访问错误;请注明需要管理员权限,或在确认安装流程支持的情况下改用当前用户的受信任存储。
Import-PfxCertificate -FilePath vfox.pfx -CertStoreLocation Cert:\LocalMachine\TrustedPeople -Password $password

packaging/msix/make-msix.ps1:196

  • Publisher is interpolated directly into an XML attribute. A valid certificate subject containing &, <, >, or quotes will produce a malformed AppxManifest.xml before MakeAppx runs; escape the value as XML before replacing the token.
    $manifest = $manifest.Replace("@@PUBLISHER@@", $Publisher)

scripts/e2e-msix-test.ps1:264

  • This cleanup runs even when setup fails and removes every installed AppX package whose name contains vfox, not only the package created by this run. Running the E2E script locally can therefore uninstall an existing vfox installation; capture the pre-test package and remove only the package identity installed by this invocation.
    if ($null -ne (Get-AppxPackage -Name "*vfox*" -ErrorAction SilentlyContinue)) {
        Get-AppxPackage -Name "*vfox*" | Remove-AppxPackage -ErrorAction SilentlyContinue

scripts/e2e-msix-test.ps1:156

  • The post-install assertion also matches any package whose name contains vfox, so an unrelated pre-existing package can be reported as the package just installed and its version/publisher can make these assertions pass or fail incorrectly. Query the exact VersionFox.vfox identity and track the package installed by this run.
    Add-AppxPackage -Path $bundlePath
    $InstalledPackage = Get-AppxPackage -Name "*vfox*"

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/e2e-tests.yml
Comment thread packaging/msix/AppxManifest.xml
Comment thread packaging/msix/make-msix.ps1 Outdated
Comment thread packaging/msix/make-msix.ps1 Outdated
Comment thread scripts/e2e-msix-test.ps1 Outdated

@linghengqian linghengqian left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • All done.

Comment thread docs/guides/msix.md
Comment on lines +54 to +75
## Notes for maintainers

Release bundles are built by the `compile-msix` workflow on every release. Signing is optional; two options:

- **Self-signed certificate (no external account needed).** Generate one PFX and keep it stable across releases, then configure the repository secrets `MSIX_PFX_BASE64` (Base64-encoded certificate) and `MSIX_PFX_PASSWORD`; the subject must match the manifest publisher (`CN=VersionFox`). Releases are signed automatically from then on. Publish the public `.cer` file alongside the releases so users only need to import it once — because the signature stays identical across versions, upgrades are unaffected.
- **Publicly trusted certificate.** Packages signed by a CA-issued code-signing certificate or through [Azure Trusted Signing](https://learn.microsoft.com/azure/trusted-signing/overview) install without any user-side trust configuration. Obtaining one involves identity verification, and OV/EV certificates mandate hardware-protected private keys, which cannot be placed in CI secrets.

All packaging files reside in the [`packaging/msix/`](https://github.com/version-fox/vfox/tree/main/packaging/msix) directory:

| File | Purpose |
|------|---------|
| `AppxManifest.xml` | Manifest template; `@@VERSION@@`, `@@ARCHITECTURE@@` and `@@PUBLISHER@@` are substituted at build time. |
| `gen-assets.ps1` | Generates the tile icons from the repository logo (`logo.png`) via System.Drawing: transparent margins are cropped and the artwork is scaled onto a transparent canvas. PNG is required by AppX deployment (SVG is rejected), so these binaries are generated at build time instead of being committed. |
| `make-msix.ps1` | Builds `vfox` from source with Go, renders the manifest for each architecture, packs them with `MakeAppx.exe`, combines the packages into a `.msixbundle` and optionally signs it with `SignTool.exe`. |

Local packaging requires Windows, the [Windows SDK](https://developer.microsoft.com/windows/downloads/windows-sdk/) (provides `MakeAppx.exe` / `SignTool.exe`) and [Go](https://go.dev/dl/):

```powershell
./packaging/msix/make-msix.ps1 -Version 1.2.3
```

Artifacts are written to `packaging/msix/Output/`; `assets/`, `staging/` and `build/` are scratch directories and gitignored. Only stable versions without prerelease or build metadata are supported; they are normalized to four-part versions (`1.2.3` → `1.2.3.0`).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is the best way to write the documentation, but surely the signature shouldn't be provided by me, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Windows installation packages in .msixbundle format

2 participants