Skip to content

Commit

Permalink
Update WebView2 SDK to 1.0.1264.42 (#7329)
Browse files Browse the repository at this point in the history
* update webview2 sdk from 1.0.1020.30 to 1.0.1264.42

* update changed APIs

* WebView2 is no longer experimental

Co-authored-by: Kristen Schau <[email protected]>
  • Loading branch information
krschau and krschau authored Jul 11, 2022
1 parent bace2c5 commit b0a4412
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 41 deletions.
3 changes: 1 addition & 2 deletions build/CopyFilesToStagingDir.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ PublishFile -IfExists $FullBuildOutput\Microsoft.UI.Xaml\Generic.xaml $FullPubli
PublishFile -IfExists $FullBuildOutput\Microsoft.UI.Xaml.Design\Microsoft.UI.Xaml.Design.dll $FullPublishDir\Microsoft.UI.Xaml.Design\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\Microsoft.UI.Xaml.FrameworkPackagePRI\Microsoft.UI.Xaml.pri $FullPublishDir\Microsoft.UI.Xaml.FrameworkPackagePRI\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\*.dll $FullPublishDir\Test\
PublishFile -IfExists $FullBuildOutput\Microsoft.UI.Xaml\WebView2Loader.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\$Platform\MUXControlsTestApp.TAEF\WebView2Loader.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.ReleaseTest.TAEF\MUXControls.ReleaseTest.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.ReleaseTest.TAEF\WebView2Loader.dll $FullPublishDir\Test\
PublishFile -IfExists $FullBuildOutput\NugetPackageTestApp\WebView2Loader.dll $FullPublishDir\Test\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXExperimental.Test.TAEF\MUXExperimental.Test.dll $FullPublishDir\Test\

PublishFile -IfExists $FullBuildOutput\Microsoft.Experimental.UI.Xaml\Microsoft.Experimental.UI.Xaml.dll $FullPublishDir\Microsoft.Experimental.UI.Xaml\
Expand Down
2 changes: 1 addition & 1 deletion build/NuSpecs/MUXControls.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<iconUrl>https://aka.ms/winui_icon</iconUrl>

<dependencies>
<dependency id="Microsoft.Web.WebView2" version="[1.0.1020.30,)" />
<dependency id="Microsoft.Web.WebView2" version="[1.0.1264.42,)" />
</dependencies>
</metadata>
<files>
Expand Down
2 changes: 1 addition & 1 deletion build/NuSpecs/MUXControlsFrameworkPackage.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<iconUrl>https://aka.ms/winui_icon</iconUrl>

<dependencies>
<dependency id="Microsoft.Web.WebView2" version="[1.0.1020.30,)" />
<dependency id="Microsoft.Web.WebView2" version="[1.0.1264.42,)" />
</dependencies>
</metadata>
<files>
Expand Down
30 changes: 15 additions & 15 deletions dev/WebView2/InteractionTests/WebView2Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ public static void EnsureBrowser()
// 1. Get installed Edge browser (or WebView2 Runtime) build version info.
int browserBuildVersion = GetInstalledBrowserVersion();

// 2. Get WebView2Loader.dll Build version info.
int loaderBuildVersion = GetLoaderBuildVersion();
// 2. Get Microsoft.Web.WebView2.Core.dll build version info.
int sdkBuildVersion = GetSdkBuildVersion();

// 3. If a runtime isn't installed or the SDK and runtime aren't compatible, install a compatible runtime.
bool hasCompatibleRuntimeInstalled = GetHasCompatibleRuntimeInstalled(browserBuildVersion, loaderBuildVersion);
bool hasCompatibleRuntimeInstalled = GetHasCompatibleRuntimeInstalled(browserBuildVersion, sdkBuildVersion);

if (!hasCompatibleRuntimeInstalled)
{
Expand Down Expand Up @@ -155,27 +155,27 @@ private static int GetInstalledBrowserVersion()
return browserBuildVersion;
}

private static int GetLoaderBuildVersion()
private static int GetSdkBuildVersion()
{
int loaderBuildVersion = 0;
string loaderPath = Path.Combine(Environment.CurrentDirectory, NativeMethods.LoaderName);
int sdkBuildVersion = 0;
string dllName = "Microsoft.Web.WebView2.Core.dll";
string dllPath = Path.Combine(Environment.CurrentDirectory, dllName);

try
{
FileVersionInfo loaderVersionInfo = FileVersionInfo.GetVersionInfo(loaderPath);
loaderBuildVersion = loaderVersionInfo.ProductBuildPart;
FileVersionInfo sdkVersionInfo = FileVersionInfo.GetVersionInfo(dllPath);
sdkBuildVersion = sdkVersionInfo.ProductBuildPart;
Log.Comment("WebView2Tests Init: Found {0}: version {1} [build version: {2}] (file: {3})",
NativeMethods.LoaderName,
loaderVersionInfo.ProductVersion,
loaderBuildVersion,
loaderVersionInfo.FileName
);
dllName,
sdkVersionInfo.ProductVersion,
sdkBuildVersion,
sdkVersionInfo.FileName);
}
catch (Exception e)
{
Log.Error("WebView2Tests Init: could not find loader at {0} [exception: {1}]", loaderPath, e.ToString());
Log.Error("WebView2Tests Init: could not find loader at {0} [exception: {1}]", dllPath, e.ToString());
}
return loaderBuildVersion;
return sdkBuildVersion;
}

