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
- Install OpenUEM Server 0.12.0.
- Install OpenUEM Agent on Windows.
- Ensure the agent is admitted and reporting correctly.
- Open the Software section.
- Select a WinGet-managed application (e.g. Zoom).
- Click Uninstall.
- 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:
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.
Describe the bug
Software uninstallation through OpenUEM fails when using WinGet packages that require non-interactive execution.
The agent log shows:
However, the same package can be successfully uninstalled manually from an elevated command prompt:
or
The issue appears to be in the
UninstallPackage()implementation.While
InstallPackage()andUpdatePackage()include:the uninstall command only executes:
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
Agent log shows:
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:
when supported by the installed WinGet version.
Desktop (please complete the following information)
Additional context
The OpenUEM Agent service runs as:
Manual execution of:
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.