Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Wrong id is selected when dealing with x86/x64 app on the same computer #414

Closed
clementpommier opened this issue Oct 9, 2023 · 20 comments
Labels
bug Something isn't working stale

Comments

@clementpommier
Copy link

The problem

Hi,

We're currently have an issue to update package that exist on the same computer as x86 and x64 version.

We have "Microsoft Visual C++ 2015-2022 Redistributable" installed and while the version x64 is detected as needing to be updated, the update command line select the version x86 to do the update which ultimately led us to an infinite loop.

Have you seen that behavior before? do you know how to solve that issue?

Thank you for your help,

Best,

What version of WAU has the issue?

1.17.6-2

What version of Windows are you using (ex. Windows 11 22H2)?

Windows 10H22

What version of winget are you using?

v1.6.2771

Log information

00:05:37 - No new update.
00:05:41 - User context execution not installed...
00:05:42 - End of process!

##################################################
#     CHECK FOR APP UPDATES - 10/9/2023
##################################################
01:02:16 - Running in System context
01:02:17 - Notification Level: Full. Notification Language: English
01:02:17 - Checking internet connection...
01:02:17 - Connected !
01:02:22 - Winget Version: v1.6.2771
01:02:22 - WAU current version: 1.17.6-2
01:02:22 - WAU AutoUpdate is Disabled.
01:02:22 - WAU uses External Lists from: C:\ProgramData\Winget-AutoUpdate-Configurator
01:02:22 - Newer List downloaded/copied to local path: C:\ProgramData\Winget-AutoUpdate
01:02:22 - WAU uses External Mods from: C:\ProgramData\Winget-AutoUpdate-Configurator\mods
01:02:22 - Mods are up to date.
01:02:22 - WAU uses Black List config
01:02:23 - Checking application updates on Winget Repository...
-> Available update : Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.36.…. Current version : 14.36.32532.0. Available version : 14.38.32919.0.
01:02:26 - Updating Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.36.… from 14.36.32532.0 to 14.38.32919.0...
01:02:35 - ##########   WINGET UPGRADE PROCESS STARTS FOR APPLICATION ID 'Microsoft.VCRedist.2015+.x86'   ##########
01:02:35 - -> Running: Winget upgrade --id Microsoft.VCRedist.2015+.x86 --accept-package-agreements --accept-source-agreements -h

   - 
   \ 
   | 
   / 
   - 
                                                                                                                        

  ███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  1024 KB / 8.07 MB
  ███████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  2.00 MB / 8.07 MB
  ███████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  3.00 MB / 8.07 MB
  ██████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  4.00 MB / 8.07 MB
  ██████████████████▒▒▒▒▒▒▒▒▒▒▒▒  5.00 MB / 8.07 MB
  ██████████████████████▒▒▒▒▒▒▒▒  6.00 MB / 8.07 MB
  █████████████████████████▒▒▒▒▒  7.00 MB / 8.07 MB
  █████████████████████████████▒  8.00 MB / 8.07 MB
  ██████████████████████████████  8.07 MB / 8.07 MB
                                                                                                                        

   - 
                                                                                                                        
No available upgrade found.
No newer package versions are available from the configured sources.
01:02:47 - ##########   WINGET UPGRADE PROCESS FINISHED FOR APPLICATION ID 'Microsoft.VCRedist.2015+.x86'   ##########
01:02:47 - Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.36.… updated to 14.38.32919.0 !
01:02:51 - 1 apps updated ! No more update.
01:02:53 - User context execution not installed...
01:02:53 - End of process!

Additional information

No response

@clementpommier clementpommier added the bug Something isn't working label Oct 9, 2023
@Romanitho
Copy link
Owner

Do you have same problem with latest WAU version?

@clementpommier
Copy link
Author

Hi @Romanitho ,

I'm using the Winget-AutoUpdate-Intune fork through Intune and they not yet updated to the latest version. i will do some standalone test and let you know, thank you.

@Romanitho
Copy link
Owner

thanks ;)

@clementpommier
Copy link
Author

Hi @Romanitho,

I did the test with the latest stable version (1.17.8) and i had the same issue, the logs below:

##################################################

CHECK FOR APP UPDATES - 10/16/2023

##################################################
06:26:53 - Running in System context
06:26:54 - Notification Level: SuccessOnly. Notification Language: English
06:26:55 - Checking internet connection...
06:26:57 - Connected !
06:27:03 - Winget Version: v1.6.2771
06:27:03 - WAU current version: 1.17.8
06:27:03 - WAU AutoUpdate is Disabled.
06:27:04 - WAU uses External Lists from: C:\ProgramData\Winget-AutoUpdate-Configurator
06:27:05 - Newer List downloaded/copied to local path: C:\ProgramData\Winget-AutoUpdate
06:27:06 - WAU uses External Mods from: C:\ProgramData\Winget-AutoUpdate-Configurator\mods
06:27:07 - Mods are up to date.
06:27:07 - 2 Mods deleted (not externally managed) from local path: C:\ProgramData\Winget-AutoUpdate\mods
06:27:07 - WAU uses Black List config
06:27:15 - Checking application updates on Winget Repository...
-> Available update : Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.36.. Current version : 14.36.32532.0. Available version : 14.38.32919.0.
06:27:52 - Updating Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.36. from 14.36.32532.0 to 14.38.32919.0...
06:27:52 - ########## WINGET UPGRADE PROCESS STARTS FOR APPLICATION ID 'Microsoft.VCRedist.2015+.x86' ##########
06:27:52 - -> Running: Winget upgrade --id Microsoft.VCRedist.2015+.x86 --accept-package-agreements --accept-source-agreements -h

