WebView2 external dependency cannot be installed from an MSIX package on a Windows 10 target machine

Copper Contributor

Hi,

I have built an MSIX package that includes WebView2 added as an external dependency using Microsoft Packaging Tool (also tried to build same MSIX with Advanced Installer too).

When trying to install the MSIX on a Windows 10 machine (v21h2) I get the following WebView error: There was a problem installing. Error code: 0x80040c01

Daniel1175_0-1657611838726.png


Is there any known issue with WebView2 external dependency installation from an MSIX on Windows 10 machines? How can I troubleshoot this issue?

Here it is the full manifest of the sample MSIX I have built:

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:win32dependencies="http://schemas.microsoft.com/appx/manifest/externaldependencies" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap rescap build win32dependencies">
  <Identity Name="YourCompany.YourApplication" ProcessorArchitecture="x64" Publisher="CN=TestCert_2022-3-30_10-31-15" Version="1.0.1.0" />
  <Properties>
    <PublisherDisplayName>Your Company</PublisherDisplayName>
    <DisplayName>Your Application</DisplayName>
    <Logo>Assets\Store50x50Logo.png</Logo>
  </Properties>
  <Resources>
    <Resource Language="en-US" />
    <Resource uap:Scale="100" />
  </Resources>
  <Dependencies>
    <TargetDeviceFamily MaxVersionTested="10.0.22000.0" MinVersion="10.0.17763.0" Name="Windows.Desktop" />
    <win32dependencies:ExternalDependency Name="Microsoft.WebView2" Publisher="CN=Microsoft Windows, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" MinVersion="1.1.1.1" Optional="true" />
  </Dependencies>
  <Applications>
    <Application EntryPoint="Windows.FullTrustApplication" Executable="AI_STUBS\AiStub.exe" Id="updater.exe">
      <uap:VisualElements BackgroundColor="transparent" Description="Advanced Updater" DisplayName="updater.exe" Square150x150Logo="Assets\updater.exeSquare150x150Logo.png" Square44x44Logo="Assets\updater.exeSquare44x44Logo.png">
        <uap:InitialRotationPreference>
          <uap:Rotation Preference="portrait" />
          <uap:Rotation Preference="landscape" />
        </uap:InitialRotationPreference>
      </uap:VisualElements>
    </Application>
  </Applications>
  <build:Metadata>
    <build:Item Name="OperatingSystem" Version="10.0.22000.708" />
    <build:Item Name="AdvancedInstaller" Version="19.6 (bf52c98e)" />
    <build:Item Name="ProjectLicenseType" Version="architect" />
    <build:Item Name="SignTool.exe" Version="10.0.20348.1" />
    <build:Item Name="MakePri.exe" Version="10.0.20348.1" />
  </build:Metadata>
  
  <Capabilities>
	<rescap:Capability Name="runFullTrust" />
  </Capabilities>
</Package>


Thanks,
Daniel




8 Replies
Can you please submit a Feedback hub? It's the best way for our team to get logs and troubleshoot.

@Aditi_Narvekar I really think there is no other proper channel than the current one to submit this issue. It's an MSIX deployment issue and this is why I have posted it on MSIX community.

In case this helps, here it is a download link for an MSIX package that easily replicate this problem.


YourCompany.YourApplication_1.0.1.0_x64__m1gzpmna9bk94.msix 

You should just try to install it on a Windows 10 test machine with no WebView previously installed. Also do not forget to manually install the certificate the sample MSIX is signed with under the "Trusted Root Certification Authorities" store on your local machine. Same steps like the ones exposed here:

https://www.advancedinstaller.com/install-test-certificate-from-msix.html 

I think this is all you need to replicate and investigate the issue, generate whatever logs do you need, etc.

Let me know if you can have a look on this.

@Daniel1175 This error can happen if you re-sign the installer or pass incorrect parameters to it. See:

 

https://github.com/MicrosoftEdge/WebView2Feedback/issues/1582

 

Are you re-signing the installer with your own certificate?

 

@MikeH Mike, I am not re-signing the WebView2 installer nor do I pass any command line arguments to it.

To recap, the WebView2 is specified in the manifest of an MSIX package as a dependency. This means that when the MSIX package is installed the Microsoft's App Installer tool will download the WebView2 installer (from Microsoft's hosted repository) and launch it for installation.

The WebView2 installer download and install operation is solely handled by the Microsoft App Installer app. So I think this issue is on the Microsoft App Installer app side.

Once again the MSIX package (you can download and test it from my previous post) is built as per the specs of Microsoft docs.

@Daniel1175 Hi there. Did you ever figure this out? Running into the same issue with WebView2 and MSIX. 

@KeeganFerrett: Hi, I'm afraid not. Still waiting for a reply on this thread from someone from Microsoft's side. :(

@Daniel1175 Bumping this thread, but providing more information...

 

I Deployed a package similar to as described, on Windows 11 23H2 and latest Appinstaller.  I also added Optional="false", in an attempt to determine if the dependency was being attempted.

 

The package was successfully installed by the DesktopAppInstaller, however the app didn't work because WebView2 was not working.

 

Finding #1:

After installing, running the Get-AppXLog cmdlet shows that the following warning occured during the installation:

 

App manifest validation warning: Declared namespace http://schemas.microsoft.com/appx/manifest/externaldependencies is inapplicable, it will be ignored during manifest processing. 

 

This would likely indicate that the dependency would be ignored since the namespace isn't being supported.  A check of the latest documentation (win32dependencies:ExternalDependency (Windows 10, Windows 11) - Windows UWP applications | Microsoft...) shows no listed minimum versions, although in the Requirements table it does say "virtualization" for the item column, but I believe that to be a typo.  The minimum version of AppInstaller is stated, but that is satisfied.

 

I also noticed that in the example, the MinVersion fields for the target OS were too high (11.0 and 12.0 don't exist, at least not yet), but as this is an example one assumes that a 10.0 number like 10.0.19041.0 should be fine if there is no explicit minimum version mentioned in the documentation.

 

Further confirmation by using Get-AppXPackage shows that no dependency package was added to the system when the package was installed.

 

Finding #2:

Furthermore, checking Winget, I can find no package with the Microsoft.WebView2 name.  The closest match might be Microsoft.EdgeWebView2Runtime. 

 

Finding #3:

Hoping that perhaps all that is needed I also tried a manual installation of the WebView runtime (exe downloader from the Microsoft website), but this too does not satisfy the needs of the package running in the container.

 

Summary

From this, I assume that either the entire documentation is incorrect, was never implemented, or a typo in the documentation regarding the namespace itself is the cause.  I can find no corrected namespace to try after looking under every rock I can find.

 

IT Pros remain at a standstill and are unable to package the growing number of vendor apps that use WebView2 in their products.

 

@TIMOTHY MANGAN : Hi Tim,

Thank you for your thorough research on this! Your findings should be just enough for Microsoft team to easily investigate and find out the root cause of the issue.

However, seems like the MSIX project is not one of the Microsoft top priority anymore since no one from their side even bother to have a closer look on this. :((

All the best,
Daniel