-
Notifications
You must be signed in to change notification settings - Fork 517
Expand file tree
/
Copy pathProduct.wxs
More file actions
85 lines (72 loc) · 6.1 KB
/
Product.wxs
File metadata and controls
85 lines (72 loc) · 6.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="WV2DeploymentWiXCustomActionSample" Language="1033" Version="1.0.0.0" Manufacturer="Microsoft Corp." UpgradeCode="3bf3b84c-e140-4276-81bd-23f461b01f71">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perUser"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
<MediaTemplate EmbedCab="yes"/>
<!-- Precondition: Check whether WebView RunTime already installed or not -->
<Property Id="WVRTINSTALLED">
<RegistrySearch Id="WVRTInstalled" Root="HKLM" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw" Win64="no"/>
</Property>
<!-- Step 1: Define installation folder -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLFOLDER" Name="WV2DeploymentWiXCustomActionSample"/>
</Directory>
<!-- Step 2: Add files to your installer package -->
<DirectoryRef Id="INSTALLFOLDER">
<!-- Using Project References and Variables: https://wixtoolset.org/documentation/manual/v3/votive/votive_project_references.html -->
<!-- Include files to your project by listing it one by one. Only showing key component in one project. No need if choose to use harvest. -->
<!-- <Component Id="WebView2APISample.exe" Guid="2DC56D26-A5CC-40ED-81C5-441042F2C46B">
<File Id="WebView2APISample.exe" Source="$(var.WebView2APISample.TargetDir)\WebView2APISample.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="WebView2Loader.dll" Guid="624B4B28-4D7F-49D8-9CAD-279FC2AC8D25">
<File Id="WebView2Loader.dll" Source="$(var.WebView2APISample.TargetDir)\WebView2Loader.dll" KeyPath="yes"/>
</Component> -->
</DirectoryRef>
<!-- Step 3: Tell WiX to install the files -->
<Feature Id="MainApplication" Title="Main Application" Level="1" ConfigurableDirectory='INSTALLFOLDER'>
<!-- Include files to your project by listing it one by one. Only showing key component in one project. -->
<!--<ComponentRef Id="WebView2APISample.exe"/>
<ComponentRef Id="WebView2Loader.dll"/>-->
<!-- Include files to your project by using heat to auto generate the file list. No need for DirectoryRef section. -->
<!-- See project file for details -->
<ComponentGroupRef Id="AppComponent" />
</Feature>
<!-- [Custom UI] Let User choose install location -->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
<UIRef Id="WixUI_InstallDir"/>
<!-- Step 4: Config Custom Action to download/install Bootstrapper -->
<!-- Reference: https://learn.microsoft.com/microsoft-edge/webview2/concepts/distribution#understand-the-webview2-runtime-and-installer-preview -->
<!-- Note: PerMachine case, user can use Impersonate="no" to run MicrosoftEdgeWebview2Setup.exe elevated with /silent flag to install WebView Runtime silently-->
<!-- [Package Standalone Installer] Package Standalone Installer as binary stream to use during app install. SourceFile can be anywhere you put the Standalone Installer on. -->
<!-- <Binary Id="MicrosoftEdgeWebView2RuntimeInstallerX64.exe" SourceFile="..\MicrosoftEdgeWebView2RuntimeInstallerX64.exe"/>
<CustomAction Id='InvokeStandalone' BinaryKey='MicrosoftEdgeWebView2RuntimeInstallerX64.exe' Execute="deferred" ExeCommand=' /install' Return='check' /> -->
<!-- [Package Bootstrapper] Package bootstrapper as binary stream to use during app install. Source can be anywhere you put the boostrapper on. -->
<!-- <Binary Id="MicrosoftEdgeWebview2Setup.exe" SourceFile="..\MicrosoftEdgeWebview2Setup.exe"/>
<CustomAction Id='InvokeBootstrapper' BinaryKey='MicrosoftEdgeWebview2Setup.exe' Execute="deferred" ExeCommand=' /install' Return='check' /> -->
<!-- [Download Bootstrapper] Use fwlink to download bootstrapper to user TEMP folder then invoke it-->
<!-- Note: Download will be overrided if file already exist. -->
<!-- Use of the download link below is governed by the below terms. You may acquire the link for your use at https://developer.microsoft.com/microsoft-edge/webview2/. -->
<!-- Microsoft owns all legal right, title, and interest in and to the WebView2 Runtime Bootstrapper ("Software") and related documentation, including any intellectual property in the Software.
You must acquire all code, including any code obtained from a Microsoft URL, under a separate license directly from Microsoft, including a Microsoft download site (e.g., https://developer.microsoft.com/microsoft-edge/webview2/). -->
<CustomAction Id='DownloadAndInvokeBootstrapper' Directory="INSTALLFOLDER" Execute="deferred" ExeCommand='powershell.exe -windowstyle hidden Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" ; & $env:TEMP\MicrosoftEdgeWebview2Setup.exe /install' Return='check'/>
<!-- Step 5: Config execute sequence of custom action -->
<InstallExecuteSequence>
<!-- [Package Standalone Installer] Package Standalone Installer and invoke at app installation -->
<!-- Only run InvokeStandalone action during app install, app repair and when WVRT wasn't installed-->
<!-- <Custom Action='InvokeStandalone' Before='InstallFinalize'>
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
</Custom> -->
<!-- [Package Bootstrapper] Package bootstrapper and invoke at app installation-->
<!-- Only run InvokeBootstrapper action during app install, app repair and when WVRT wasn't installed-->
<!-- <Custom Action='InvokeBootstrapper' Before='InstallFinalize'>
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
</Custom> -->
<!-- [Download Bootstrapper] Use fwlink to download the bootstrapper to user TEMP folder and invoke-->
<!-- Only run DownloadAndInvokeBootstrapper action during app install, app repair and when WVRT wasn't installed-->
<Custom Action='DownloadAndInvokeBootstrapper' Before='InstallFinalize'>
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
</Custom>
</InstallExecuteSequence>
</Product>
</Wix>