Skip to content

Commit c0ab297

Browse files
authored
Merge pull request #57 from MicrosoftEdge/installerReadme
Add READMEs for installer samples
2 parents 8402697 + aca6902 commit c0ab297

File tree

8 files changed

+164
-3
lines changed

8 files changed

+164
-3
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ In the ``GettingStarted`` folder you will find the starter code for its respecti
88
- WinUI Getting Started (Releasing Soon)
99

1010
In the ``Sample Apps`` folder you will find:
11-
- [WebView2Samples.sln](SampleApps/WebView2Samples.sln) - a collective soluction that inlcudes [WebView2APISample.vcxproj](SampleApps/WebView2APISample/WebView2APISample.vcxproj), [WebView2WpfBrowser.csproj](SampleApps/WebView2WpfBrowser/WebView2WpfBrowser.csproj), and [WebView2WindowsFormsBrowser.csproj](SampleApps/WebView2WindowsFormsBrowser/WebView2WindowsFormsBrowser.csproj).
12-
11+
- [WebView2Samples.sln](SampleApps/WebView2Samples.sln) - a collective solution that includes [WebView2APISample.vcxproj](SampleApps/WebView2APISample/WebView2APISample.vcxproj), [WebView2WpfBrowser.csproj](SampleApps/WebView2WpfBrowser/WebView2WpfBrowser.csproj), [WebView2WindowsFormsBrowser.csproj](SampleApps/WebView2WindowsFormsBrowser/WebView2WindowsFormsBrowser.csproj), [WV2DeploymentWiXCustomActionSample](/SampleApps/WV2DeploymentWiXCustomActionSample/README.md), and [WV2DeploymentWiXBurnBundleSample](/SampleApps/WV2DeploymentWiXBurnBundleSample/README.md).
1312

