Skip to content

[BUG] WinGet integration is failing to install/update packages and hides useful error details #675

@zetmanutentez

Description

@zetmanutentez

Please confirm these before moving forward

  • I have searched for my issue and have not found a similiar in the Open or Closed issues.
  • I have tested that this issue has not been fixed in the latest (beta or stable) release.
  • I have checked the Discussions section for solutions.
  • This issue is about a bug (if it is not, please use the correct template).

Winhance Version

Winhance v26.05.22 26.05.22 Marco du Plessis C:\Program Files\Winhance\

Windows version, edition, and architecture

Microsoft Windows 11 Pro OS Version: 10.0.26200 N/A Build 26200

Describe your issue

I am experiencing a broader issue with the Winhance WinGet integration. It is not only failing to install Microsoft Copilot; Winhance is also unable to properly install or update packages through the current WinGet integration in this version.

The main problem seems to be that Winhance relies on its bundled WinGet executable:

C:\Program Files\Winhance\winget-cli\winget.exe

When trying to install Microsoft Copilot, Winhance executed this command:

C:\Program Files\Winhance\winget-cli\winget.exe install --id 9NHT9RB2F4HD --silent --accept-package-agreements --accept-source-agreements --force --disable-interactivity --source msstore

The process failed with only this generic result:

Process return value: -1 (0xFFFFFFFF)

No useful WinGet stdout/stderr output was shown in the Winhance interface, which made troubleshooting very difficult.

After manual troubleshooting, I found that the issue was not limited to Copilot. The system had several broken or incomplete components related to WinGet and PowerShell package management:

WinGet/App Installer was broken or incomplete.
The winget command initially existed only as a broken WindowsApps alias.
PowerShellGet and PackageManagement were not loading correctly.
NuGet provider was missing.
Install-PackageProvider was initially unavailable.
PackageManagement\Get-PackageProvider was not recognized.
Repair-WinGetPackageManager was not available until the Microsoft.WinGet.Client module was installed.
The Microsoft Store sources had to be reset and updated manually.
The Copilot Store package ID used by Winhance, 9NHT9RB2F4HD, did not work in my case.
The working Microsoft Copilot Store ID was XP9CXNGPPJ97XX.

Because Winhance only displayed 0xFFFFFFFF, it was not clear whether the problem was caused by the bundled WinGet executable, a broken system WinGet/App Installer, broken package management modules, Microsoft Store sources, or an outdated Microsoft Store package ID.

Steps to reproduce the issue

Open Winhance.
Go to the section where apps/packages can be installed or restored.
Try to install Microsoft Copilot or update/install packages through Winhance.

Winhance calls the bundled WinGet executable from:

C:\Program Files\Winhance\winget-cli\winget.exe

The operation fails with:

Process return value: -1 (0xFFFFFFFF)

Winhance does not show the real WinGet output, detailed error message, or repair suggestion.

Expected behavior

I expected Winhance to install or update packages successfully using WinGet.

If WinGet, Microsoft Store, App Installer, PowerShellGet, PackageManagement, or NuGet are broken, I expected Winhance to detect this and show a clear diagnostic message.

Ideally, Winhance should:

Check if the system WinGet/App Installer is healthy before installing or updating packages.
Check whether Microsoft Store sources are working.
Show full WinGet stdout/stderr when a package installation fails.
Avoid hiding the real error behind only 0xFFFFFFFF.
Avoid using outdated or hardcoded Microsoft Store package IDs when possible.
Offer an option to reset/update WinGet sources.
Warn the user if PowerShellGet, PackageManagement, NuGet, or App Installer are missing or broken.
Prefer the official system WinGet when available and healthy, or at least compare it against the bundled WinGet.
Provide a repair workflow or troubleshooting instructions when package installation/update fails.

Actual behavior

Instead, Winhance failed with only:

Process return value: -1 (0xFFFFFFFF)

The interface did not explain the real cause.

After investigation, the issue required manual repair outside Winhance.

This was the manual repair process that solved the problem:

Fixed the Windows PowerShell module path so it no longer loaded the wrong PowerShell 7 module paths:

$env:PSModulePath = @(
"$env:USERPROFILE\Documents\WindowsPowerShell\Modules",
"$env:ProgramFiles\WindowsPowerShell\Modules",
"$env:WINDIR\system32\WindowsPowerShell\v1.0\Modules"
) -join ';'

Imported the required base modules:

Import-Module Microsoft.PowerShell.Security -Force
Import-Module PackageManagement -Force
Import-Module PowerShellGet -Force

Installed and imported the NuGet provider:

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Import-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force

Trusted PSGallery:

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

