@choochmeque/tauri-windows-bundle
v0.1.28
Published
MSIX packaging tool for Tauri apps - Windows Store ready bundles
Maintainers
Readme
tauri-windows-bundle
MSIX packaging tool for Tauri apps - create Windows Store ready bundles with multiarch support.
Features
- MSIX Packaging - Create Store-ready MSIX packages
- Multiarch Support - Build for x64 and arm64 in one bundle
- tauri.conf.json Integration - Automatically reads app name, version, icons, and resources
- Code Signing - Support for PFX certificates and Windows certificate store
- Resource Indexing - Optional
resources.prigeneration for qualified assets - Windows Extensions - Share Target, File Associations, Protocol Handlers, Startup Task, Context Menus, Background Tasks, App Execution Alias, App Services, Toast Activation, Autoplay, Print Task Settings, Thumbnail/Preview Handlers
Prerequisites
- Rust with Windows targets
- Windows SDK (for signing)
# Install Rust targets for multiarch builds
rustup target add x86_64-pc-windows-msvc
rustup target add aarch64-pc-windows-msvcBundled msixbundle-cli
On Windows (x64 and arm64) the msixbundle-cli binary is shipped automatically as an optionalDependencies sidecar (@choochmeque/msixbundle-cli-win32) — no separate install is needed.
If you're on macOS or Linux (e.g. cross-compiling), or if you installed with --omit=optional (npm) / --no-optional (pnpm/yarn), the build command falls back to whatever msixbundle-cli is on your PATH and prompts to cargo install msixbundle-cli if it's missing.
Installation
# One-time setup (use @latest to ensure newest version)
npx @choochmeque/tauri-windows-bundle@latest init
# Or install as dev dependency
npm install -D @choochmeque/tauri-windows-bundleTip: Use
@latestwith npx to bypass cached versions:npx @choochmeque/tauri-windows-bundle@latest --version
Usage
Initialize
npx @choochmeque/tauri-windows-bundle initThis creates:
src-tauri/gen/windows/bundle.config.json- MSIX-specific configurationsrc-tauri/gen/windows/AppxManifest.xml.template- Manifest templatesrc-tauri/gen/windows/Assets/- Icons (copied fromsrc-tauri/icons/or placeholders)- Adds
@choochmeque/tauri-windows-bundleas devDependency - Adds
tauri:windows:buildscript to package.json
Note: If Tauri icons exist in src-tauri/icons/, they are automatically copied. The wide tile (310x150) is generated by centering the square icon.
Windows-specific icons: Set bundle.icon in tauri.windows.conf.json (or tauri.conf.json) to point at a different folder, and init will derive the asset source from there. For example, with
// tauri.windows.conf.json
{ "bundle": { "icon": ["icons/windows/32x32.png", "icons/windows/icon.ico"] } }init uses src-tauri/icons/windows/ (the parent dir of the first .png entry, resolved against src-tauri/) as the asset source. Inside that folder it looks for the MSIX-named files Tauri generates via tauri icon:
- Direct copy:
StoreLogo.png,Square44x44Logo.png,Square150x150Logo.png(each missing file becomes a placeholder). - Wide tile (
Wide310x150Logo.png) is generated from the first square icon found:Square150x150Logo.png→Square142x142Logo.png→icon.png→128x128.png. - Variant source (when
--scale/--target-size/--unplated/--light-unplatedis set):icon.png→Square310x310Logo.png→128x128.png.
If bundle.icon has no .png entries, the default src-tauri/icons/ is used.
Icon variants (optional)
Pass one or more flags to init to also generate the suffixed asset variants Windows uses for DPI scaling, taskbar/Start icons, and theme-aware tiles:
npx @choochmeque/tauri-windows-bundle init --all-variants| Flag | Files generated |
| ------------------ | ----------------------------------------------------------------------------------------- |
| --scale | <asset>.scale-100/125/150/200/400.png for StoreLogo, Square44x44Logo, Square150x150Logo |
| --target-size | Square44x44Logo.targetsize-16/24/32/48/256.png (taskbar, Start list, jump lists) |
| --unplated | Square44x44Logo.targetsize-N_altform-unplated.png (transparent background) |
| --light-unplated | Square44x44Logo.targetsize-N_altform-lightunplated.png (light theme) |
| --all-variants | All of the above |
Variants are sourced from the highest-resolution Tauri icon found, in this order: src-tauri/icons/icon.png → Square310x310Logo.png → 128x128.png. If none are present, variant generation is skipped with a warning.
Passing any variant flag also flips resourceIndex.enabled to true in the generated bundle.config.json, because Windows only resolves suffixed assets through a resources.pri file built by --makepri.
Configure
Edit src-tauri/gen/windows/bundle.config.json:
{
"publisher": "CN=YourCompany",
"publisherDisplayName": "Your Company Name",
"capabilities": {
"general": ["internetClient"]
},
"signing": {
"pfx": null,
"pfxPassword": null
},
"resourceIndex": {
"enabled": false,
"keepConfig": false
}
}publisher and publisherDisplayName are optional in bundle.config.json. If omitted, publisher falls back to bundle.publisher from tauri.conf.json or tauri.windows.conf.json. If publisherDisplayName is omitted, it defaults to the resolved publisher value.
Capabilities are validated at build time. Three types are supported:
{
"capabilities": {
"general": ["internetClient", "internetClientServer", "privateNetworkClientServer"],
"device": ["webcam", "microphone", "location", "bluetooth"],
"restricted": ["broadFileSystemAccess", "allowElevation"]
}
}general- Standard capabilities (<Capability>)device- Device access (<DeviceCapability>)restricted- Requires Store approval (<rescap:Capability>)
Note: runFullTrust is always auto-added (required for Tauri apps).
resourceIndex.enabled generates resources.pri via msixbundle-cli --makepri before packing. Enable this when using qualified assets (for example, scale-specific logos like Square44x44Logo.scale-200.png).
resourceIndex.keepConfig keeps generated priconfig.xml in each AppxContent directory for debugging.
Auto-read from tauri.conf.json / tauri.windows.conf.json:
displayName←productNameversion←version(auto-converted to 4-part:1.0.0→1.0.0.0)description←bundle.shortDescriptionpublisher←bundle.publisher(fallback when not in bundle.config.json)icons←bundle.iconresources←bundle.resourcessigning←bundle.windows.certificateThumbprint
Platform-specific config: Values in tauri.windows.conf.json override tauri.conf.json using JSON Merge Patch (RFC 7396). This lets you define Windows-specific settings like identifier, productName, or bundle.publisher separately.
Build
# Build x64 only (default, uses cargo, release mode)
pnpm tauri:windows:build
# Build multiarch bundle (x64 + arm64)
pnpm tauri:windows:build --arch x64,arm64
# Debug build (release is default)
pnpm tauri:windows:build --debug
# Use different build runner (pnpm, npm, yarn, bun, etc.)
pnpm tauri:windows:build --runner pnpm
pnpm tauri:windows:build --runner npm
# Re-derive Assets/ from bundle.icon (overwrites manual edits in
# src-tauri/gen/windows/Assets/). Variant flags configured at init are
# replayed from bundle.config.json's `assets.variants`.
pnpm tauri:windows:build --regenerate-assetsBy default build copies whatever is in src-tauri/gen/windows/Assets/ verbatim, so hand-edited tile icons persist across builds. Pass --regenerate-assets to refresh that directory from the icons folder resolved via bundle.icon (the same logic init uses).
Output
target/msix/
├── MyApp_x64.msix
├── MyApp_arm64.msix # if --arch x64,arm64
└── MyApp.msixbundle # combined bundleCLI Reference
npx @choochmeque/tauri-windows-bundle init [options]
-p, --path <path> Path to Tauri project
--scale Generate .scale-100/125/150/200/400 PNG variants
--target-size Generate .targetsize-16/24/32/48/256 PNG variants for Square44x44Logo
--unplated Generate _altform-unplated targetsize variants
--light-unplated Generate _altform-lightunplated targetsize variants
--all-variants Shortcut for all four variant families above
npx @choochmeque/tauri-windows-bundle build [options]
--arch <archs> Architectures (comma-separated: x64,arm64) [default: x64]
--debug Build in debug mode (release is default)
--min-windows <ver> Minimum Windows version [default: 10.0.17763.0]
--runner <runner> Build runner (cargo, pnpm, npm, yarn, bun) [default: cargo]
--verbose Show full build output instead of spinner
--regenerate-assets Regenerate gen/windows/Assets/ from bundle.icon
(overwrites manual edits)
npx @choochmeque/tauri-windows-bundle extension list
-p, --path <path> Path to Tauri project
npx @choochmeque/tauri-windows-bundle extension add <type>
<type> Extension type (see below)
-p, --path <path> Path to Tauri project
npx @choochmeque/tauri-windows-bundle extension remove <type> [name]
<type> Extension type (see below)
[name] Extension identifier (required for most types)
-p, --path <path> Path to Tauri project
Extension types:
file-association Associate file types with your app
protocol Register URL protocol handlers (myapp://)
share-target Receive shared content from other apps
startup-task Run app on Windows login
context-menu Add right-click menu items in Explorer
background-task Run tasks when app is not in foreground
app-execution-alias Run app from command line (e.g., myapp)
app-service Allow other apps to call into your app
toast-activation Handle toast notification clicks
autoplay Launch when media/device is inserted
print-task-settings Custom print settings UI
thumbnail-handler Custom file thumbnails in Explorer
preview-handler Custom file previews in ExplorerWindows Extensions
File Associations
npx @choochmeque/tauri-windows-bundle extension add file-association
# Prompts for: name, extensions, descriptionAlternatively, declare file associations in tauri.conf.json under the standard
bundle.fileAssociations key and they are picked up automatically at build time:
{
"bundle": {
"fileAssociations": [
{ "ext": ["ics"], "name": "iCalendar", "description": "iCalendar event file" },
],
},
}bundle.config.json entries are merged on top and win on a name collision, so
existing Windows-only overrides keep working.
Protocol Handlers
npx @choochmeque/tauri-windows-bundle extension add protocol
# Prompts for: protocol name, display nameShare Target
# Enable
npx @choochmeque/tauri-windows-bundle extension add share-target
# Disable
npx @choochmeque/tauri-windows-bundle extension remove share-targetStartup Task
Run your app automatically when Windows starts.
# Enable
npx @choochmeque/tauri-windows-bundle extension add startup-task
# Disable
npx @choochmeque/tauri-windows-bundle extension remove startup-taskContext Menu
Add right-click menu items in Windows Explorer.
npx @choochmeque/tauri-windows-bundle extension add context-menu
# Prompts for: menu name, file types, display nameBackground Task
Run tasks when app is not in foreground.
npx @choochmeque/tauri-windows-bundle extension add background-task
# Prompts for: task name, type (timer/systemEvent/pushNotification)List Extensions
npx @choochmeque/tauri-windows-bundle extension listApp Execution Alias
Run your app from command line (e.g., myapp instead of full path).
npx @choochmeque/tauri-windows-bundle extension add app-execution-alias
# Prompts for: alias nameApp Service
Allow other apps to call into your app.
npx @choochmeque/tauri-windows-bundle extension add app-service
# Prompts for: service nameToast Activation
Handle toast notification clicks and actions, including cold-start activations from Action Center after the app has exited.
# Enable
npx @choochmeque/tauri-windows-bundle extension add toast-activation
# Prompts for: CLSID (leave empty to auto-generate from app identifier)
# Disable
npx @choochmeque/tauri-windows-bundle extension remove toast-activationEmits both the com:Extension Category="windows.comServer" (so Windows knows which exe to launch on activation) and the desktop:Extension Category="windows.toastNotificationActivation" (binding the toast click to the CLSID).
Autoplay
Launch your app when media or devices are inserted.
npx @choochmeque/tauri-windows-bundle extension add autoplay
# Prompts for: verb, action display name, event type (content/device)Print Task Settings
Add custom print settings UI.
# Enable
npx @choochmeque/tauri-windows-bundle extension add print-task-settings
# Disable
npx @choochmeque/tauri-windows-bundle extension remove print-task-settingsThumbnail Handler
Provide custom thumbnails for your file types in Explorer.
npx @choochmeque/tauri-windows-bundle extension add thumbnail-handler
# Prompts for: CLSID, file typesPreview Handler
Provide custom file previews in Explorer.
npx @choochmeque/tauri-windows-bundle extension add preview-handler
# Prompts for: CLSID, file typesList Extensions
npx @choochmeque/tauri-windows-bundle extension listRemove Extension
npx @choochmeque/tauri-windows-bundle extension remove file-association myfiles
npx @choochmeque/tauri-windows-bundle extension remove protocol myapp
npx @choochmeque/tauri-windows-bundle extension remove context-menu open-with-myapp
npx @choochmeque/tauri-windows-bundle extension remove background-task sync-task
npx @choochmeque/tauri-windows-bundle extension remove app-execution-alias myapp
npx @choochmeque/tauri-windows-bundle extension remove app-service com.myapp.service
npx @choochmeque/tauri-windows-bundle extension remove autoplay openCode Signing
Option 1: PFX Certificate
{
"signing": {
"pfx": "path/to/certificate.pfx",
"pfxPassword": null
}
}Set password via environment variable:
export MSIX_PFX_PASSWORD=your-passwordOption 2: Windows Certificate Store
Use thumbprint from tauri.conf.json:
{
"bundle": {
"windows": {
"certificateThumbprint": "ABC123..."
}
}
}GitHub Actions
Example workflow for automated MSIX builds.
Note: Run
npx @choochmeque/tauri-windows-bundle@latest initlocally first to generate the required configuration files, then commit them to your repository.
name: Build Windows MSIX
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Setup Rust
uses: dtolnay/rust-action@stable
with:
targets: x86_64-pc-windows-msvc, aarch64-pc-windows-msvc
- name: Install dependencies
run: pnpm install
# On Windows runners the @choochmeque/msixbundle-cli-win32 sidecar is
# installed automatically via optionalDependencies. On non-Windows runners
# (or with --no-optional) install it explicitly:
# - run: cargo install msixbundle-cli
- name: Build MSIX bundle
run: pnpm tauri:windows:build --arch x64,arm64 --runner pnpm
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: msix-bundle
path: src-tauri/target/msix/*.msixbundleOutput will be in src-tauri/target/msix/YourApp.msixbundle.
