Skip to content

Commit c81824d

Browse files
[Docs] MS Learn review back fill (#529)
Some additional notes popped up when we reviewed our documentation to update on MS Learn so I wanted to backfill those changes. An issue with the port script also popped up so I wanted to fix that here as well. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 477e670 commit c81824d

10 files changed

Lines changed: 123 additions & 110 deletions

File tree

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Additional guides:
8383
| **Setup** | [init](usage.md#init), [restore](usage.md#restore), [update](usage.md#update) |
8484
| **Identity & Debugging** | [run](usage.md#run), [create-debug-identity](usage.md#create-debug-identity), [unregister](usage.md#unregister) |
8585
| **Packaging** | [pack](usage.md#pack) |
86-
| **Manifests** | [manifest generate](usage.md#manifest-generate), [manifest update-assets](usage.md#manifest), [manifest add-alias](usage.md#manifest-add-alias) |
86+
| **Manifests** | [manifest generate](usage.md#manifest-generate), [manifest update-assets](usage.md#manifest-update-assets), [manifest add-alias](usage.md#manifest-add-alias) |
8787
| **Certificates & Signing** | [cert generate](usage.md#cert-generate), [cert install](usage.md#cert-install), [sign](usage.md#sign), [create-external-catalog](usage.md#create-external-catalog) |
8888
| **Utilities** | [tool](usage.md#tool), [store](usage.md#store), [get-winapp-path](usage.md#get-winapp-path), [complete](usage.md#shell-completion) |
8989
| **UI Automation** | [ui](usage.md#ui) |

docs/guides/cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- mslearn: true -->
22
# Using winapp CLI with C++ and CMake
33

4-
This guide demonstrates how to use `winappcli` with a C++ application to debug with package identity and package your application as an MSIX.
4+
This guide demonstrates how to use the `winapp` CLI with a C++ application to debug with package identity and package your application as an MSIX.
55

66
Package identity is a core concept in the Windows app model. It allows your application to access specific Windows APIs (like Notifications, Security, AI APIs, etc), have a clean install/uninstall experience, and more.
77

docs/guides/dotnet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!-- mslearn: true -->
22
# Using winapp CLI with .NET
33

4-
> This guide should work for most .NET projects types. The steps have been tested with both console and UI-based projects like WPF. For working examples, check out the [dotnet-app](../../samples/dotnet-app) (console) and [wpf-app](../../samples/wpf-app) (WPF) samples in the samples folder.
4+
> This guide should work for most .NET project types. The steps have been tested with both console and UI-based projects like WPF. For working examples, check out the [dotnet-app](../../samples/dotnet-app) (console) and [wpf-app](../../samples/wpf-app) (WPF) samples in the samples folder.
55
6-
This guide demonstrates how to use `winappcli` with a .NET application to debug with package identity and package your application as an MSIX.
6+
This guide demonstrates how to use the `winapp` CLI with a .NET application to debug with package identity and package your application as an MSIX.
77

88
Package identity is a core concept in the Windows app model. It allows your application to access specific Windows APIs (like Notifications, Security, AI APIs, etc), have a clean install/uninstall experience, and more.
99

docs/guides/electron/cpp-notification-addon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ npx winapp node create-addon
1717
```
1818

1919
> [!NOTE]
20-
> This command might prompt your to install Python or required Visual Studio tools if you don't already have them installed.
20+
> This command might prompt you to install Python or required Visual Studio tools if you don't already have them installed.
2121
2222
This creates a `nativeWindowsAddon/` folder with:
2323
- `nativeWindowsAddon.cc` - Your C++ code that will call Windows APIs

docs/guides/electron/packaging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The `--manifest` option is optional. If not provided, it will look for a Package
8686

8787
The `--cert` option is also optional. If not provided, the msix will not be signed.
8888

89-
The `--out` option is also optional. If not provided, the current directory will be used.
89+
The `--output` option is also optional. If not provided, the current directory will be used.
9090

9191
The MSIX package will be created as `./out/<your-app-name>.msix`.
9292

docs/guides/flutter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
For a complete working example, check out the [Flutter sample](../../samples/flutter-app) in this repository.
55

6-
This guide demonstrates how to use `winappcli` with a Flutter application to add package identity and package your app as an MSIX.
6+
This guide demonstrates how to use the `winapp` CLI with a Flutter application to add package identity and package your app as an MSIX.
77

88
Package identity is a core concept in the Windows app model. It allows your application to access specific Windows APIs (like Notifications, Security, AI APIs, etc), have a clean install/uninstall experience, and more.
99

docs/guides/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- mslearn: true -->
22
# Using winapp CLI with Rust
33

4-
This guide demonstrates how to use `winappcli` with a Rust application to debug with package identity and package your application as an MSIX.
4+
This guide demonstrates how to use the `winapp` CLI with a Rust application to debug with package identity and package your application as an MSIX.
55

66
For a complete working example, check out the [Rust sample](../../samples/rust-app) in this repository.
77

docs/guides/tauri.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- mslearn: true -->
22
# Using winapp CLI with Tauri
33

4-
This guide demonstrates how to use `winappcli` with a Tauri application to debug with package identity and package your application as an MSIX.
4+
This guide demonstrates how to use the `winapp` CLI with a Tauri application to debug with package identity and package your application as an MSIX.
55

66
Package identity is a core concept in the Windows app model. It allows your application to access specific Windows APIs (like Notifications, Security, AI APIs, etc), have a clean install/uninstall experience, and more.
77

docs/usage.md

Lines changed: 100 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ winapp init [base-directory] [options]
4444
- Creates Package.appxmanifest
4545
- Sets up build tools and enables developer mode
4646
- Updates .gitignore to exclude generated files
47-
- Stores sharable files in the global cache directory
47+
- Stores shareable files in the global cache directory
4848

4949
**Automatic .NET project detection:**
5050

@@ -102,7 +102,7 @@ winapp restore [options]
102102
- Reads existing `winapp.yaml` configuration
103103
- Downloads/updates SDK packages to specified versions
104104
- Regenerates C++/WinRT headers and binaries
105-
- Stores sharable files in the global cache directory
105+
- Stores shareable files in the global cache directory
106106

107107
> [!NOTE]
108108
> For .NET projects initialized with `winapp init`, there is no `winapp.yaml`. Use `dotnet restore` to restore NuGet packages instead.
@@ -232,7 +232,7 @@ winapp create-debug-identity [entrypoint] [options]
232232

233233
**Options:**
234234

235-
- `--manifest <path>` - Path to AppxManifest.xml (default: auto-detect `Package.appxmanifest` or `appxmanifest.xml` in the current directory)
235+
- `--manifest <path>` - Path to the app manifest file, either `Package.appxmanifest` or `appxmanifest.xml` (default: auto-detect `Package.appxmanifest` or `appxmanifest.xml` in the current directory)
236236
- `--no-install` - Don't install the package after creation
237237
- `--keep-identity` - Keep the manifest identity as-is, without appending `.debug` to the package name and application ID
238238

@@ -318,6 +318,100 @@ winapp manifest generate
318318
winapp manifest generate ./src --package-name MyApp --publisher-name "CN=My Company" --if-exists overwrite
319319
```
320320

321+
#### manifest add-alias
322+
323+
Add an execution alias (`uap5:AppExecutionAlias`) to a Package.appxmanifest. This allows launching the packaged app from the command line by typing the alias name.
324+
325+
```bash
326+
winapp manifest add-alias [options]
327+
```
328+
329+
**Options:**
330+
331+
- `--name <alias>` - Alias name (e.g. `myapp.exe`). Default: inferred from the `Executable` attribute in the manifest.
332+
- `--manifest <path>` - Path to Package.appxmanifest (default: search current directory)
333+
- `--app-id <id>` - Application Id to add the alias to (default: first Application element)
334+
335+
**What it does:**
336+
337+
- Reads the manifest and infers the alias from the `Executable` attribute (preserving placeholders like `$targetnametoken$.exe`)
338+
- Adds the `uap5` namespace declaration if not already present
339+
- Adds an `<Extensions>` block with `<uap5:AppExecutionAlias>` inside the target Application element
340+
- If the alias already exists, reports it and exits successfully
341+
342+
**Examples:**
343+
344+
```bash
345+
# Add alias inferred from Executable attribute (e.g. $targetnametoken$.exe)
346+
winapp manifest add-alias
347+
348+
# Add alias with explicit name
349+
winapp manifest add-alias --name myapp.exe
350+
351+
# Add alias to specific manifest
352+
winapp manifest add-alias --manifest ./dist/Package.appxmanifest
353+
```
354+
355+
#### manifest update-assets
356+
357+
Generate all required MSIX image assets from a single source image.
358+
359+
```bash
360+
winapp manifest update-assets <image-path> [options]
361+
```
362+
363+
**Arguments:**
364+
365+
- `image-path` - Path to source image file (PNG, JPG, SVG, ICO, GIF, BMP, etc.)
366+
367+
**Options:**
368+
369+
- `--manifest <path>` - Path to Package.appxmanifest file (default: search current directory)
370+
- `--light-image <path>` - Path to a separate source image for light theme variants
371+
372+
**Description:**
373+
374+
Takes a single source image and generates a comprehensive set of MSIX image assets based on the manifest's asset references:
375+
376+
For each asset referenced in the manifest:
377+
- **5 scale variants** — base (no suffix), `.scale-125`, `.scale-150`, `.scale-200`, `.scale-400`
378+
379+
For the app icon (Square44x44Logo / AppList, 44×44 base):
380+
- **14 plated targetsize variants**`.targetsize-{16,20,24,30,32,36,40,48,60,64,72,80,96,256}`
381+
- **14 unplated targetsize variants**`.targetsize-{size}_altform-unplated`
382+
383+
Additionally:
384+
- **app.ico** — Multi-resolution ICO file (16, 24, 32, 48, 256) for shell integration. If an existing `.ico` file is found in the assets directory (e.g. `AppIcon.ico` from a project template), it is replaced in-place rather than creating a duplicate
385+
386+
With `--light-image`:
387+
- **Light theme targetsize variants**`.targetsize-{size}_altform-lightunplated` (app icon)
388+
- **Light theme scale variants**`.scale-{factor}_altform-colorful_theme-light` (tiles, store logo)
389+
390+
**SVG support:** SVG files are fully supported as source images. They are rendered as vectors directly at each target size, producing pixel-perfect results at all resolutions.
391+
392+
The command scales images proportionally while maintaining aspect ratio, centering them with transparent backgrounds when needed. Assets are saved to the `Assets` directory relative to the manifest location.
393+
394+
**Examples:**
395+
396+
```bash
397+
# Generate assets with auto-detected manifest
398+
winapp manifest update-assets mylogo.png
399+
400+
# Use an SVG source for best quality at all sizes
401+
winapp manifest update-assets mylogo.svg
402+
403+
# Specify manifest location explicitly
404+
winapp manifest update-assets mylogo.png --manifest ./dist/Package.appxmanifest
405+
406+
# Generate light theme variants from a separate image
407+
winapp manifest update-assets mylogo.png --light-image mylogo-light.png
408+
409+
# Use the same image for both (generates all MRT light theme qualifiers)
410+
winapp manifest update-assets mylogo.png --light-image mylogo.png
411+
412+
# With verbose output
413+
winapp manifest update-assets mylogo.png --verbose
414+
```
321415

322416
---
323417

@@ -347,6 +441,7 @@ winapp run <input-folder> [options]
347441
- `--unregister-on-exit` - Unregister the development package after the application exits. Only removes packages registered in development mode. Cannot be combined with `--no-launch`.
348442
- `--detach` - Launch 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`). Cannot be combined with `--no-launch`, `--debug-output`, `--with-alias`, or `--unregister-on-exit`.
349443
- `--clean` - Remove the existing package's application data (LocalState, settings, etc.) before re-deploying. By default, application data is preserved across re-deployments.
444+
- `--json` - Format output as JSON for programmatic consumption (e.g. CI/automation). Useful with `--detach` to capture the PID. Cannot be combined with `--with-alias` or `--debug-output`.
350445

351446
**Application data persistence:**
352447

@@ -466,101 +561,6 @@ winapp unregister --json
466561

467562
---
468563

469-
#### manifest add-alias
470-
471-
Add an execution alias (`uap5:AppExecutionAlias`) to a Package.appxmanifest. This allows launching the packaged app from the command line by typing the alias name.
472-
473-
```bash
474-
winapp manifest add-alias [options]
475-
```
476-
477-
**Options:**
478-
479-
- `--name <alias>` - Alias name (e.g. `myapp.exe`). Default: inferred from the `Executable` attribute in the manifest.
480-
- `--manifest <path>` - Path to Package.appxmanifest (default: search current directory)
481-
- `--app-id <id>` - Application Id to add the alias to (default: first Application element)
482-
483-
**What it does:**
484-
485-
- Reads the manifest and infers the alias from the `Executable` attribute (preserving placeholders like `$targetnametoken$.exe`)
486-
- Adds the `uap5` namespace declaration if not already present
487-
- Adds an `<Extensions>` block with `<uap5:AppExecutionAlias>` inside the target Application element
488-
- If the alias already exists, reports it and exits successfully
489-
490-
**Examples:**
491-
492-
```bash
493-
# Add alias inferred from Executable attribute (e.g. $targetnametoken$.exe)
494-
winapp manifest add-alias
495-
496-
# Add alias with explicit name
497-
winapp manifest add-alias --name myapp.exe
498-
499-
# Add alias to specific manifest
500-
winapp manifest add-alias --manifest ./dist/Package.appxmanifest
501-
```
502-
503-
Generate all required MSIX image assets from a single source image.
504-
505-
```bash
506-
winapp manifest update-assets <image-path> [options]
507-
```
508-
509-
**Arguments:**
510-
511-
- `image-path` - Path to source image file (PNG, JPG, SVG, ICO, GIF, BMP, etc.)
512-
513-
**Options:**
514-
515-
- `--manifest <path>` - Path to Package.appxmanifest file (default: search current directory)
516-
- `--light-image <path>` - Path to a separate source image for light theme variants
517-
518-
**Description:**
519-
520-
Takes a single source image and generates a comprehensive set of MSIX image assets based on the manifest's asset references:
521-
522-
For each asset referenced in the manifest:
523-
- **5 scale variants** — base (no suffix), `.scale-125`, `.scale-150`, `.scale-200`, `.scale-400`
524-
525-
For the app icon (Square44x44Logo / AppList, 44×44 base):
526-
- **14 plated targetsize variants**`.targetsize-{16,20,24,30,32,36,40,48,60,64,72,80,96,256}`
527-
- **14 unplated targetsize variants**`.targetsize-{size}_altform-unplated`
528-
529-
Additionally:
530-
- **app.ico** — Multi-resolution ICO file (16, 24, 32, 48, 256) for shell integration. If an existing `.ico` file is found in the assets directory (e.g. `AppIcon.ico` from a project template), it is replaced in-place rather than creating a duplicate
531-
532-
With `--light-image`:
533-
- **Light theme targetsize variants**`.targetsize-{size}_altform-lightunplated` (app icon)
534-
- **Light theme scale variants**`.scale-{factor}_altform-colorful_theme-light` (tiles, store logo)
535-
536-
**SVG support:** SVG files are fully supported as source images. They are rendered as vectors directly at each target size, producing pixel-perfect results at all resolutions.
537-
538-
The command scales images proportionally while maintaining aspect ratio, centering them with transparent backgrounds when needed. Assets are saved to the `Assets` directory relative to the manifest location.
539-
540-
**Examples:**
541-
542-
```bash
543-
# Generate assets with auto-detected manifest
544-
winapp manifest update-assets mylogo.png
545-
546-
# Use an SVG source for best quality at all sizes
547-
winapp manifest update-assets mylogo.svg
548-
549-
# Specify manifest location explicitly
550-
winapp manifest update-assets mylogo.png --manifest ./dist/Package.appxmanifest
551-
552-
# Generate light theme variants from a separate image
553-
winapp manifest update-assets mylogo.png --light-image mylogo-light.png
554-
555-
# Use the same image for both (generates all MRT light theme qualifiers)
556-
winapp manifest update-assets mylogo.png --light-image mylogo.png
557-
558-
# With verbose output
559-
winapp manifest update-assets mylogo.png --verbose
560-
```
561-
562-
---
563-
564564
### cert
565565

566566
Generate, inspect, and install development certificates.
@@ -760,7 +760,7 @@ winapp tool signtool verify /pa MyApp.msix
760760

761761
### store
762762

763-
Run a Microsoft Store Developer CLI command. This command will download the Microsoft Store Developer CLI if not already downloaded. Learn more about the Microsoft Store Developer CLI here: ([https://aka.ms/msstoredevcli](https://aka.ms/msstoredevcli)).
763+
Run a Microsoft Store Developer CLI command. This command will download the Microsoft Store Developer CLI if not already downloaded. Learn more about the [Microsoft Store Developer CLI](https://aka.ms/msstoredevcli).
764764

765765
```bash
766766
winapp store [args...]
@@ -930,7 +930,7 @@ REM Set a custom location for winapp's global cache
930930
set WINAPP_CLI_CACHE_DIRECTORY=d:\temp\.winapp
931931
```
932932

933-
In **Powershell** and **pwsh**:
933+
In **PowerShell** and **pwsh**:
934934
```pwsh
935935
# Set a custom location for winapp's global cache
936936
$env:WINAPP_CLI_CACHE_DIRECTORY=d:\temp\.winapp

scripts/port-mslearn-docs.ps1

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,20 @@ foreach ($entry in $FileMapping.GetEnumerator()) {
346346

347347
# Escape bare <placeholder> patterns that MS Learn treats as HTML tags.
348348
# Matches <word>, <word-word>, <word word> not already inside backticks or code blocks.
349-
$content = [regex]::Replace($content, '<([\w][\w\s-]*)>', '&lt;$1&gt;')
349+
# Skip legitimate HTML tags whose closing form (</tag>) wouldn't be escaped by this rule,
350+
# which would otherwise produce mismatched &lt;tag&gt; ... </tag> pairs in the output.
351+
# Compare only the tag name (first token), so allowed tags with attributes like
352+
# <details open> are preserved as HTML instead of being partially escaped.
353+
$htmlPassthroughTags = @('details', 'summary', 'br', 'hr', 'sub', 'sup', 'kbd', 'b')
354+
$content = [regex]::Replace($content, '<([\w][\w\s-]*)>', {
355+
param($match)
356+
$tag = $match.Groups[1].Value
357+
$tagName = ($tag -split '\s+', 2)[0]
358+
if ($htmlPassthroughTags -contains $tagName.ToLowerInvariant()) {
359+
return $match.Value
360+
}
361+
return "&lt;$tag&gt;"
362+
})
350363

351364
# Rewrite image links first (before regular links, since ![...]() also matches [...]() regex)
352365
$content = [regex]::Replace($content, '!\[([^\]]*)\]\(([^)]+)\)', {

0 commit comments

Comments
 (0)