|
283 | 283 |
|
284 | 284 | {{#if install_webview}} |
285 | 285 | <!-- WebView2 --> |
286 | | - <Property Id="WVRTINSTALLED"> |
287 | | - <RegistrySearch Id="WVRTInstalledSystem" Root="HKLM" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw" Win64="no" /> |
288 | | - <RegistrySearch Id="WVRTInstalledUser" Root="HKCU" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw"/> |
| 286 | + <Property Id="INSTALLED_WEBVIEW2_VERSION"> |
| 287 | + <RegistrySearch Id="Webview2VersionSystemx64" Root="HKLM" Key="SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw" /> |
| 288 | + <RegistrySearch Id="Webview2VersionSystemx86" Root="HKLM" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw" /> |
| 289 | + <RegistrySearch Id="Webview2VersionUser" Root="HKCU" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw"/> |
289 | 290 | </Property> |
290 | 291 |
|
291 | 292 | {{#if download_bootstrapper}} |
| 293 | + <!-- Download webview bootstrapper mode --> |
292 | 294 | <CustomAction Id='DownloadAndInvokeBootstrapper' Directory="INSTALLDIR" Execute="deferred" ExeCommand='powershell.exe -NoProfile -windowstyle hidden try [\{] [\[]Net.ServicePointManager[\]]::SecurityProtocol = [\[]Net.SecurityProtocolType[\]]::Tls12 [\}] catch [\{][\}]; Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" ; Start-Process -FilePath "$env:TEMP\MicrosoftEdgeWebview2Setup.exe" -ArgumentList ({{webview_installer_args}} '/install') -Wait' Return='check'/> |
293 | 295 | <InstallExecuteSequence> |
294 | 296 | <Custom Action='DownloadAndInvokeBootstrapper' Before='InstallFinalize'> |
295 | | - <![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]> |
| 297 | + <![CDATA[NOT(REMOVE OR INSTALLED_WEBVIEW2_VERSION)]]> |
296 | 298 | </Custom> |
297 | 299 | </InstallExecuteSequence> |
298 | 300 | {{/if}} |
299 | 301 |
|
300 | | - <!-- Embedded webview bootstrapper mode --> |
301 | 302 | {{#if webview2_bootstrapper_path}} |
| 303 | + <!-- Embedded webview bootstrapper mode --> |
302 | 304 | <Binary Id="MicrosoftEdgeWebview2Setup.exe" SourceFile="{{webview2_bootstrapper_path}}"/> |
303 | 305 | <CustomAction Id='InvokeBootstrapper' BinaryKey='MicrosoftEdgeWebview2Setup.exe' Execute="deferred" ExeCommand='{{webview_installer_args}} /install' Return='check' /> |
304 | 306 | <InstallExecuteSequence> |
305 | 307 | <Custom Action='InvokeBootstrapper' Before='InstallFinalize'> |
306 | | - <![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]> |
| 308 | + <![CDATA[NOT(REMOVE OR INSTALLED_WEBVIEW2_VERSION)]]> |
307 | 309 | </Custom> |
308 | 310 | </InstallExecuteSequence> |
309 | 311 | {{/if}} |
310 | 312 |
|
311 | | - <!-- Embedded offline installer --> |
312 | 313 | {{#if webview2_installer_path}} |
| 314 | + <!-- Embedded offline installer --> |
313 | 315 | <Binary Id="MicrosoftEdgeWebView2RuntimeInstaller.exe" SourceFile="{{webview2_installer_path}}"/> |
314 | 316 | <CustomAction Id='InvokeStandalone' BinaryKey='MicrosoftEdgeWebView2RuntimeInstaller.exe' Execute="deferred" ExeCommand='{{webview_installer_args}} /install' Return='check' /> |
315 | 317 | <InstallExecuteSequence> |
316 | 318 | <Custom Action='InvokeStandalone' Before='InstallFinalize'> |
317 | | - <![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]> |
| 319 | + <![CDATA[NOT(REMOVE OR INSTALLED_WEBVIEW2_VERSION)]]> |
| 320 | + </Custom> |
| 321 | + </InstallExecuteSequence> |
| 322 | + {{/if}} |
| 323 | + |
| 324 | + {{#if minimum_webview2_version}} |
| 325 | + <!-- Update WebView2 if minimum version requirement not met --> |
| 326 | + <Property Id="MINIMUM_WEBVIEW2_VERSION" Value="{{minimum_webview2_version}}" /> |
| 327 | + <Property Id="EDGEUPDATE_PATH"> |
| 328 | + <RegistrySearch Id="EdgeUpdateLocalMachine64" Root="HKLM" Key="SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate" Name="path" Type="raw" /> |
| 329 | + <RegistrySearch Id="EdgeUpdateLocalMachine32" Root="HKLM" Key="SOFTWARE\Microsoft\EdgeUpdate" Name="path" Type="raw"/> |
| 330 | + <RegistrySearch Id="EdgeUpdateCurrentUser" Root="HKCU" Key="SOFTWARE\Microsoft\EdgeUpdate" Name="path" Type="raw"/> |
| 331 | + </Property> |
| 332 | + <!-- Chromium updater docs: https://source.chromium.org/chromium/chromium/src/+/main:docs/updater/user_manual.md --> |
| 333 | + <!-- Modified from "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView\ModifyPath" --> |
| 334 | + <CustomAction Id="UpdateWebView2ViaEdgeUpdate" Execute="deferred" Property="EDGEUPDATE_PATH" Return="check" Impersonate="no" ExeCommand="/install appguid={F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}&needsadmin=true" /> |
| 335 | + <InstallExecuteSequence> |
| 336 | + <Custom Action='UpdateWebView2ViaEdgeUpdate' Before='InstallFinalize'> |
| 337 | + <![CDATA[ |
| 338 | + NOT REMOVE |
| 339 | + AND INSTALLED_WEBVIEW2_VERSION |
| 340 | + AND (INSTALLED_WEBVIEW2_VERSION < MINIMUM_WEBVIEW2_VERSION) |
| 341 | + ]]> |
318 | 342 | </Custom> |
319 | 343 | </InstallExecuteSequence> |
320 | 344 | {{/if}} |
|
0 commit comments