Labsco
microsoft logo

winapp-setup

✓ Official1,100

by microsoft · part of microsoft/winappcli

Set up a Windows app project for MSIX packaging, Windows SDK access, or Windows API usage. Use when adding Windows support to an Electron, .NET, C++, Rust,…

🔥🔥🔥🔥✓ VerifiedFreeQuick setup
🧰 Not standalone. This skill ships with microsoft/winappcli and only works together with that tool — install the tool first, then add this skill.

This is the playbook your agent receives when the skill activates — you don't need to read it to use the skill, but it's here to audit before installing.


name: winapp-setup description: Set up a Windows app project for MSIX packaging, Windows SDK access, or Windows API usage. Use when adding Windows support to an Electron, .NET, C++, Rust, Flutter, or Tauri project, or restoring SDK packages after cloning. version: 0.4.1

When to use

Use this skill when:

  • Adding Windows platform support to an existing project (Electron, .NET, C++, Rust, Flutter, Tauri, etc.)
  • Cloning a repo that already uses winapp and need to restore SDK packages
  • Updating SDK versions to get the latest Windows SDK or Windows App SDK

Key concepts

Package.appxmanifest is the most important file winapp creates — it declares your app's identity, capabilities, and visual assets. Most winapp commands require it (package, run, cert generate --manifest).

winapp.yaml is only needed for SDK version management via restore/update. Projects that already reference Windows SDK packages (e.g., via NuGet in a .csproj) can use winapp commands without it.

.winapp/ is the local folder where SDK packages and generated projections (e.g., CppWinRT headers) are stored. This folder is .gitignored — team members recreate it via winapp restore.

Recommended workflow

  1. Initializewinapp init . --use-defaults in your existing project
  2. Configure — edit Package.appxmanifest to add capabilities your app needs (e.g., runFullTrust, internetClient)
  3. Build — build your app as usual (dotnet build, cmake, npm run build, etc.)
  4. Run with identitywinapp run ./bin/Debug to register identity and launch for debugging
  5. Packagewinapp package ./bin/Release --cert ./devcert.pfx to create MSIX

Tips

  • Use --use-defaults (alias: --no-prompt) in CI/CD pipelines and scripts to avoid interactive prompts. Non-interactive environments (piped stdin, CI runners) are auto-detected and will use defaults automatically with a warning.
  • If you only need Package.appxmanifest without SDK setup, use winapp manifest generate instead of init
  • winapp init is idempotent for the config file — re-running it won't overwrite an existing winapp.yaml unless you use --config-only
  • For Electron projects, prefer npm install --save-dev @microsoft/winappcli and use npx winapp init instead of the standalone CLI

Related skills

  • After setup, see winapp-manifest to customize your Package.appxmanifest
  • Ready to package? See winapp-package to create an MSIX installer
  • Need a certificate? See winapp-signing for certificate generation
  • Not sure which command to use? See winapp-troubleshoot for a command selection flowchart

Command Reference

winapp init

Start here for initializing a Windows app with required setup. Sets up everything needed for Windows app development: creates Package.appxmanifest with default assets, downloads Windows SDK and Windows App SDK packages, and generates projections. When SDK packages are managed (--setup-sdks stable/preview/experimental), also creates winapp.yaml to pin versions for 'restore'/'update'; with --setup-sdks none (e.g., for Rust/Tauri projects that bring their own SDK bindings), no winapp.yaml is created. Interactive by default; automatically uses defaults in non-interactive environments (use --use-defaults to skip prompts explicitly). Use 'restore' instead if you cloned a repo that already has winapp.yaml. Use 'manifest generate' if you only need a manifest, or 'cert generate' if you need a development certificate for code signing.

Arguments

<!-- auto-generated from cli-schema.json -->
ArgumentRequiredDescription
<base-directory>NoBase/root directory for the winapp workspace, for consumption or installation.

Options

