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

Failed to open the predefined source; please report to winger maintainers + This file does not have an app associated with it #5177

Open
AdreKiseque opened this issue Feb 4, 2025 · 4 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@AdreKiseque
Copy link

Brief description of your issue

Bit of a two-in-one here, ran into some peculiar errors while running tests on a script of mine in a VM. They came in quick succession, which makes me wonder if they might be related somehow. The first error was pretty direct—while iterating through a loop through a loop of packages to install, winget returned with an error on the last element of the array. 0x80071130
Image
Shortly thereafter, I got an error trying to open a shortcut with a winget command.
Image
This second error is somewhat reminiscent of other errors I've gotten a few times, where the winget command was "not recognized"; but I can't confirm they're the same due to the different output formats (command line vs dialogue box).

Steps to reproduce

I can't give much info on how to reliably reproduce this, since it's happened just once out of many unchanged (in this dimension) tests. But I can give my setup:
Windows 11 Pro 24H2 en-GB ISO running in VMware Workstation Pro
And some of my script:

$NicePackages = @(
    <Various other packages>,
    'Rustlang.Rustup',
    'ShareX.ShareX',
    'Valve.Steam',
    'voidtools.everything' ## First error here
)
foreach($Package in $NicePackages) {
    winget install --id $Package --source winget
    Start-Sleep -Milliseconds 100 # This seems to help it not have random errors apparently
}
winget install Mozilla.Firefox --custom /PrivateBrowsingShortcut=false --source winget ## No error?
# Spotify won't install from an elevated session so we have to do this nonsense
$Shell = New-Object -ComObject WScript.Shell
$Shortcut = $Shell.CreateShortcut("$PSScriptRoot\Install.lnk")
$Shortcut.TargetPath = 'winget'
$Shortcut.Arguments = 'install Spotify.Spotify'
$Shortcut.Save()
explorer.exe "$PSScriptRoot\Install.lnk" ## Second error here
Start-Sleep 1 # We love race conditions don't we folks
Remove-Item -Path "$PSScriptRoot\Install.lnk"

*Double hashes represent added comments for the report
And I can also add the fact I was running Install-Language as a job in the background during this, on the off chance it's relevant.

Expected behavior

Winget should install the packages and not return errors

Actual behavior

Winget returns errors and does not install the packages

Environment

Windows: Windows.Desktop v10.0.26100.1742
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.10120.0

Unfortunately I cannot share any logs, as I've already reset the VM to continue testing the script. My apologies for this oversight.
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Feb 4, 2025
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Feb 4, 2025
@denelon
Copy link
Contributor

denelon commented Feb 4, 2025

It's possible that installing something else in the background caused the problem. In general, it's best to only have a single "install" happening at a time for MSI, and .exe-based installers. MSIX should be able to support six in parallel, but we haven't started making those kinds of optimizations in WinGet yet.

For the most part, you should be able to use the packages.json format from the output of winget export packages.json or even better, use the WinGet Configuration format for a single file designed to install a collection of packages (and given DSC Resources, configure them). I'll keep this issue open for a while to see if we can get a reliable repro with logs.

@AdreKiseque
Copy link
Author

The thing is, it's not just that the installation failed, but winget itself did; it didn't even get around to downloading the installer in the first error—or to being called at all in the second.

@Trenly
Copy link
Contributor

Trenly commented Feb 4, 2025

To me, the fact that .lnk files were broken indicates something was wrong with the VM image at the time it was loaded, since .lnk is a Windows built-in filetype. In fact, it's just the filetype of a Shortcut. For the .lnk files to not be handled properly indicates something must be wrong with shell itself for it to become unrecognized

@AdreKiseque
Copy link
Author

That's a good observation—the error does seem to be talking about the shortcut itself rather than its target. Technically, I did explicitly specify the program to open it—explorer.exe. Though I suppose the error may be coming from explorer reporting that it doesn't know what to do with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

3 participants