[SOLVED] First UniGetUI breaks so I try WinGet command-line tool instead, but that breaks as well ?

Status
Not open for further replies.
Jun 14, 2020
128
20
4,595
I recently started using UniGetUI as a free and open source means of keeping my software up to date through a GUI. However, out of the blue, it stopped working for me. Packages wouldn't even show up in the GUI list anymore.

I decided to check the WinGet command directly so I opened PowerShell to see if that could help me nail down the issue. However, when I did this, I can't use Winget to fetch updates anymore either. Now, when I try "winget upgrade -r", it returns with an error saying,
Failed when searching source: winget
An unexpected error occurred while executing the command:
0x8a15000f : Data required by the source is missing

I tried switching over to Command Prompt just in case it was a difference related to PowerShell but CMD gave me the same error code. I tried running it in both in administrator mode, no luck. I ran "winget list" and it gave me the full readout. I tried a few other switches with it and it seems to be working for most things, but it continues to give me that error code. It's not because nothing needs an update; I ran PatchMyPC to double check and it listed a few programs as needing updated. I've also run SFC to see if anything is corrupted, but nothing seems to come up. I also checked Event Viewer to see if I could find anything that might indicate what's going on but no, aside from that error code, nothing gives me a hint as to what's going on here.

I would say it's just because I run a standard account 99% of the time for security but that doesn't make any sense because both UniGetUI and Winget both worked flawlessly until just about a week ago. I even gave it a bit of time hoping maybe it was just a server issue but it's still doing this and it's starting to really irk me.

I also did try to do a search for this issue online but they recommended doing things such as resetting the sources, checking to ensure certain domains weren't blocked, things along that line but none of them fixed the issue for me. I'm honestly not sure what else I can do at this point but I figured I'd run it by the forum and see if any of you have any suggestions?

I'm running Windows 10 Pro (x64) 22H2 (build 19045.4780).
 
Solution
run this command from powershell
Code:
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.Winget.Source_8wekyb3d8bbwe
Add-AppPackage -path "https://cdn.winget.microsoft.com/cache/source.msix."

