Open HunterZ opened 7 months ago
Is MSYS2 not meant to be upgraded in this way, since it has an internal pacman-based updater?
Right
I tried to prevent it from being updated by WinGet by setting RequireExplicitUpgrade: true
in the manifest but sometimes it doesn't work. You can try winget pin add MSYS2.MSYS2
to pin the package.
Just ran into this myself. Is exit code 1 unique to the "the directory already exists and contains an installation" error? I wonder if the fileInUse
expected error code tied to exit code 1 might provide something slightly more user friendly. It currently just fails and doesn't provide a pointer to the install log or anything.
pwsh> winget upgrade --all
Name Id Version Available Source
-------------------------------------------
MSYS2 MSYS2.MSYS2 20230526 20231026 winget
1 upgrades available.
Installing dependencies:
(1/1) Found MSYS2 [MSYS2.MSYS2] Version 20231026
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Starting package install...
Installer failed with exit code: 1
pwsh>
Just ran into this myself. Is exit code 1 unique to the "the directory already exists and contains an installation" error? I wonder if the
fileInUse
expected error code tied to exit code 1 might provide something slightly more user friendly. It currently just fails and doesn't provide a pointer to the install log or anything.pwsh> winget upgrade --all Name Id Version Available Source ------------------------------------------- MSYS2 MSYS2.MSYS2 20230526 20231026 winget 1 upgrades available. Installing dependencies: (1/1) Found MSYS2 [MSYS2.MSYS2] Version 20231026 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Successfully verified installer hash Starting package install... Installer failed with exit code: 1 pwsh>
No. The exit code 1 indicates a general installation failure instead of a specific one, according to the manual of Qt Installer Framework, the installer technology used by MSYS2 installer.
There is no switch to force the Qt Installer Framework installer to log into a specific file so WinGet doesn't know where the installer log to, and currently WinGet doesn't support capture the console output from the installer.
I think MSYS2 does not need upgrades as an installer. You can upgrade it via pacman -Suy
inside its shell.
So does it mean we don't need this as a winget application?
This confirms winget is unnecessary for this package: https://github.com/msys2/setup-msys2/issues/359
I think MSYS2 does not need upgrades as an installer. You can upgrade it via
pacman -Suy
inside its shell.So does it mean we don't need this as a winget application?
You can still do first-time install, or even install another copy of MSYS2 in a different directory if needed. 🤔
You can still do first-time install, or even install another copy of MSYS2 in a different directory if needed. 🤔
Then you have a nagging winget upgrade notifier in your hand, which doesn't work.
You can still do first-time install, or even install another copy of MSYS2 in a different directory if needed. 🤔
Then you have a nagging winget upgrade notifier in your hand, which doesn't work.
Not THEN. WinGet will always notify you as long as it detects a copy of MSYS2 from the registry.
I am thinking about modifying the package so it can still install new copies but never detect and update them. Currently I am using RequireExplicitUpgrade: true
but it appears to be working only when it was installed through WinGet, and WinGet will still try to update them if it is installed by downloading and running the installer manually.
(AFAIK the counterpart on Chocolatey upgrades by invoking pacman directly, which can not be implemented here at the moment)
You can also install/extract MSYS2 from tar file.
You can also install/extract MSYS2 from tar file.
Currently WinGet doesn't support extracting tar file (as it doesn't rely on 7z for extracting archives). See https://github.com/microsoft/winget-cli/issues/2899
The counterpart on Scoop installs in this way though but I don't know how they tackle the upgrading issue as it persists only the home directory.
I am thinking about modifying the package so it can still install new copies but never detect and update them. Currently I am using RequireExplicitUpgrade: true but it appears to be working only when it was installed through WinGet, and WinGet will still try to update them if it is installed by downloading and running the installer manually.
When we have the 1.6.0 schema out, maybe UpgradeBehavior: deny
can help with this one... :eyes:
any update?
Please confirm these before moving forward
Category of the issue
Installation issue.
Brief description of your issue
Upgrade from 20230718 to 20231026 fails silently with exit code 1.
Is MSYS2 not meant to be upgraded in this way, since it has an internal pacman-based updater?
Steps to reproduce
Install 20230718. Attempt to upgrade to 20231026.
Actual behavior
Upgrade fails with exit code 1 and no additional info.
Expected behavior
Successful update, or not listed as an available update if this is not a supported means of updating an existing MSYS2 installation.
Environment
Screenshots and Logs
InstallationLog.txt says:
TargetDirectoryInUse : Error : The directory you selected already exists and contains an installation. Choose a different target for installation.