<!-- auto-generated from cli-schema.json -->
OptionDescriptionDefault
--config-dirDirectory to read/store configuration (default: the selected project directory, or current directory if no project is detected)(none)
--config-onlyOnly handle configuration file operations (create if missing, validate if exists). Skip package installation and other workspace setup steps.(none)
--ignore-configDon't use configuration file for version management(none)
--no-gitignoreDon't update .gitignore file(none)
--setup-sdksSDK installation mode: 'stable' (default), 'preview', 'experimental', or 'none' (skip SDK installation)(none)
--use-defaultsDo not prompt; requires an explicit project directory (e.g., winapp init . --use-defaults)(none)

winapp restore

Use after cloning a repo or when .winapp/ folder is missing. Reinstalls SDK packages from existing winapp.yaml without changing versions. Requires winapp.yaml (created by 'init'). To check for newer SDK versions, use 'update' instead.

Arguments

<!-- auto-generated from cli-schema.json -->
ArgumentRequiredDescription
<base-directory>NoBase/root directory for the winapp workspace

Options

<!-- auto-generated from cli-schema.json -->
OptionDescriptionDefault
--config-dirDirectory to read configuration from (default: current directory)(none)

winapp update

Check for and install newer SDK versions. Updates winapp.yaml with latest versions and reinstalls packages. Requires existing winapp.yaml (created by 'init'). Use --setup-sdks preview for preview SDKs. To reinstall current versions without updating, use 'restore' instead.

Options

<!-- auto-generated from cli-schema.json -->
OptionDescriptionDefault
--setup-sdksSDK installation mode: 'stable' (default), 'preview', 'experimental', or 'none' (skip SDK installation)(none)

winapp run

Creates packaged layout, registers the Application, and launches the packaged application.

Arguments

<!-- auto-generated from cli-schema.json -->
ArgumentRequiredDescription
<input-folder>YesInput folder containing the app to run
<app-args>NoArguments to pass to the launched application. Provide after -- (e.g., winapp run . -- --flag value).

Options

<!-- auto-generated from cli-schema.json -->
OptionDescriptionDefault
--argsCommand-line arguments to pass to the application. Alternatively, use -- followed by arguments to avoid escaping (e.g., winapp run . -- --flag value).(none)
--cleanRemove the existing package's application data (LocalState, settings, etc.) before re-deploying. By default, application data is preserved across re-deployments.(none)
--debug-outputCapture OutputDebugString messages and first-chance exceptions from the launched application. Only one debugger can attach to a process at a time, so other debuggers (Visual Studio, VS Code) cannot be used simultaneously. Use --no-launch instead if you need to attach a different debugger. Cannot be combined with --no-launch or --json.(none)
--detachLaunch the application and return immediately without waiting for it to exit. Useful for CI/automation where you need to interact with the app after launch. Prints the PID to stdout (or in JSON with --json).(none)
--executablePath to the executable relative to the input folder. Use to disambiguate when the manifest contains a $targetnametoken$ placeholder and multiple .exe files are present in the input folder.(none)
--jsonFormat output as JSON(none)
--manifestPath to the Package.appxmanifest (default: auto-detect from input folder or current directory)(none)
--no-launchOnly create the debug identity and register the package without launching the application(none)
--output-appx-directoryOutput directory for the loose layout package. If not specified, a directory named AppX inside the input-folder directory will be used.(none)
--symbolsDownload symbols from Microsoft Symbol Server for richer native crash analysis. Only used with --debug-output. First run downloads symbols and caches them locally; subsequent runs use the cache.(none)
--unregister-on-exitUnregister the development package after the application exits. Only removes packages registered in development mode.(none)
--with-aliasLaunch the app using its execution alias instead of AUMID activation. The app runs in the current terminal with inherited stdin/stdout/stderr. Requires a uap5:ExecutionAlias in the manifest. Use "winapp manifest add-alias" to add an execution alias to the manifest.(none)