private static bool GetHasCompatibleRuntimeInstalled(int browserBuildVersion, int loaderBuildVersion)
Expand Down
4 changes: 2 additions & 2 deletions dev/WebView2/WebView2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ winrt::IUnknown WebView2::GetWebView2Provider()
if (m_coreWebViewCompositionController)
{
auto coreWebView2CompositionControllerInterop = m_coreWebViewCompositionController.as<ICoreWebView2CompositionControllerInterop>();
winrt::check_hresult(coreWebView2CompositionControllerInterop->get_UIAProvider(provider.put()));
winrt::check_hresult(coreWebView2CompositionControllerInterop->get_AutomationProvider(provider.put()));
}
return provider.as<winrt::IUnknown>();
}
Expand All @@ -1441,7 +1441,7 @@ winrt::IUnknown WebView2::GetProviderForHwnd(HWND hwnd)
// If there is no provider for the given HWND, CoreWebview2 will return UIA_E_ELEMENTNOTAVAILABLE,
// and we should just return an empty provider
auto coreWebView2EnvironmentInterop = m_coreWebViewEnvironment.as<ICoreWebView2EnvironmentInterop>();
winrt::hresult hr = coreWebView2EnvironmentInterop->GetProviderForHwnd(hwnd, provider.put());
winrt::hresult hr = coreWebView2EnvironmentInterop->GetAutomationProviderForWindow(hwnd, provider.put());
if (hr != UIA_E_ELEMENTNOTAVAILABLE)
{
winrt::check_hresult(hr);
Expand Down
4 changes: 2 additions & 2 deletions dev/WebView2/WebView2.idl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace MU_XC_NAMESPACE
{

[webhosthidden]
[MUX_PREVIEW]
[MUX_PUBLIC]
runtimeclass CoreWebView2InitializedEventArgs
{
HRESULT Exception{ get; };
Expand All @@ -13,7 +13,7 @@ runtimeclass CoreWebView2InitializedEventArgs
[webhosthidden]
[MUX_PROPERTY_CHANGED_CALLBACK(TRUE)]
[MUX_PROPERTY_CHANGED_CALLBACK_METHODNAME("OnPropertyChanged")]
[MUX_PREVIEW]
[MUX_PUBLIC]
unsealed runtimeclass WebView2 : Windows.UI.Xaml.Controls.Control
{
WebView2();
Expand Down
4 changes: 2 additions & 2 deletions dev/dll/Microsoft.UI.Xaml.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
<Import Condition="'$(PGOBuildMode)' == 'Optimize' and '$(DisablePGO)' != 'True'" Project="..\..\packages\$(PGODatabaseId).$(PGODatabaseVersion)\build\PGO.targets" />
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.210309.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.210309.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\packages\MUXCustomBuildTasks.1.0.74\build\native\MUXCustomBuildTasks.targets" Condition="Exists('..\..\packages\MUXCustomBuildTasks.1.0.74\build\native\MUXCustomBuildTasks.targets')" />
<Import Project="..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets')" />
<Import Project="..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets')" />
</ImportGroup>
<PropertyGroup>
<MergedWinmdDirectory>$(OutDir)Merged</MergedWinmdDirectory>
Expand Down Expand Up @@ -726,7 +726,7 @@
<Error Condition="!Exists('..\..\packages\MUXCustomBuildTasks.1.0.74\build\native\MUXCustomBuildTasks.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MUXCustomBuildTasks.1.0.74\build\native\MUXCustomBuildTasks.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.210309.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.210309.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.210309.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.210309.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets'))" />
</Target>
<!-- We want to generate SourceLink urls to GitHub even if we build against the AzDO repo -->
<Target Name="_TranslateAzureDevOpsUrlToGitHubUrl"
Expand Down
2 changes: 1 addition & 1 deletion dev/dll/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<package id="Microsoft.SourceLink.Common" version="1.0.0-beta2-18618-05" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.SourceLink.GitHub" version="1.0.0-beta2-18618-05" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.UI.Xaml" version="2.6.1" targetFramework="native" />
<package id="Microsoft.Web.WebView2" version="1.0.1020.30" targetFramework="native" />
<package id="Microsoft.Web.WebView2" version="1.0.1264.42" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210309.3" targetFramework="native" />
<package id="MUXCustomBuildTasks" version="1.0.74" targetFramework="native" />
</packages>
6 changes: 1 addition & 5 deletions test/MUXControls.Test/MSTest/MUXControls.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<ItemGroup>
<PackageReference Include="Axe.Windows" Version="1.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1264.42" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="Microsoft.Windows.Apps.Test" Version="1.0.181205002" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
Expand All @@ -21,11 +22,6 @@
<PackageReference Include="System.Drawing.Primitives" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.5.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2">
<Version>1.0.1020.30</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\testinfra\MUXTestInfra\MSTest\MUXTestInfra.MSTest.csproj" />
</ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions test/MUXControls.Test/TAEF/MUXControls.Test.TAEF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1020.30" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1264.42" />
</ItemGroup>
<ItemGroup>
<Reference Include="TE.Managed">
Expand All @@ -35,7 +35,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Axe.Windows" Version="1.0.4" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1018-prerelease" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="Microsoft.Windows.Apps.Test" Version="1.0.181205002" />
<PackageReference Include="TAEF.Redist.Wlk" Version="10.31.180822002" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.6.1\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.6.1\build\native\Microsoft.UI.Xaml.targets')" />
<Import Project="..\..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets')" />
<Import Project="..\..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand All @@ -154,7 +154,7 @@
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.6.1\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.6.1\build\native\Microsoft.UI.Xaml.targets'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets'))" />
</Target>
<Target Name="AfterBuild">
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.UI.Xaml" version="2.6.1" targetFramework="native" />
<package id="Microsoft.Web.WebView2" version="1.0.1020.30" targetFramework="native" />
<package id="Microsoft.Web.WebView2" version="1.0.1264.42" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.200615.7" targetFramework="native" />
</packages>
2 changes: 1 addition & 1 deletion test/MUXControlsTestApp/MSTest/MUXControlsTestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2">
<Version>1.0.1020.30</Version>
<Version>1.0.1264.42</Version>
</PackageReference>
</ItemGroup>
<Import Project="..\MUXControlsTestApp.Shared.projitems" />
Expand Down
2 changes: 1 addition & 1 deletion test/MUXControlsTestApp/TAEF/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"DiffPlex": "1.2.1",
"Microsoft.Net.Native.Compiler": "2.2.3",
"Microsoft.NETCore.UniversalWindowsPlatform": "6.2.8",
"Microsoft.Web.WebView2": "1.0.1020.30",
"Microsoft.Web.WebView2": "1.0.1264.42",
"MUXCustomBuildTasks": "1.0.74",
"TAEF.Redist.Wlk": "10.31.180822002",
"Win2D.uwp": "1.22.0"
Expand Down
4 changes: 2 additions & 2 deletions test/TestAppCX/TestAppCX.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="..\RetargetCopyLocalFiles.targets" />
<ImportGroup Label="ExtensionTargets" Condition="$(FeatureWebView2Enabled) == 'true'">
<Import Project="..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets')" />
<Import Project="..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="$(FeatureWebView2Enabled) == 'true' And !Exists('..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Web.WebView2.1.0.1020.30\build\native\Microsoft.Web.WebView2.targets'))" />
<Error Condition="$(FeatureWebView2Enabled) == 'true' And !Exists('..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Web.WebView2.1.0.1264.42\build\native\Microsoft.Web.WebView2.targets'))" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion test/TestAppCX/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Web.WebView2" version="1.0.1020.30" targetFramework="native" />
<package id="Microsoft.Web.WebView2" version="1.0.1264.42" targetFramework="native" />
</packages>

0 comments on commit b0a4412

Please sign in to comment.