git-for-windows / git

A fork of Git containing Windows-specific patches.
http://gitforwindows.org/
Other
8.39k stars 2.54k forks source link

Add an installer argument to skip installing git bash #2912

Closed jantari closed 2 years ago

jantari commented 3 years ago

I was not able to find an open or closed issue matching what I'm seeing

Setup

$ git --version --build-options

git version 2.29.2.windows.2
cpu: x86_64
built from commit: 3464b98ce6803c98bf8fb34390cd150d66e4a0d3
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19042.630]

Prior to installation:

$installKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1"
$ino = "Inno Setup CodeFile:"

if (-not (Test-Path $installKey) {
    mkdir $installKey
}

# Use standard windows terminal/conhost, no git bash
New-ItemProperty $InstallKey -Name "$ino Bash Terminal Option" -Value "ConHost" -PropertyType "String" -Force

# Only add git to PATH, not other unix tools
New-ItemProperty $installKey -Name "$ino Path Option" -Value "Cmd" -PropertyType "String" -Force

# Use SCHANNEL tls-backend instead of openssl
New-ItemProperty $InstallKey -Name "$ino CURL Option" -Value "WinSSL" -Force

During installation:

/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS="ext,ext\shellhere,ext\guihere,gitlfs,assoc,assoc_sh"

After Installation:

[System.Environment]::SetEnvironmentVariable('GCM_VALIDATE', 'false', 'Machine')

Configuration

$ cat "C:\Program Files\Git\etc\install-options.txt"

Editor Option: VisualStudioCode
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: WinSSL
CRLF Option: CRLFAlways
Bash Terminal Option: ConHost
Git Pull Behavior Option: Merge
Use Credential Manager: Core
Performance Tweaks FSCache: Enabled
Enable Symlinks: Enabled
Enable Pseudo Console Support: Disabled

I don't think so, might edit later.

Details

Always PowerShell 7.

# None

Not applicable.

Not applicable.

Not applicable.


I never use git-bash and find it wholly unneccessary. When installing git for windows manually I always deselect it as I prefer using PowerShell on Windows. However, for a silent/unattended installation this option is not exposed.

Please add a COMPONENTS or other cli option to the installer to not install git-bash.

dscho commented 3 years ago

Prior to installation:

$installKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1"
$ino = "Inno Setup CodeFile:"

if (-not (Test-Path $installKey) {
    mkdir $installKey
}

# Use standard windows terminal/conhost, no git bash
New-ItemProperty $InstallKey -Name "$ino Bash Terminal Option" -Value "ConHost" -PropertyType "String" -Force

# Only add git to PATH, not other unix tools
New-ItemProperty $installKey -Name "$ino Path Option" -Value "Cmd" -PropertyType "String" -Force

# Use SCHANNEL tls-backend instead of openssl
New-ItemProperty $InstallKey -Name "$ino CURL Option" -Value "WinSSL" -Force

During installation:

/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS="ext,ext\shellhere,ext\guihere,gitlf

That's quite the abuse of the uninstaller information, I must say. Why not use the /o:<key>=<value> way to specify e.g. /o:BashTerminalOption=ConHost?

Please add a COMPONENTS or other cli option to the installer to not install git-bash.

Please do not ask for something you can easily implement yourself:

  1. install Git for Windows' SDK,
  2. sdk cd installer,
  3. edit install.iss (the components are defined here, and the icons are defined here)
  4. build a new installer via sdk build installer
  5. verify that that installer works as expected
  6. open a PR
jantari commented 3 years ago

That's quite the abuse of the uninstaller information, I must say. Why not use the /o:= way to specify e.g. /o:BashTerminalOption=ConHost?

Because I am using the git for Windows package that PDQ Deploy provides, so that the software is updated automatically. They predefined these installer-arguments and I cannot edit them. However, I can add custom pre- and post-tasks to their package.

Also thanks for the directions, I had looked at the setup files previously and will look into implementing it myself.

dscho commented 2 years ago

Closing as stale.