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\Debug --with-aliasThis 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: The
--with-aliasflag requires auap5:ExecutionAliasin the manifest. This sample'sappxmanifest.xmlalready includes one. You can add one to an appxmanifest.xml withwinapp manifest add-alias.