if that wont help, try updating winget
powershell script:
Code:
function Install-WinGet {
  $tempFolderName = 'WinGetInstall'
  $tempFolder = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath $tempFolderName
  New-Item $tempFolder -ItemType Directory -ErrorAction SilentlyContinue | Out-Null

  $apiLatestUrl = if ($Prerelease) { 'https://api.github.com/repos/microsoft/winget-cli/releases?per_page=1' } else { 'https://api.github.com/repos/microsoft/winget-cli/releases/latest' }
  [Net.ServicePointManager]::SecurityProtocol =...
run this command from powershell
Code:
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.Winget.Source_8wekyb3d8bbwe
Add-AppPackage -path "https://cdn.winget.microsoft.com/cache/source.msix."

if that wont help, try updating winget
powershell script:
Code:
function Install-WinGet {
  $tempFolderName = 'WinGetInstall'
  $tempFolder = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath $tempFolderName
  New-Item $tempFolder -ItemType Directory -ErrorAction SilentlyContinue | Out-Null

  $apiLatestUrl = if ($Prerelease) { 'https://api.github.com/repos/microsoft/winget-cli/releases?per_page=1' } else { 'https://api.github.com/repos/microsoft/winget-cli/releases/latest' }
  [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  $WebClient = New-Object System.Net.WebClient

  function Get-LatestUrl    {
        ((Invoke-WebRequest $apiLatestUrl -UseBasicParsing | ConvertFrom-Json).assets | Where-Object { $_.name -match '^Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle$' }).browser_download_url
  }

  function Get-LatestHash {
    $shaUrl = ((Invoke-WebRequest $apiLatestUrl -UseBasicParsing | ConvertFrom-Json).assets | Where-Object { $_.name -match '^Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.txt$' }).browser_download_url
    $shaFile = Join-Path -Path $tempFolder -ChildPath 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.txt'
    $WebClient.DownloadFile($shaUrl, $shaFile)
    Get-Content $shaFile
  }
  $desktopAppInstaller = @{
    fileName = 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle'
    url      = $(Get-LatestUrl)
    hash     = $(Get-LatestHash)
  }
  $vcLibsUwp = @{
    fileName = 'Microsoft.VCLibs.x64.14.00.Desktop.appx'
    url      = 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
    hash     = '9BFDE6CFCC530EF073AB4BC9C4817575F63BE1251DD75AAA58CB89299697A569'
  }
  $uiLibsUwp = @{
    fileName = 'Microsoft.UI.Xaml.2.7.zip'
    url      = 'https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.0'
    hash     = '422FD24B231E87A842C4DAEABC6A335112E0D35B86FAC91F5CE7CF327E36A591'
  }
  $dependencies = @($desktopAppInstaller, $vcLibsUwp, $uiLibsUwp)
  Write-Host '--> Checking dependencies'
  foreach ($dependency in $dependencies) {
    $dependency.file = Join-Path -Path $tempFolder -ChildPath $dependency.fileName
    if (-Not ((Test-Path -Path $dependency.file -PathType Leaf) -And $dependency.hash -eq $(Get-FileHash $dependency.file).Hash)) {
      Write-Host @"
    - Downloading:
      $($dependency.url)
"@
      try {
        $WebClient.DownloadFile($dependency.url, $dependency.file)
      }
      catch {
        #Pass the exception as an inner exception
        throw [System.Net.WebException]::new("Error downloading $($dependency.url).", $_.Exception)
      }
      if (-not ($dependency.hash -eq $(Get-FileHash $dependency.file).Hash)) {
        throw [System.Activities.VersionMismatchException]::new('Dependency hash does not match the downloaded file')
      }
    }
  }

  if (-Not (Test-Path (Join-Path -Path $tempFolder -ChildPath \Microsoft.UI.Xaml.2.7\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx)))    {
    Expand-Archive -Path $uiLibsUwp.file -DestinationPath ($tempFolder + '\Microsoft.UI.Xaml.2.7') -Force
  }
  $uiLibsUwp.file = (Join-Path -Path $tempFolder -ChildPath \Microsoft.UI.Xaml.2.7\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx)
  Add-AppxPackage -Path $($desktopAppInstaller.file) -DependencyPath $($vcLibsUwp.file), $($uiLibsUwp.file)
  Remove-Item $tempFolder -recurse -force
}
Write-Host -ForegroundColor Green "--> Updating Winget`n"
Install-Winget
 
Solution
run this command from powershell
Code:
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.Winget.Source_8wekyb3d8bbwe
Add-AppPackage -path "https://cdn.winget.microsoft.com/cache/source.msix."

if that wont help, try updating winget
powershell script:
Code:
function Install-WinGet {
  $tempFolderName = 'WinGetInstall'
  $tempFolder = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath $tempFolderName
  New-Item $tempFolder -ItemType Directory -ErrorAction SilentlyContinue | Out-Null

  $apiLatestUrl = if ($Prerelease) { 'https://api.github.com/repos/microsoft/winget-cli/releases?per_page=1' } else { 'https://api.github.com/repos/microsoft/winget-cli/releases/latest' }
  [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  $WebClient = New-Object System.Net.WebClient

  function Get-LatestUrl    {
        ((Invoke-WebRequest $apiLatestUrl -UseBasicParsing | ConvertFrom-Json).assets | Where-Object { $_.name -match '^Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle$' }).browser_download_url
  }

  function Get-LatestHash {
    $shaUrl = ((Invoke-WebRequest $apiLatestUrl -UseBasicParsing | ConvertFrom-Json).assets | Where-Object { $_.name -match '^Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.txt$' }).browser_download_url
    $shaFile = Join-Path -Path $tempFolder -ChildPath 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.txt'
    $WebClient.DownloadFile($shaUrl, $shaFile)
    Get-Content $shaFile
  }
  $desktopAppInstaller = @{
    fileName = 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle'
    url      = $(Get-LatestUrl)
    hash     = $(Get-LatestHash)
  }
  $vcLibsUwp = @{
    fileName = 'Microsoft.VCLibs.x64.14.00.Desktop.appx'
    url      = 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
    hash     = '9BFDE6CFCC530EF073AB4BC9C4817575F63BE1251DD75AAA58CB89299697A569'
  }
  $uiLibsUwp = @{
    fileName = 'Microsoft.UI.Xaml.2.7.zip'
    url      = 'https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.0'
    hash     = '422FD24B231E87A842C4DAEABC6A335112E0D35B86FAC91F5CE7CF327E36A591'
  }
  $dependencies = @($desktopAppInstaller, $vcLibsUwp, $uiLibsUwp)
  Write-Host '--> Checking dependencies'
  foreach ($dependency in $dependencies) {
    $dependency.file = Join-Path -Path $tempFolder -ChildPath $dependency.fileName
    if (-Not ((Test-Path -Path $dependency.file -PathType Leaf) -And $dependency.hash -eq $(Get-FileHash $dependency.file).Hash)) {
      Write-Host @"
    - Downloading:
      $($dependency.url)
"@
      try {
        $WebClient.DownloadFile($dependency.url, $dependency.file)
      }
      catch {
        #Pass the exception as an inner exception
        throw [System.Net.WebException]::new("Error downloading $($dependency.url).", $_.Exception)
      }
      if (-not ($dependency.hash -eq $(Get-FileHash $dependency.file).Hash)) {
        throw [System.Activities.VersionMismatchException]::new('Dependency hash does not match the downloaded file')
      }
    }
  }

  if (-Not (Test-Path (Join-Path -Path $tempFolder -ChildPath \Microsoft.UI.Xaml.2.7\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx)))    {
    Expand-Archive -Path $uiLibsUwp.file -DestinationPath ($tempFolder + '\Microsoft.UI.Xaml.2.7') -Force
  }
  $uiLibsUwp.file = (Join-Path -Path $tempFolder -ChildPath \Microsoft.UI.Xaml.2.7\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx)
  Add-AppxPackage -Path $($desktopAppInstaller.file) -DependencyPath $($vcLibsUwp.file), $($uiLibsUwp.file)
  Remove-Item $tempFolder -recurse -force
}
Write-Host -ForegroundColor Green "--> Updating Winget`n"
Install-Winget
Very nice, this worked! Thanks for your help!
 
  • Like
Reactions: kerberos_20
Status
Not open for further replies.