Closed lxl66566 closed 6 months ago
Heya,
WinGet actually checks if git is already installed, this even works in cases where WinGet was not used to install it. I just confirmed this behaviour on my windows 10 system that had git manually installed.
Have you run into issues with this?
My git was installed by scoop: scoop install git
. Winget did not detect it, and started to download:
C:\Users\lxl>where git
D:\scoop\shims\git.exe
C:\Users\lxl>git -v
git version 2.45.1.windows.1
C:\Users\lxl>winget -v
v1.7.11261
C:\Users\lxl>winget install git.git --accept-package-agreements --accept-source-agreements --disable-interactivity --no-upgrade
Found Git [Git.Git] Version 2.45.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/git-for-windows/git/releases/download/v2.45.1.windows.1/Git-2.45.1-64-bit.exe
█▊ 4.00 MB / 64.7 MB
Cancelled
Terminate batch job (Y/N)? Y
I tried on another PC that installed git by official installer, and winget does detect it. The difference may be that the installer writes package information to the Windows registry, but Scoop does not?
Ooh interesting.
I'm guessing this is due to the fact that scoop installs apps in an unusual way, keeping them isolated in a scoop folder.
Seems like we'll need to manually check if git is installed after all! Thanks for bringing this to my attention 😃
@lxl66566 This issue should now be resolved as of 9401de8. Could you please confirm on your end that it's now detecting git correctly?
Yes, now it works well. Thank you!
The code does not actually check if git exists. (If git is not installed from winget)