GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — winappCli/samples/cpp-app at main · microsoft/winappCli

Expand file tree

/

cpp-app

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

cpp-app

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Assets
Assets
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
README.md
README.md
 
 
appxmanifest.xml
appxmanifest.xml
 
 
main.cpp
main.cpp
 
 
test.Tests.ps1
test.Tests.ps1
 
 
winapp.yaml
winapp.yaml
 
 

README.md

Outline

C++ Sample Application

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.

What This Sample Shows

  • Basic C++ console application built with CMake
  • Using Windows App Model APIs to retrieve package identity
  • Using winapp run to run the app packaged (registers a loose layout package, just like a real MSIX install)
  • MSIX packaging with app manifest and assets

Prerequisites

  • Visual Studio Native Desktop workload or Visual Studio with C++ development tools
  • CMake 3.20 or later
  • WinApp CLI installed

Building and Running

Restore dependencies

winapp restore

Build the Application

cmake -B build
cmake --build build --config Debug

Run without Identity

.\build\Debug\cpp-app.exe

Output should be: "Not packaged"

Run with Identity (Debug)

winapp run .\build\Debug

This 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-alias is only needed to force one for a windowed app. This sample's appxmanifest.xml declares its own uap5:ExecutionAlias, which winapp uses as-is; otherwise winapp stages one into the AppX layout for you. Add one to an appxmanifest.xml with winapp manifest add-alias.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.