This sample demonstrates how to use winapp CLI with a C++ application built with CMake to add package identity and package as MSIX.
For a complete step-by-step guide, see the C++ Getting Started Guide.
- Basic C++ console application built with CMake
- Using Windows App Model APIs to retrieve package identity
- Using
winapp runto run the app packaged (registers a loose layout package, just like a real MSIX install) - MSIX packaging with app manifest and assets
- Visual Studio Native Desktop workload or Visual Studio with C++ development tools
- CMake 3.20 or later
- WinApp CLI installed
winapp restorecmake -B build
cmake --build build --config Debug.\build\Debug\cpp-app.exeOutput should be: "Not packaged"
winapp run .\build\DebugThis registers a loose layout package (just like a real MSIX install), then launches the app via its execution alias so console output stays in the current terminal.
Output should show the Package Family Name.
Note: A console app is launched through an execution alias automatically, so
--with-aliasis only needed to force one for a windowed app. This sample'sappxmanifest.xmldeclares its ownuap5:ExecutionAlias, which winapp uses as-is; otherwise winapp stages one into the AppX layout for you. Add one to an appxmanifest.xml withwinapp manifest add-alias.