1413
Please leave feedback in our [our feedback repo](https://aka.ms/webviewfeedback)!
1514

@@ -31,6 +30,14 @@ The [WebView2Browser](https://github.com/MicrosoftEdge/WebView2Browser) is an ad
3130

3231
Follow the [WebView2Browser guide](https://github.com/MicrosoftEdge/WebView2Browser) to learn how to build an application that utilizes multiple WebViews.
3332

33+
## WebView2 Deployment Samples
34+
35+
To help developers understand how to [deploy Evergreen WebView2 Runtime](https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime) with your applications, we have following samples:
36+
37+
* [WV2DeploymentWiXCustomActionSample](/SampleApps/WV2DeploymentWiXCustomActionSample/README.md) creates a [WiX](https://wixtoolset.org/) installer for [WebView2APISample](./SampleApps/WebView2APISample/README.md) and uses [WiX Custom Action](https://wixtoolset.org/documentation/manual/v3/wixdev/extensions/authoring_custom_actions.html) to chain-install the Evergreen WebView2 Runtime.
38+
* [WV2DeploymentWiXBurnBundleSample](/SampleApps/WV2DeploymentWiXBurnBundleSample/README.md) creates a [WiX](https://wixtoolset.org/) installer for [WebView2APISample](./SampleApps/WebView2APISample/README.md) and uses [WiX Burn Bundle](https://wixtoolset.org/documentation/manual/v3/bundle/) to chain-install the Evergreen WebView2 Runtime.
39+
* [WV2DeploymentVSInstallerSample](/SampleApps/WV2DeploymentVSInstallerSample/README.md) uses the [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=visualstudioclient.MicrosoftVisualStudio2017InstallerProjects) to create an installer for [WebView2APISample](./SampleApps/WebView2APISample/README.md) and chain-install the Evergreen WebView2 Runtime.
40+
3441
## .NET (WPF and Windows Forms)
3542

3643
#### Getting Started
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
description: "Demonstrate the deployment workflow of WebView2 with VS installer."
3+
extendedZipContent:
4+
-
5+
path: SharedContent
6+
target: SharedContent
7+
-
8+
path: LICENSE
9+
target: LICENSE
10+
languages:
11+
- cpp
12+
page_type: sample
13+
products:
14+
- microsoft-edge
15+
urlFragment: WV2DeploymentVSInstallerSample
16+
---
17+
# WebView2 Deployment VS Installer Sample
18+
19+
To help developers understand how to [deploy the Evergreen WebView2 Runtime](https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime) with your application, this sample uses the [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=visualstudioclient.MicrosoftVisualStudio2017InstallerProjects) to create an installer for [WebView2APISample](./SampleApps/WebView2APISample/README.md) and chain-install the Evergreen WebView2 Runtime.
20+
21+
This sample showcases [deployment workflows](https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime) for,
22+
23+
* Download the Evergreen WebView2 Runtime Bootstrapper through link.
24+
* Package the Evergreen WebView2 Runtime Bootstrapper.
25+
* Package the Evergreen WebView2 Runtime Standalone Installer.
26+
27+
## Prerequisites
28+
29+
* [Visual Studio](https://visualstudio.microsoft.com/vs/) with C++ support installed.
30+
* [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=visualstudioclient.MicrosoftVisualStudio2017InstallerProjects).
31+
32+
## Build steps
33+
34+
To create a VS installer that chain-install the Evergreen WebView2 Runtime,
35+
36+
1. Edit the `product.xml` file depending on the workflow you wish to use.
37+
* For "Package the Evergreen WebView2 Runtime Bootstrapper",
38+
* Within the `<PackageFiles CopyAllPackageFiles="false">` and `</PackageFiles>` section, un-comment the line `<PackageFile Name="MicrosoftEdgeWebview2Setup.exe" />`, and comment out other lines.
39+
* Within the `<Commands Reboot="Defer">` and `</Commands>` section, make sure `PackageFile` points to `"MicrosoftEdgeWebview2Setup.exe"` so that the VS installer would be using the Bootstrapper.
40+
* For "Download the Evergreen WebView2 Runtime Bootstrapper through link",
41+
* 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.
42+
* Within the `<Commands Reboot="Defer">` and `</Commands>` section, make sure `PackageFile` points to `"MicrosoftEdgeWebview2Setup.exe"` so that the VS installer would be using the Bootstrapper.
43+
* For "Package the Evergreen WebView2 Runtime Standalone Installer",
44+
* Within the `<PackageFiles CopyAllPackageFiles="false">` and `</PackageFiles>` section, un-comment the line `<PackageFile Name="MicrosoftEdgeWebView2RuntimeInstallerX64.exe" />`, and comment out other lines.
45+
* Within the `<Commands Reboot="Defer">` and `</Commands>` section, make sure `PackageFile` points to `"MicrosoftEdgeWebView2RuntimeInstallerX64.exe"` so that the VS installer would be using the Standalone Installer.
46+
* If you're targeting non-X64 devices, you may also want to edit the `MicrosoftEdgeWebView2RuntimeInstallerX64` filename to reflect the correct architecture.
47+
1. If you plan to package either the Bootstrapper or the Standalone Installer, [download](https://developer.microsoft.com/microsoft-edge/webview2/) the Bootstrapper or the Standalone Installer and place it under the `WV2DeploymentVSInstallerSample` folder.
48+
1. Copy the entire `WV2DeploymentVSInstallerSample` folder, and paste it under either,
49+
* `Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\`, or
50+
* `<VS Install Dir>\MSBuild\Microsoft\VisualStudio\BootstrapperPackages\` (requires at least VS 2019 Update 7).
51+
1. Create a Setup Project in Visual Studio.
52+
* In Visual Studio menu, select `File > New > Project`.
53+
* Search for `Setup Project`.
54+
![alt text](../../media/CreateSetupProject.PNG)
55+
* Create a Setup Project.
56+
1. Add WebView2 Runtime as a prerequisite.
57+
* In Visual Studio menu, select `Project > Properties`.
58+
* In the Property page, select `Prerequisites..`.
59+
![alt text](../../media/SetupPrerequisites.PNG)
60+
* Check `Edge WebView2 runtime`, and un-check other prerequisites. Select `OK`.
61+
![alt text](../../media/SelectPrerequisites.PNG)
62+
1. Build the Setup project.

SampleApps/WV2DeploymentWiXBurnBundleSample/Bundle.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</ExePackage> -->
2020

2121
<!-- [Package Bootstrapper] Package bootstrapper to use during app install. Source can be anywhere you put the boostrapper on. -->
22-
<!-- <ExePackage Id="DownloadAndInvokeBootstrapper" Name="Install WebView2 Runtime" Cache="no" Compressed="no" PerMachine="yes" Vital="no" SourceFile="..\MicrosoftEdgeWebview2Setup.exe" InstallCommand=" /silent /install" InstallCondition="NOT (REMOVE OR WVRTInstalled)" /> -->
22+
<!-- <ExePackage Id="InvokeBootstrapper" Name="Install WebView2 Runtime" Cache="no" Compressed="no" PerMachine="yes" Vital="no" SourceFile="..\MicrosoftEdgeWebview2Setup.exe" InstallCommand=" /silent /install" InstallCondition="NOT (REMOVE OR WVRTInstalled)" /> -->
2323

2424
<!-- Step 2: Chain Sample App -->
2525
<!-- Make sure to comment out default Custom Action in WebView2SampleApp project -->
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
description: "Demonstrate the deployment workflow of WebView2 with WiX Burn Bundle."
3+
extendedZipContent:
4+
-
5+
path: SharedContent
6+
target: SharedContent
7+
-
8+
path: LICENSE
9+
target: LICENSE
10+
languages:
11+
- cpp
12+
page_type: sample
13+
products:
14+
- microsoft-edge
15+
urlFragment: WV2DeploymentWiXBurnBundleSample
16+
---
17+
# WebView2 Deployment WiX Burn Bundle Sample
18+
19+
To help developers understand how to [deploy the Evergreen WebView2 Runtime](https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime) with your application, this sample creates a [WiX](https://wixtoolset.org/) installer for [WebView2APISample](../WebView2APISample/README.md) and uses [WiX Burn Bundle](https://wixtoolset.org/documentation/manual/v3/bundle/) to chain-install the Evergreen WebView2 Runtime.
20+
21+
This sample showcases [deployment workflows](https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime) for,
22+
23+
* Download the Evergreen WebView2 Runtime Bootstrapper through link.
24+
* Package the Evergreen WebView2 Runtime Bootstrapper.
25+
26+
Packaging the Evergreen WebView2 Runtime Standalone Installer is very similar to packaging the Evergreen WebView2 Runtime Bootstrapper.
27+
28+
## Prerequisites
29+
30+
* [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) with C++ support installed.
31+
* [WiX Toolset](https://wixtoolset.org/).
32+
* [WiX Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension).
33+
34+
## Build steps
35+
36+
To create a WiX installer that chain-installs the Evergreen WebView2 Runtime through Burn Bundle,
37+
38+
1. Open `../WebView2Samples.sln` with Visual Studio.
39+
1. This sample is an extension to the [WV2DeploymentWiXCustomActionSample](../WV2DeploymentWiXCustomActionSample/README.md) sample. Let's open `Product.wxs` under the `WV2DeploymentWiXCustomActionSample` project, and comment out all the `<Binary>`, `<CustomAction>`, and `<Custom>` elements under `<!-- Step 4: Config Custom Action to download/install Bootstrapper -->` and `<!-- Step 5: Config execute sequence of custom action -->` so that Custom Action is not used.
40+
1. Open `Bundle.wxs` under the `WV2DeploymentWiXBurnBundleSample` project. Edit `Bundle.wxs` depending on the workflow you wish to use.
41+
* For "Package the Evergreen WebView2 Runtime Bootstrapper", uncomment the `<ExePackage Id="InvokeBootstrapper" ...>` element below `<!-- [Package Bootstrapper] ... -->`, and comment out other `<ExePackage>` elements.
42+
* For "Download the Evergreen WebView2 Runtime Bootstrapper through link", uncomment the `<ExePackage Id="DownloadAndInvokeBootstrapper" ...>` element below `<!-- [Download Bootstrapper] ... -->`, and comment out other `<ExePackage>` elements.
43+
1. If you plan to package the Evergreen WebView2 Runtime Bootstrapper, [download](https://developer.microsoft.com/microsoft-edge/webview2/) the Bootstrapper and place it under the enclosing `SampleApps` folder.
44+
1. Build the `WV2DeploymentWiXBurnBundleSample` project.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
description: "Demonstrate the deployment workflow of WebView2 with WiX Custom Action."
3+
extendedZipContent:
4+
-
5+
path: SharedContent
6+
target: SharedContent
7+
-
8+
path: LICENSE
9+
target: LICENSE
10+
languages:
11+
- cpp
12+
page_type: sample
13+
products:
14+
- microsoft-edge
15+
urlFragment: WV2DeploymentWiXCustomActionSample
16+
---
17+
# WebView2 Deployment WiX Custom Action Sample
18+
19+
To help developers understand how to [deploy the Evergreen WebView2 Runtime](https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime) with your application, this sample creates a [WiX](https://wixtoolset.org/) installer for [WebView2APISample](../WebView2APISample/README.md) and uses [WiX Custom Action](https://wixtoolset.org/documentation/manual/v3/wixdev/extensions/authoring_custom_actions.html) to chain-install the Evergreen WebView2 Runtime.
20+
21+
This sample showcases [deployment workflows](https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime) for,
22+
23+
* Download the Evergreen WebView2 Runtime Bootstrapper through link.
24+
* Package the Evergreen WebView2 Runtime Bootstrapper.
25+
* Package the Evergreen WebView2 Runtime Standalone Installer.
26+
27+
## Prerequisites
28+
29+
* [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) with C++ support installed.
30+
* [WiX Toolset](https://wixtoolset.org/).
31+
* [WiX Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension).
32+
33+
## Build steps
34+
35+
To create a WiX installer that chain-installs the Evergreen WebView2 Runtime through Custom Action,
36+
37+
1. Open `../WebView2Samples.sln` with Visual Studio, then open `Product.wxs` under the `WV2DeploymentWiXCustomActionSample` project. Edit `Product.wxs` depending on the workflow you wish to use.
38+
* For "Download the Evergreen WebView2 Runtime Bootstrapper through link",
39+
* 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.
40+
* Under `<!-- Step 5: Config execute sequence of custom action -->`, uncomment the `<Custom Action='DownloadAndInvokeBootstrapper' ...>` element below `<!-- [Download Bootstrapper] ...-->`. Comment out other `<Custom>` elements.
41+
* For "Package the Evergreen WebView2 Runtime Bootstrapper",
42+
* 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.
43+
* Under `<!-- Step 5: Config execute sequence of custom action -->`, uncomment the `<Custom Action='InvokeBootstrapper' ...>` element below `<!-- [Package Bootstrapper] ...-->`. Comment out other `<Custom>` elements.
44+
* For "Package the Evergreen WebView2 Runtime Standalone Installer",
45+
* 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 the `MicrosoftEdgeWebView2RuntimeInstallerX64` filename to reflect the correct architecture.
46+
* Under `<!-- Step 5: Config execute sequence of custom action -->`, uncomment the `<Custom Action='InvokeStandalone' ...>` element below `<!-- [Package Standalone Installer] ...-->`. Comment out other `<Custom>` elements.
47+
1. If you plan to package either the Bootstrapper or the Standalone Installer, [download](https://developer.microsoft.com/microsoft-edge/webview2/) the Bootstrapper or the Standalone Installer and place it under the enclosing `SampleApps` folder.
48+
1. Build the `WV2DeploymentVSInstallerSample` project.

media/CreateSetupProject.PNG

43.7 KB
Loading

media/SelectPrerequisites.PNG

34.4 KB
Loading

media/SetupPrerequisites.PNG

14.9 KB
Loading

0 commit comments

Comments
 (0)