microsoft / winget-pkgs

The Microsoft community Windows Package Manager manifest repository
MIT License
8.61k stars 4.47k forks source link

[Package Issue]: Git.Git does not correctly enable Windows Terminal integration #173310

Closed JohnstonJ closed 3 weeks ago

JohnstonJ commented 4 weeks ago

Please confirm these before moving forward

Category of the issue

Installation issue.

Brief description of your issue

According to #109915, the Git.Git package is supposed to enable the Windows Terminal integration, which is normally off by default when installing Git for Windows.

https://github.com/microsoft/winget-pkgs/blob/13054a60f6c9257f3b872a8bfa7afe68da6ee7db/manifests/g/Git/Git/2.46.0/Git.Git.installer.yaml#L14-L15

Unfortunately.... in the original issue:

Can you add /enable-component windowsterminal to install flags? Not sure if that's the right syntax

Narrator: this was not the right syntax, and Windows Terminal integration is therefore not turned on by default. The flag is completely ignored by setup.

The correct syntax is documented at https://github.com/git-for-windows/git/wiki/Silent-or-Unattended-Installation and at https://github.com/git-for-windows/git/wiki/Mapping-between-Git-Installer-GUI-Settings-And-Command-Line-Arguments

I tested with /COMPONENTS=windowsterminal,<more> and that syntax DOES work - however, you must provide a complete set of components to install - it doesn't seem to have a way to add a component to the existing default set of components.

A list of components, including which ones are the default, can be found at https://github.com/git-for-windows/build-extra/blob/HEAD/installer/install.iss in the [Components] section.

Steps to reproduce

Install Git using winget install --id Git.Git --silent

ALTERNATIVELY:

Download the Git for Windows setup EXE from the Git for Windows website, and pass /enable-component windowsterminal to it. Observe that it has no impact on the components selected for installation in the setup GUI.

Actual behavior

There is no Git Bash integration with Windows Terminal.

Expected behavior

The Git Bash integration with Windows Terminal should be installed.

Environment

Windows Package Manager v1.8.1911
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.4037
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.1911.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled

Screenshots and Logs

No response

chrisrodrigue commented 1 week ago

I highly recommend the Git manifest be updated to invoke the installer with the following components, which does properly enable the Windows Terminal integration.

/SUPPRESSMSGBOXES /COMPONENTS=ext,ext\shellhere,ext\guihere,gitlfs,assoc,assoc_sh,scalar,windowsterminal

In order to override how winget currently does it you need to execute winget with the following arguments:

winget install --exact --silent --force --disable-interactivity --accept-source-agreements --accept-package-agreements --id=Git.Git --source=winget --custom="/SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /NOCLOSEAPPLICATIONS /COMPONENTS=ext,ext\shellhere,ext\guihere,gitlfs,assoc,assoc_sh,scalar,windowsterminal"