Brief description of your issue
When winget upgrade runs an NSIS-based installer that refuses to install into a non-empty directory (exit code 2), winget reports the installation as failed with no recovery path. This is a common pattern with conda distributions (Miniforge3, Miniconda, Anaconda) whose NSIS installers reject non-empty target directories.
Related: microsoft/winget-pkgs#431894, conda-forge/miniforge#900
Steps to reproduce
- Install Miniforge3 via winget:
winget install CondaForge.Miniforge3
- Attempt to upgrade:
winget upgrade CondaForge.Miniforge3
- winget invokes:
Miniforge3-26.7.2-0-Windows-x86_64.exe /S /AllUsers /AddToPath=0 /RegisterPython=0
- The installer terminates with exit code 2
Current behavior
winget reports:
Installer failed with exit code: 0x8a150003 : Executing command failed
The user is left with no working upgrade path — they must manually uninstall, reinstall, and restore their environments.
Suggested improvement
When an NSIS installer fails with exit code 2 (which often means "directory not empty" or a similar user-correctable condition), winget could:
- Detect the specific NSIS exit code (exit code 2 is commonly used for "directory not empty")
- Automatically attempt an uninstall-then-reinstall — run the existing installation's uninstaller first, then retry the installer
- Or at minimum, provide a more helpful error message suggesting the user try
winget uninstall <package> followed by winget install <package>
This would be a general improvement benefiting all NSIS-based packages that exhibit this behavior, not just Miniforge3.
Additional context
The Miniforge3 case is particularly painful because:
- The
envs directory contains user-created conda environments that users want to preserve
- A simple uninstall+reinstall deletes these environments (see conda-forge/miniforge#448)
- The miniforge maintainers have marked this as
wontfix, so the fix needs to come from the winget side
Environment
- OS: Windows 11 Pro, build 26200
- winget: v1.29.290
- Package: CondaForge.Miniforge3
- Architecture: x64
- Scope: machine (all users)
Note: This issue was drafted with AI assistance.
Brief description of your issue
When
winget upgraderuns an NSIS-based installer that refuses to install into a non-empty directory (exit code 2), winget reports the installation as failed with no recovery path. This is a common pattern with conda distributions (Miniforge3, Miniconda, Anaconda) whose NSIS installers reject non-empty target directories.Related: microsoft/winget-pkgs#431894, conda-forge/miniforge#900
Steps to reproduce
winget install CondaForge.Miniforge3winget upgrade CondaForge.Miniforge3Miniforge3-26.7.2-0-Windows-x86_64.exe /S /AllUsers /AddToPath=0 /RegisterPython=0Current behavior
winget reports:
The user is left with no working upgrade path — they must manually uninstall, reinstall, and restore their environments.
Suggested improvement
When an NSIS installer fails with exit code 2 (which often means "directory not empty" or a similar user-correctable condition), winget could:
winget uninstall <package>followed bywinget install <package>This would be a general improvement benefiting all NSIS-based packages that exhibit this behavior, not just Miniforge3.
Additional context
The Miniforge3 case is particularly painful because:
envsdirectory contains user-created conda environments that users want to preservewontfix, so the fix needs to come from the winget sideEnvironment