microsoft / microsoft/winget-cli
WinGet does not work when deployed through Lansweeper
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Brief description of your issue
I work at a large organization and we are trying to automate the process of updating apps using WinGet and Lansweeper.
I wrote a script that uses 'winget export' to save a JSON of the installed apps on the device, and compares that to an approved_apps.json file that has the version number we want the apps to update to. When I am logged in as an administrator, the script runs with no issues.
However, when I try to deploy the script through Lansweeper, it fails to export the JSON file. Additionally, I keep getting this error message: "Failed to open available source: winget". I have tried to deploy the script using "system account" and "scanning credentials" on Lansweeper and in both instances it fails. I have also tried to specify the proxy as well but it still fails.
I re-wrote the script without using winget export, but I run into the same issue because of this error "Failed to open available source: winget". When deployed through lansweeper, I keep getting the error message that "[AppID] Not installed."
WinGet-2025-07-03-09-54-33.024.log
Steps to reproduce
winget export -o "c:\WinGet Logs\packages.json" --include-versions --accept-source-agreements
Expected behavior
The expected behaviour is that winget successfully exports the packages.json file and does not run into the "Failed to open available source: winget" issue.
Actual behavior
packages.json is not being exported. Failed to open available source: winget
2025-07-03 09:54:33.026 [CORE] Command line Args: "C:\Users\adminNB\AppData\Local\Microsoft\WindowsApps\winget.exe" export -o C:\Test\packages.json --include-versions --accept-source-agreements --open-logs
2025-07-03 09:54:33.026 [CORE] Package: Microsoft.DesktopAppInstaller v1.25.390.0
2025-07-03 09:54:33.026 [CORE] IsCOMCall:0; Caller: winget-cli
2025-07-03 09:54:33.033 [CLI ] WinGet invoked with arguments: 'export' '-o' 'C:\Test\packages.json' '--include-versions' '--accept-source-agreements' '--open-logs'
2025-07-03 09:54:33.033 [CLI ] Found subcommand: export
2025-07-03 09:54:33.033 [CLI ] Leaf command to execute: root:export
2025-07-03 09:54:33.036 [CLI ] Executing command: export
2025-07-03 09:54:33.053 [REPO] Default source requested, multiple sources available, adding all to source references.
2025-07-03 09:54:33.053 [REPO] Adding to source references msstore
2025-07-03 09:54:33.053 [CORE] Default proxy is not set
2025-07-03 09:54:33.053 [REPO] REST HTTP Client helper does not use proxy
2025-07-03 09:54:33.053 [REPO] Adding to source references winget
2025-07-03 09:54:33.054 [CLI ] Created authentication arguments. Mode: silentPreferred, Account:
2025-07-03 09:54:33.058 [CORE] Did not find extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2025-07-03 09:54:33.059 [CORE] Did not find extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2025-07-03 09:54:33.203 [CORE] Downloading to path: C:\Users\adminNB\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix
2025-07-03 09:54:33.204 [CORE] Started applying motw to C:\Users\adminNB\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix with zone: 3
2025-07-03 09:54:33.206 [CORE] Finished applying motw
2025-07-03 09:54:33.206 [CORE] WinINet downloading from url: https://cdn.winget.microsoft.com/cache/source2.msix
2025-07-03 09:54:33.472 [CORE] Download hash: de86fb3dd8e4e9a5fac0e910ce56d154b7eb42e15118ba1594c5ce4c62db21e2
2025-07-03 09:54:33.472 [CORE] Download completed.
2025-07-03 09:54:33.534 [CORE] Started trust validation of msix at: C:\Users\adminNB\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix
2025-07-03 09:54:33.569 [CORE] Result for certificate chain validation of Microsoft origin: 0
2025-07-03 09:54:33.602 [CORE] Result for trust info validation of the msix: 0
2025-07-03 09:54:33.602 [CORE] Starting AddPackage operation #0: file:///C:/Users/adminNB/AppData/Local/Temp/WinGet/Microsoft.Winget.Source_8wekyb3d8bbwe.msix Options: { SkipReputationCheck = 1, ExpectedDigests = {} }
2025-07-03 09:54:33.603 [CORE] Begin waiting for operation #0
2025-07-03 09:54:33.604 [CORE] Begin blocking for operation #0
2025-07-03 09:54:33.669 [CORE] Successfully completed #0
2025-07-03 09:54:33.675 [REPO] Multiple sources available, creating aggregated source.
2025-07-03 09:54:33.675 [REPO] Adding to aggregated source: msstore
2025-07-03 09:54:33.675 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2025-07-03 09:54:33.757 [REPO] Response status: 200
2025-07-03 09:54:33.757 [REPO] Authentication node not found. Assuming authentication type none.
2025-07-03 09:54:33.758 [REPO] Adding to aggregated source: winget
2025-07-03 09:54:33.761 [CORE] Did not find extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2025-07-03 09:54:33.761 [REPO] Package not found Microsoft.Winget.Source_8wekyb3d8bbwe
2025-07-03 09:54:33.762 [FAIL] C:__w\1\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\PreIndexedPackageSourceFactory.cpp(446)\WindowsPackageManager.dll!00007FFCCACC1723: (caller: 00007FFCCACA6D64) Exception(1) tid(5e38) 8A15000F
2025-07-03 09:54:33.762 [FAIL] C:__w\1\s\external\pkg\src\AppInstallerRepositoryCore\RepositorySource.cpp(852)\WindowsPackageManager.dll!00007FFCCAD9EAA7: (caller: 00007FFCCAADCA29) LogHr(1) tid(5e38) 8A15000F Msg:[C:__w\1\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\PreIndexedPackageSourceFactory.cpp(446)\WindowsPackageManager.dll!00007FFCCACC1723: (caller: 00007FFCCACA6D64) Exception(1) tid(5e38) 8A15000F ]
2025-07-03 09:54:33.762 [REPO] Failed to open available source: winget
Environment
PS C:\Windows\system32> winget --info
Windows Package Manager v1.11.400
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.26100.4349
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.26.400.0
Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User) %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root C:\Program Files\WinGet\Packages
Portable Package Root (x86) C:\Program Files (x86)\WinGet\Packages
Installer Downloads %USERPROFILE%\Downloads
Configuration Modules %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules
Links
---------------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-privacy
License Agreement https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
Admin Setting State
--------------------------------------------------
LocalManifestFiles Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride Disabled
LocalArchiveMalwareScanOverride Disabled
ProxyCommandLineOptions Disabled
DefaultProxy Disabled
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the provided winget export command and attached log when run interactively versus through Lansweeper's system account or scanning credentials. Investigate the Failed to open available source: winget path and the missing IndexDB entry; done means the deployment context can export packages.json without that source error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100