Fix software update when old MSI installer is missing (MSI exit code 1603)
Brief description of your issue
Upgrading a software package should only require the installer of the new version but unfortunately, the old installer is also essential to be present. If it is not, automated installation fails. (In case of an interactive installation, a modal window pops up that allows you to point to it.)
As the process of upgrading breaks down unexpectedly, I classify this failure as a bug. Technically, though, fixing it will require some new code to be added rather than fixing some existing code, so you may also consider it a borderline feature request.
For further details, see UniGetUI issue 2742 whence I was redirected here. As that software simply calls winget, the issue described there can be simply understood in terms of this software. Also see the first comment and my answer to it there.
Steps to reproduce
winget install <any software with an MSI installer mechanism such as LibreOffice 24.8.0>- Wait for a bit for a newer version to appear. (Or install an old version to begin with in the previous step.)
- Make sure that the old
.msiinstaller file is not present at its old location. (In an actual system, cleanups will remove such files.) - Using
winget, attempt upgrading to a newer version of LibreOffice, say 24.8.1.
Expected behavior
- Without prompting the user or stopping the upgrade,
wingetfigures out that a deprecated version's.msiinstaller file for the package is required but missing, and downloads it.- Obviously, deal with corner cases such as not enough space.
- The old version is uninstalled without any hiccups, then the new version is installed.
- Housekeeping: the downloaded file is deleted.
Actual behavior
MSI Installer exit code 1603.
For further details, see UniGetUI issue 2742.
Environment
Windows Package Manager v1.8.1911
Windows: Windows.Desktop v10.0.22631.4169
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.1911.0