Thank you

@Romanitho
Copy link
Owner

very weird. I tired to reproduce the problem, but it works as expected on my side 🤔

@Romanitho
Copy link
Owner

A part of my logs:

...
Successfully installed
17:28:34 - ##########   WINGET UPGRADE PROCESS FINISHED FOR APPLICATION ID 'Microsoft.VCRedist.2015+.x64'   ##########
17:28:34 - Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.36. updated to 14.38.32919.0 !
17:28:37 - Microsoft Edge : Skipped upgrade because it is in the excluded app list
17:28:37 - Updating Microsoft Visual C++ 2015-2022 Redistributable (x86) - 14.36. from 14.36.32532.0 to 14.38.32919.0...
17:28:40 - ##########   WINGET UPGRADE PROCESS STARTS FOR APPLICATION ID 'Microsoft.VCRedist.2015+.x86'   ##########
17:28:40 - -> Running: C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.22.2782.0_x64__8wekyb3d8bbwe\winget.exe upgrade --id Microsoft.VCRedist.2015+.x86 --accept-package-agreements --accept-source-agreements
...

@Swiftnc
Copy link

Swiftnc commented Nov 9, 2023

We also have this C++ issue. It only seems to affect C++ versions. We had to exclude them as it would attempt to install daily while not updating the correct x86 or x64 version. I did not spend a lot of time trying to understand why, just acknowledge c++ detection was broken. While not helpful, I just mention this to help you understand there is an issue here.

Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 10, 2023
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 25, 2023
@PZan
Copy link

PZan commented Feb 9, 2024

I'm seeing this as well. Is this issue considered solved?

08:01:50 - Updating Microsoft Visual C++ 2015-2022 Redistributable (x86) - from 14.38.33130.0 to 14.38.33135.0...
08:01:50 - ##########   WINGET UPGRADE PROCESS STARTS FOR APPLICATION ID 'Microsoft.VCRedist.2015+.x64'   ##########
08:01:50 - -> Running: Winget upgrade --id Microsoft.VCRedist.2015+.x64 -e --accept-package-agreements --accept-source-agreements -s winget -h
  ███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  1024 KB / 9.17 MB
  ██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  2.00 MB / 9.17 MB
  █████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  3.00 MB / 9.17 MB
  █████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  4.00 MB / 9.17 MB
  ████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒  5.00 MB / 9.17 MB
  ███████████████████▒▒▒▒▒▒▒▒▒▒▒  6.00 MB / 9.17 MB
  ██████████████████████▒▒▒▒▒▒▒▒  7.00 MB / 9.17 MB
  ██████████████████████████▒▒▒▒  8.00 MB / 9.17 MB
  █████████████████████████████▒  9.00 MB / 9.17 MB
  ██████████████████████████████  9.17 MB / 9.17 MB
No available upgrade found.
No newer package versions are available from the configured sources.
08:01:53 - ##########   WINGET UPGRADE PROCESS FINISHED FOR APPLICATION ID 'Microsoft.VCRedist.2015+.x64'   ##########

@PZan
Copy link

PZan commented Feb 20, 2024

@Romanitho, sorry to bother you, but are you making progress with this problem or is it considered closed?

@Romanitho
Copy link
Owner

also discussed in #568
To be honest, I don't have any idea why. I can't reproduce the behavior you described.

@PZan
Copy link

PZan commented Feb 20, 2024

Thanks for the update. I'm working around the issue in this particular case for now, by deploying the update as a win32 app in Intune, with the help of Intune App Factory. But I am sort of expecting it to resurface eventually. If so I will invest more time into troubleshooting on my end.

@PZan
Copy link

PZan commented Feb 21, 2024

So there's something strange going on. The x86 package of VCRedist 2015-2022 is a version below the x64 package in the official Winget repo. As I mentioned above I included the redistributables to my "Intune App Factory" library and this was were I first noticed this.

PS C:\> winget search Microsoft.VCRedist.2015+
Name                                                 Id                           Version       Source
-------------------------------------------------------------------------------------------------------
Microsoft Visual C++ 2015-2022 Redistributable (x86) Microsoft.VCRedist.2015+.x86 14.38.33130.0 winget
Microsoft Visual C++ 2015-2022 Redistributable (x64) Microsoft.VCRedist.2015+.x64 14.38.33135.0 winget

