microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.29k stars 1.45k forks source link

Install failure - Dependancy not found - Microsoft.UI.Xaml #1779

Closed FreelanceX closed 2 years ago

FreelanceX commented 2 years ago

Brief description of your issue

An older version of Winget is already installed. Trying to install latest version gives an Error message regarding dependancy missing. (Microsoft.UI)

Installed Microsoft.UI.Xaml 2.7 (latest) and the same error occurs. Works fine on another device.

Steps to reproduce

Add-AppxPackage $PSScriptRoot\Microsoft.DesktopAppInstaller_2021.1026.721.0_neutral___8wekyb3d8bbwe.msixbundle

Expected behavior

WinGet to install

Actual behavior

Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF3, Package failed updates, dependency or conflict validation. Windows cannot install package Microsoft.DesktopAppInstaller_1.16.12986.0_x64__8wekyb3d8bbwe because this package depends on a framework that could not be found. Provide the framework "Microsoft.UI.Xaml.2.6" published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x64 processor architecture and minimum version 2.62106.23002.0, along with this package to install. The frameworks with name "Microsoft.UI.Xaml.2.6" currently installed are: {} NOTE: For additional information, look for [ActivityId] 323877b9-ea92-0004-9db3-393292ead701 in the Event Log or use the command line Get-AppPackageLog -ActivityID 323877b9-ea92-0004-9db3-393292ead701 At \\\winstalllite.ps1:22 char:1

Environment

Windows 10 21H1 - 19043.13478
Currently installed version of Winget: v1.11.10771.0
denelon commented 2 years ago

Which method of installation are you attempting? Is this an upgrade via the Microsoft Store, or are you downloading a release from the GitHub releases page?

FreelanceX commented 2 years ago

This is installing during a powershell script. The package has been manually downloaded from github and placed in the script root. Running it on another machine works fine. Both machines had an older version of winget installed. Installed version of winget on problematic machine works, but won't upgrade and therefore new commands aren't accepted further down the script such as upgrade and accept agreements.

jedieaston commented 2 years ago

You aren't on ARM64 by any chance, are you? I was investigating a similar issue yesterday with a different appx package, couldn't figure it out.

FreelanceX commented 2 years ago

No. Windows 10 Education x64 21H1. November cumulative.

denelon commented 2 years ago

@FreelanceX is the Microsoft Store available on the machines?

If it is, can you get the "App Installer" upgrade from the Microsoft Store?

FreelanceX commented 2 years ago

@denelon

Although I cant get to that device until Thursday now, yes the store is available.

I am currently sat infront of a newly built device which is getting the exact same error. I have just installed App Installer from the store and this has allowed the script/install to work!

Is this by design? I assumed Installing Microsoft.DesktopAppInstaller_8wekyb3d8bbwe would install App Installer?

ItzLevvie commented 2 years ago

Is this by design? I assumed Installing Microsoft.DesktopAppInstaller_8wekyb3d8bbwe would install App Installer?

Some applications require you to install the required dependencies for the application to fully work without any errors or issues.

If the required dependencies are missing from your PC, you'll not be able to use the application until you've installed those required dependencies.

The package has been manually downloaded from github and placed in the script root.

Judging by the .msixbundle's file name, you downloaded the .msixbundle from https://store.rg-adguard.net instead from GitHub Releases.

App Installer version 1.16.12986.0 is a release from the Microsoft Store, and newer releases from the Microsoft Store contains an additional dependency called MUX (Microsoft UI XAML), which updates the App Installer GUI to match the design with Windows 11.

So, if you double-click on the .msixbundle file and click on the Install button, it should automatically install the necessary dependencies for you. For example: Microsoft.VCLibs.140.00.UWPDesktop & Microsoft.UI.Xaml.2.6.

This is installing during a powershell script.

If you're installing App Installer via Add-AppxPackage in Windows PowerShell, you will first need to manually install Microsoft.VCLibs.140.00.UWPDesktop and Microsoft.UI.Xaml.2.6 before installing App Installer via Add-AppxPackage.

