Agent skill
per-user-wix-msi-packaging
Package a WPF desktop app as a repo-buildable per-user MSI with WiX SDK
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/per-user-wix-msi-packaging
SKILL.md
Context
Use this when a Windows desktop app needs a real .msi artifact, must install without admin elevation, and the repo does not already have an installer project.
Patterns
- Add a dedicated WiX SDK project to the repo and wire it into the solution so MSI generation is a first-class build path.
- Keep packaging self-contained in the installer project: build any web assets, publish the desktop project to a staging folder, and harvest that staged payload instead of hand-copying binaries.
- For WPF/WebView2 apps that ship placeholder web content in
WebApp, overwrite the publishedWebAppfolder with the real builtdistoutput before packaging so installed bits do not fall back to placeholder UI. - Set the WiX package scope to
perUserand install under a user-writable path such as%LocalAppData%\Programs\{Product}. - Add only user-scoped shell integration (for example, Start Menu shortcuts backed by
HKCUkey paths) so the installer stays non-admin. - Expect legacy MSI ICE validation noise when harvesting many files into a user-profile root; document and suppress the specific ICEs you intentionally accept rather than moving the install to a machine-wide folder.
- If the installer publishes the desktop project directly, framework retargets usually belong in the application/test projects, not the WiX project; verify the staged publish output by checking
obj\desktop-publish\*.runtimeconfig.jsonfor the expectedruntimeOptions.tfm. - If distribution must be a single
.msi, do not rely onCompressed="yes"alone—set<MediaTemplate EmbedCab="yes" />so WiX embedscab1.cabinto the MSI instead of writing a sidecar cabinet. Validate by checking the release folder has no external.caband, if needed, confirm the MSIMedia.Cabinetvalue is#cab1.cab. - When the desktop app needs branding, generate one canonical multi-resolution
.icoand reuse that exact file everywhere: WPF<ApplicationIcon>for the built.exe,Window.Iconfor taskbar/Alt+Tab/native shell pickup, any custom titlebar image bound toWindow.Icon, and WiX<Icon>+ARPPRODUCTICON/shortcutIconso installer and uninstall surfaces stay consistent with the shipped executable. - For rebuild-only validation, prove the latest WebUI actually ships in the MSI with a two-step check: compare hashes between
src\PanelNester.WebUI\distandinstaller\PanelNester.Installer\obj\desktop-publish\WebApp, then query the built MSIFiletable through the Windows Installer COM API to confirm every current dist asset filename is present in the package.
Examples
installer\PanelNester.Installer\PanelNester.Installer.wixprojinstaller\PanelNester.Installer\Product.wxsdotnet build .\installer\PanelNester.Installer\PanelNester.Installer.wixproj -c Release -nologoinstaller\PanelNester.Installer\obj\desktop-publish\PanelNester.Desktop.runtimeconfig.json
Anti-Patterns
- Requiring a manual Visual Studio publish step before the MSI can be built
- Packaging the desktop publish output without replacing placeholder
WebAppcontent with the real web build - Using
Program Filesfor a supposedly per-user MSI - Treating WiX ICE suppression as a default instead of a documented, intentional tradeoff tied to per-user harvested payloads
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?