But this alone doesn't explain why WAU tries to install a version (14.38.33135.0) of the x86 edition of VCRedist 2022 that doesn't actually exist.

Anyway... I manually created Win32App of the newer version of the x86 installer and now this issue is gone in my case.

Here's my "Intune recipee" on how to create an "upgrade package" for Microsoft.VCRedist.2015+.x86:

  • Download the latest installer from MS: https://aka.ms/vs/17/release/vc_redist.x86.exe
  • Create the intunewin installer according to your default procedure
  • Make a note of the version and modify the detection script below (in case your downloaded version is any other than 14.38.33135.0)
  • In Intune, create a "Windows App (Win32)"
  • Fill out the App information page and the Program page in accordance to your preferences
  • Configure additional requirement rules:
    • Type: Registry
    • Key Path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X86
    • Value name: Installed
    • Registry Key Requirement: Integer comparison
    • Operator: Equals
    • Value: 1
    • Associatoed with a 32-bit app on 64-bit clients: Yes
  • Detection method
    # Define minimum required version
    $Version = [system.version]::Parse("14.38.33135.0")
    $DisplayName = "Microsoft Visual C++ 2015-2022 Redistributable (x86) - *"
    
    # Process each key in Uninstall registry path and detect if application is installed, or if a newer version exists that should be superseeded
    switch ([System.IntPtr]::Size) {
        8 { $UninstallKeyPath = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" }
        4 { $UninstallKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" }
    }
    $UninstallKeys = Get-ChildItem -Path $UninstallKeyPath
    foreach ($UninstallKey in $UninstallKeys) {
        $CurrentUninstallKey = Get-ItemProperty -Path $UninstallKey.PSPath -ErrorAction "SilentlyContinue"
        if ($CurrentUninstallKey.DisplayName -like $DisplayName) {
            # An installed version of the application was detected, ensure the version info is equal to or greater than with what's specified as the minimum required version
            if ([System.Version]$CurrentUninstallKey.DisplayVersion -ge $Version) {
                Write-Output "Installed"
                exit 0
            }
        }
    }
    • Assign to All devices and Show toast notifications for computer restarts (or w/e you prefer)

Following these instructions will result in an "upgrade package" and will only install where applicable (AKA where VCRedist.2015+.x86 is already installed). The detection script also handles future higher versions distributed through Winget, so it shouldn't cause any conflicts on your devices.

@PZan
Copy link

PZan commented Feb 21, 2024

Here are some links that seems to be related
microsoft/winget-pkgs#118664
microsoft/winget-cli#2129
microsoft/winget-cli#3940

@AndrewDemski-ad-gmail-com
Copy link
Contributor

@ccorrion
Copy link

ccorrion commented Mar 3, 2024

We are also seeing this, specifically on the vcredists:

`07:52:09 - Updating Microsoft Visual C++ 2013 Redistributable (x8 from 12.0.40660.0 to 12.0.40664.0...
07:52:09 - ########## WINGET UPGRADE PROCESS STARTS FOR APPLICATION ID 'Microsoft.VCRedist.2013.x64' ##########
07:52:09 - -> Running: Winget upgrade --id Microsoft.VCRedist.2013.x64 -e --accept-package-agreements --accept-source-agreements -s winget -h

███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 1024 KB / 9.39 MB
██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 2.00 MB / 9.39 MB
█████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 3.00 MB / 9.39 MB
████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 4.00 MB / 9.39 MB
███████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 5.00 MB / 9.39 MB
███████████████████▒▒▒▒▒▒▒▒▒▒▒ 6.00 MB / 9.39 MB
██████████████████████▒▒▒▒▒▒▒▒ 7.00 MB / 9.39 MB
█████████████████████████▒▒▒▒▒ 8.00 MB / 9.39 MB
████████████████████████████▒▒ 9.00 MB / 9.39 MB
██████████████████████████████ 9.39 MB / 9.39 MB
UpdateNoPackagesFound
UpdateNoPackagesFoundReason
07:52:12 - ########## WINGET UPGRADE PROCESS FINISHED FOR APPLICATION ID 'Microsoft.VCRedist.2013.x64' ##########
07:52:12 - Microsoft Visual C++ 2013 Redistributable (x8 updated to 12.0.40664.0 !`

We do have both architectures installed on the server, if that makes a difference. Happy to do additional troubleshooting/investigation to get to the bottom of this.

@Romanitho
Copy link
Owner

what do you have if you run:
winget upgrade

@ccorrion
Copy link

ccorrion commented Mar 5, 2024

I get this:
PS C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.21.3482.0_x64__8wekyb3d8bbwe> .\winget upgrade
...
Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.21005 Microsoft.VCRedist.2013.x64 12.0.21005.1 12.0.40664.0 winget

So it seems winget itself is not matching correctly.

@Romanitho
Copy link
Owner

So not directly related to WAU :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

6 participants