WebView2 support on Validation OS

This article explains how to add the WebView2 Runtime to a Validation OS image. WebView2 is an external component that you must download and integrate separately.

Prerequisites

Important

The Validation OS image must include the WebView OS Support feature (WebviewDependency.pkg).

Add the dependency by using one of these methods:

  • Validation OS Image Builder: Select WebView OS Support when you configure the image.
  • GenImage: Include WebviewDependency.pkg in the feature configuration.

Choose a distribution method

Validation OS supports the WebView2 distribution methods shown in the following table.

Distribution method Support Considerations
Fixed Version Supported Bundles a specific runtime version with the app. Recommended for predictable, offline Validation OS scenarios.
Evergreen Standalone Installer Supported Installs the packaged runtime without internet access.
Evergreen Bootstrapper Supported Requires internet access and downloads the latest available runtime.

Basic WebView2 support was validated with version 138.0.3351.121 and later on x64 and Arm64 devices. Because Validation OS is minimal, some advanced WebView2 features might not be available.

Add a Fixed Version Runtime

  1. Go to the Microsoft Edge WebView2 download page.

  2. Select Fixed Version, and then select the required version and architecture.

  3. Download the .cab file to the technician PC.

  4. Extract the package. Update the version, architecture, and paths in this example as needed:

    expand "C:\Users\<user>\Downloads\Microsoft.WebView2.FixedVersionRuntime.139.0.3405.102.x64.cab" -F:* "C:\Users\<user>\Downloads\Microsoft.WebView2"
    

Use GenImage

Include the extracted runtime by using -AddedSW:

GenImage.cmd -PackagesList:<package-list> -AddedSW:"C:\Users\<user>\Downloads\Microsoft.WebView2\Microsoft.WebView2.FixedVersionRuntime.139.0.3405.102.x64" -Drivers:<driver-path>

To choose the destination in the image, also specify -AddedSWTargetDir:

GenImage.cmd -PackagesList:<package-list> -AddedSW:"C:\Users\<user>\Downloads\Microsoft.WebView2\Microsoft.WebView2.FixedVersionRuntime.139.0.3405.102.x64" -AddedSWTargetDir:"\WebView2Runtime" -Drivers:<driver-path>

Use Validation OS Image Builder

  1. Start Validation OS Image Builder.
  2. Under Optional Software, select the extracted WebView2 Runtime folder.
  3. Ensure that WebView OS Support is selected.
  4. Complete the image-build workflow.

Install an Evergreen Runtime

  1. Download either the Evergreen Bootstrapper or Evergreen Standalone Installer from the Microsoft Edge WebView2 download page.

  2. Boot the customized Validation OS image.

  3. Run the installer. For unattended installation, use the applicable command:

    Evergreen Bootstrapper:

    MicrosoftEdgeWebview2Setup.exe /silent /install
    

    Evergreen Standalone Installer, x64 example:

    MicrosoftEdgeWebView2RuntimeInstallerX64.exe /silent /install
    

Verify WebView2 support

  1. Boot the target device with the customized image.
  2. Verify that the runtime files are present in the expected location.
  3. For a Fixed Version Runtime, configure the app to use the runtime folder, such as C:\WebView2Runtime.
  4. Run the WebView2 app and validate the required scenarios.

For a sample, see the Validation OS SDK repository.

Troubleshooting

The app fails to initialize

Verify that the WebView OS Support feature was included in the image.

The runtime isn't found

Verify that the runtime files were copied to the image and that the app can access the configured runtime directory.