Installed the Microsoft WinGet Client module:

Install-Module -Name Microsoft.WinGet.Client -Scope AllUsers -Force -Repository PSGallery -AllowClobber
Import-Module Microsoft.WinGet.Client -Force

Repaired WinGet/App Installer for all users:

Repair-WinGetPackageManager -AllUsers -Force -Latest

Reset and updated WinGet sources:

winget source reset --force
winget source update
winget source list

Installed Microsoft Copilot manually using the Store ID that worked:

winget install --id XP9CXNGPPJ97XX --source msstore --accept-package-agreements --accept-source-agreements

After these manual steps, WinGet started working again and Microsoft Copilot installed successfully outside Winhance.

Screenshots or Logs

Original Winhance command:

C:\Program Files\Winhance\winget-cli\winget.exe install --id 9NHT9RB2F4HD --silent --accept-package-agreements --accept-source-agreements --force --disable-interactivity --source msstore

Original Winhance result:

Process return value: -1 (0xFFFFFFFF)

Manual command that worked after repairing WinGet:

winget install --id XP9CXNGPPJ97XX --source msstore --accept-package-agreements --accept-source-agreements

WinGet sources after repair:

msstore
winget
winget-font

Additional context

This issue gives the impression that Winhance package installation/update is simply not working in this version.

In reality, the failure is caused by a combination of hidden problems:

Broken or incomplete system WinGet/App Installer
Broken PowerShellGet/PackageManagement/NuGet environment
Microsoft Store source needing reset/update
Generic Winhance error handling
Possibly outdated Microsoft Store package ID for Copilot

The most important issue is that Winhance hides the real diagnostic information and only shows 0xFFFFFFFF.

Please consider improving the WinGet integration by adding health checks, full logging, Store source repair/reset, and better package ID validation.

Steps to reproduce the issue

  1. Open Winhance.

  2. Go to the section where Winhance installs/restores Microsoft apps or packages through WinGet.

  3. Try to install or restore Microsoft Copilot.

  4. Winhance runs the bundled WinGet executable from:

    C:\Program Files\Winhance\winget-cli\winget.exe

  5. The command used by Winhance is:

    C:\Program Files\Winhance\winget-cli\winget.exe install --id 9NHT9RB2F4HD --silent --accept-package-agreements --accept-source-agreements --force --disable-interactivity --source msstore

  6. The installation fails with:

    Process return value: -1 (0xFFFFFFFF)

  7. Winhance does not show the full WinGet output or any clear diagnostic message explaining the cause.

  8. The same problem also affects package installation/update behavior through Winhance, because the WinGet integration does not detect or repair a broken/incomplete WinGet/App Installer environment.

  9. After repairing WinGet manually outside Winhance, resetting WinGet sources, and using the Microsoft Copilot Store ID XP9CXNGPPJ97XX, Copilot installed successfully with:

    winget install --id XP9CXNGPPJ97XX --source msstore --accept-package-agreements --accept-source-agreements

Expected behavior

I expected Winhance to install or update packages successfully through WinGet.

If WinGet, Microsoft Store, App Installer, PowerShellGet, PackageManagement, or NuGet are broken or incomplete, I expected Winhance to detect the problem before running the installation and show a clear diagnostic message.

I also expected Winhance to show the full WinGet stdout/stderr output instead of only the generic return value -1 (0xFFFFFFFF).

For Microsoft Copilot specifically, I expected Winhance to use a valid Microsoft Store package ID, install Copilot successfully, or clearly explain why the installation failed and how to fix it.

Actual behavior

Instead, Winhance failed to install Microsoft Copilot and other packages through its WinGet integration.

For Microsoft Copilot, Winhance executed the bundled WinGet command from:

C:\Program Files\Winhance\winget-cli\winget.exe

The command failed with only this generic result:

Process return value: -1 (0xFFFFFFFF)

No detailed WinGet output, stdout/stderr, or useful diagnostic information was shown in the Winhance interface.

The problem was not limited to Copilot. Package installation/update through Winhance was not working correctly because the underlying WinGet/App Installer environment was broken or incomplete. After troubleshooting manually, I found that PowerShellGet, PackageManagement, NuGet, and WinGet/App Installer needed repair.

After repairing everything manually outside Winhance, resetting/updating WinGet sources, and using the working Microsoft Copilot Store ID XP9CXNGPPJ97XX, Copilot installed successfully with the normal system WinGet.

So the actual behavior was that Winhance could not install/update packages properly through WinGet, hid the real error details behind 0xFFFFFFFF, and used a Copilot package ID that did not work in my environment.

Screenshots or Logs (if applicable)

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions