description | extendedZipContent | languages | page_type | products | urlFragment | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Demonstrate the deployment workflow of WebView2 with WiX Custom Action. |
|
|
sample |
|
WV2DeploymentWiXCustomActionSample |
To help developers understand how to deploy the Evergreen WebView2 Runtime with your application, this sample creates a WiX installer for WebView2APISample and uses WiX Custom Action to 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 2019 with C++ support installed.
- WiX Toolset.
- WiX Toolset Visual Studio 2019 Extension.
To create a WiX installer that chain-installs the Evergreen WebView2 Runtime through Custom Action,
- Clone the repo.
- Open
../WebView2Samples.sln
with Visual Studio, then openProduct.wxs
under theWV2DeploymentWiXCustomActionSample
project. EditProduct.wxs
depending on the workflow you wish to use.- For "Download the Evergreen WebView2 Runtime Bootstrapper through link",
- Under
<!-- Step 4: Config Custom Action to download/install Bootstrapper -->
, uncomment the<CustomAction Id='DownloadAndInvokeBootstrapper' ...>
element below<!-- [Download Bootstrapper] ... -->
. Comment out other<Binary>
and<CustomAction>
elements. - Under
<!-- Step 5: Config execute sequence of custom action -->
, uncomment the<Custom Action='DownloadAndInvokeBootstrapper' ...>
element below<!-- [Download Bootstrapper] ...-->
. Comment out other<Custom>
elements.
- Under
- For "Package the Evergreen WebView2 Runtime Bootstrapper",
- Under
<!-- Step 4: Config Custom Action to download/install Bootstrapper -->
, uncomment the<Binary Id="MicrosoftEdgeWebview2Setup.exe" ...>
and<CustomAction Id='InvokeBootstrapper' ...>
elements below<!-- [Package Bootstrapper] ... -->
. Comment out other<Binary>
and<CustomAction>
elements. - Under
<!-- Step 5: Config execute sequence of custom action -->
, uncomment the<Custom Action='InvokeBootstrapper' ...>
element below<!-- [Package Bootstrapper] ...-->
. Comment out other<Custom>
elements.
- Under
- For "Package the Evergreen WebView2 Runtime Standalone Installer",
- Under
<!-- Step 4: Config Custom Action to download/install Bootstrapper -->
, uncomment the<Binary Id="MicrosoftEdgeWebView2RuntimeInstallerX64.exe" ...>
and<CustomAction Id='InvokeStandalone' ...>
elements below<!-- [Package Standalone Installer] ... -->
. Comment out other<Binary>
and<CustomAction>
elements. If you're targeting non-X64 devices, you may also want to edit theMicrosoftEdgeWebView2RuntimeInstallerX64
filename to reflect the correct architecture. - Under
<!-- Step 5: Config execute sequence of custom action -->
, uncomment the<Custom Action='InvokeStandalone' ...>
element below<!-- [Package Standalone Installer] ...-->
. Comment out other<Custom>
elements.
- Under
- For "Download the Evergreen WebView2 Runtime Bootstrapper through link",
- If you plan to package either the Bootstrapper or the Standalone Installer, download the Bootstrapper or the Standalone Installer and place it under the enclosing
SampleApps
folder. - Build the
WV2DeploymentVSInstallerSample
project.