A reminder that if you're installing WinGet manually, you need to make sure to install Microsoft.UI.Xaml.2.6 and not Microsoft.UI.Xaml.2.7 as App Installer hasn't been updated to use Microsoft.UI.Xaml.2.7 yet.

Installing either the .msixbundle from GitHub Releases or updating App Installer via Microsoft Store should avoid this issue.

FreelanceX commented 2 years ago

Ah that explains a lot @ItzLevvie.

I was using the release from github originally, but I was running into an issue on some devices which refused to install due to the current version installed. It was reporting a newer version than what was trying to install, but it wouldnt accept the commands such as upgrade and accept agreements.

Googling the issue brought me to https://store.rg-adguard.net/ as youve rightly said, where I downloaded the latest version and that fixed the error above. I am getting the error in my post now on some devices since then and that explains where my issue lies.

I am also installing MS UI 2.7 in my script (addded since this issue), which also explains another part of the issue.

This is the part of my script which handles the install:

#Enable TLS 1.2 for this session in-case disabled on machine
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

#Install NuGet Package Provider
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
#Install Package Provider Source
Register-PackageSource -provider NuGet -name nugetRepository -location https://www.nuget.org/api/v2
#Install Prerequisites for WinGet
Install-Package Microsoft.UI.Xaml -Force

#Enable WinGet installer and prerequisite - latest as of December 2021
Add-AppxPackage $PSScriptRoot\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe.appx
Add-AppxPackage $PSScriptRoot\Microsoft.DesktopAppInstaller_2021.1026.721.0_neutral___8wekyb3d8bbwe.msixbundle

So if I wish to continue using this automated method, I just need to include version 2.6?

EDIT: I would just like to add I switched to manually installing Microsoft UI 2.6 from the appx file on a clean built device and its worked first time. Looks like this is what I need to do going forward. Its also quicker than that nuget route.

#Enable TLS 1.2 for this session in-case disabled on machine
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

#Install NuGet Package Provider. For future use
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
#Install Package Provider Source. For future use
Register-PackageSource -provider NuGet -name nugetRepository -location https://www.nuget.org/api/v2

#Enable WinGet installer and prerequisite - latest as of December 2021
Add-AppxPackage $PSScriptRoot\Microsoft.UI.Xaml.2.6_2.62112.3002.0_x64__8wekyb3d8bbwe.appx
Add-AppxPackage $PSScriptRoot\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe.appx
Add-AppxPackage $PSScriptRoot\Microsoft.DesktopAppInstaller_2021.1026.721.0_neutral___8wekyb3d8bbwe.msixbundle
denelon commented 2 years ago

Hey, I just wanted to give everyone a heads up. We're working on upgrading the dependency to use WebUI 2.7 in a future release. There was a bug reported against 2.6, so we need to update the dependency.

I'm just putting this comment for future readers to be informed :)

FreelanceX commented 2 years ago

I think this can be marked as resolved. Following the suggestion of including all of the appx files (if not using the github version) it is now working flawlessly.

Thank you everyone for the support.

I now just need to fix Google Chrome always moaning about the checksum. But thats for a different request.

liudonghua123 commented 2 years ago

I got this error when I tried to install WSA on windows 11.

I have to install Microsoft.UI.Xaml.2.6_2.62112.3002.0_x64__8wekyb3d8bbwe.appx before install MicrosoftCorporationII.WindowsSubsystemForAndroid_2208.40000.5.0neutral~_8wekyb3d8bbwe.msixbundle.

reference: https://pureinfotech.com/install-windows-subsystem-android-wsa-windows-11/

BJSOMEBODY commented 10 months ago

i got the same error : Install failure - Dependancy not found - Microsoft.UI.Xaml #1779 after i ,lost Tiktok and X on my win 11.

all i did was to reinstall Microsoft.Microsoft Edge.Stableand that solved it.