description | extendedZipContent | languages | page_type | products | urlFragment | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Demonstrate the deployment workflow of WebView2 with VS installer. |
|
|
sample |
|
WV2DeploymentVSInstallerSample |
To help developers understand how to deploy the Evergreen WebView2 Runtime with your application, this sample uses the Microsoft Visual Studio Installer Projects to create an installer for WebView2APISample and chain-install the Evergreen WebView2 Runtime.
This sample showcases deployment workflows for,
- Download the Evergreen WebView2 Runtime Bootstrapper through link.
- Package the Evergreen WebView2 Runtime Bootstrapper.
- Package the Evergreen WebView2 Runtime Standalone Installer.
- Visual Studio with C++ support installed.
- Microsoft Visual Studio Installer Projects.
To create a VS installer that chain-install the Evergreen WebView2 Runtime,
- Clone the repo.
- Edit the
product.xml
file depending on the workflow you wish to use.- For "Package the Evergreen WebView2 Runtime Bootstrapper",
- Within the
<PackageFiles CopyAllPackageFiles="false">
and</PackageFiles>
section, un-comment the line<PackageFile Name="MicrosoftEdgeWebview2Setup.exe" />
, and comment out other lines. - Within the
<Commands Reboot="Defer">
and</Commands>
section, make surePackageFile
points to"MicrosoftEdgeWebview2Setup.exe"
so that the VS installer would be using the Bootstrapper.
- Within the
- For "Download the Evergreen WebView2 Runtime Bootstrapper through link",
- Within the
<PackageFiles CopyAllPackageFiles="false">
and</PackageFiles>
section, un-comment the line<PackageFile Name="MicrosoftEdgeWebview2Setup.exe" HomeSite="WebViewRuntime" PublicKey="..."/>
, and comment out other lines. Note that the PublicKey for the WebView2 Runtime Bootstrapper may change without notice and we are working on addressing this issue. For now, you may need to replace it with an updated PublicKey. - Within the
<Commands Reboot="Defer">
and</Commands>
section, make surePackageFile
points to"MicrosoftEdgeWebview2Setup.exe"
so that the VS installer would be using the Bootstrapper.
- Within the
- For "Package the Evergreen WebView2 Runtime Standalone Installer",
- Within the
<PackageFiles CopyAllPackageFiles="false">
and</PackageFiles>
section, un-comment the line<PackageFile Name="MicrosoftEdgeWebView2RuntimeInstallerX64.exe" />
, and comment out other lines. - Within the
<Commands Reboot="Defer">
and</Commands>
section, make surePackageFile
points to"MicrosoftEdgeWebView2RuntimeInstallerX64.exe"
so that the VS installer would be using the Standalone Installer. - If you're targeting non-X64 devices, you may also want to edit the
MicrosoftEdgeWebView2RuntimeInstallerX64
filename to reflect the correct architecture.
- Within the
- For "Package the Evergreen WebView2 Runtime Bootstrapper",
- If you plan to package either the Bootstrapper or the Standalone Installer, download the Bootstrapper or the Standalone Installer and place it under the
WV2DeploymentVSInstallerSample
folder. - Copy the entire
WV2DeploymentVSInstallerSample
folder, and paste it under either,Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\
, or<VS Install Dir>\MSBuild\Microsoft\VisualStudio\BootstrapperPackages\
(requires at least VS 2019 Update 7).
- Create a Setup Project in Visual Studio.
- Add WebView2 Runtime as a prerequisite.
- Build the Setup project.