Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an installer argument to skip installing git bash #2912

Closed
jantari opened this issue Nov 26, 2020 · 3 comments
Closed

Add an installer argument to skip installing git bash #2912

jantari opened this issue Nov 26, 2020 · 3 comments

Comments

@jantari
Copy link

jantari commented Nov 26, 2020

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

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

    2.29.2.2 (amd64)

$ 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
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19042.630]
  • What options did you set as part of the installation? Or did you choose the
    defaults?

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
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I don't think so, might edit later.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Always PowerShell 7.

# None
  • What did you expect to occur after running these commands?

Not applicable.

  • What actually happened instead?

Not applicable.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

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
Copy link
Member

dscho commented Nov 26, 2020

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
Copy link
Author

jantari commented Nov 26, 2020

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
Copy link
Member

dscho commented Aug 24, 2022

Closing as stale.

@dscho dscho closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants