Skip to content

Bug: Software uninstallation through OpenUEM fails when using WinGet packages that require non-interactive execution #473

Description

@REDBlRD

Describe the bug

Software uninstallation through OpenUEM fails when using WinGet packages that require non-interactive execution.

The agent log shows:

[INFO]: winget.exe is uninstalling the app Zoom.Zoom
[ERROR]: there was an error running winget.exe: Error reading input in prompt

However, the same package can be successfully uninstalled manually from an elevated command prompt:

winget uninstall Zoom.Zoom

or

winget uninstall Zoom.Zoom --silent

The issue appears to be in the UninstallPackage() implementation.

While InstallPackage() and UpdatePackage() include:

--silent
--accept-package-agreements
--accept-source-agreements

the uninstall command only executes:

winget remove <package> --all-versions

without any non-interactive flags.

As a result, WinGet may display a prompt and OpenUEM Agent (running as LocalSystem) cannot respond to it.


To Reproduce

  1. Install OpenUEM Server 0.12.0.
  2. Install OpenUEM Agent on Windows.
  3. Ensure the agent is admitted and reporting correctly.
  4. Open the Software section.
  5. Select a WinGet-managed application (e.g. Zoom).
  6. Click Uninstall.
  7. Check the agent logs.

Agent log shows:

[INFO]: winget.exe is uninstalling the app Zoom.Zoom
[ERROR]: there was an error running winget.exe: Error reading input in prompt

Expected behavior

OpenUEM should uninstall the application successfully without requiring user interaction.

The uninstall command should probably use the same non-interactive approach already used by InstallPackage() and UpdatePackage(), for example:

--silent
--disable-interactivity
--accept-package-agreements
--accept-source-agreements

when supported by the installed WinGet version.


Desktop (please complete the following information)

  • OpenUEM Version: 0.12.0
  • Agent: Windows Agent
  • OS: Windows 11
  • WinGet Version: 1.28.240

Additional context

The OpenUEM Agent service runs as:

LocalSystem

Manual execution of:

winget uninstall Zoom.Zoom

works correctly.

The issue only occurs when the uninstall operation is triggered from OpenUEM.

I also reviewed the source code and found that InstallPackage() and UpdatePackage() include non-interactive WinGet flags, while UninstallPackage() does not.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions