Silent install of Github-for-windows

Posted on

QUESTION :

I would like to silent install GitHub on Windows. I have downloaded GitHubSetup.exe from https://windows.github.com/.

I am used to pass other parameters like /S, INSTALLDIR etc. to silent install programs.

How to silent install GitHub in a preferred directory and which URL should be used?

ANSWER :

Github for Windows uses the Microsoft ClickOnce installer for deployment[1]. ClickOnce is a per user based installation technology and does not support silent installs.

The Chocolatey package management system for Windows does have a package for GfW which relies on Auto Hot Key to automate the installation.

@echo Off
REM script to install GitHub Desktop
REM Installs the machine-wide installer
msiexec.exe /i "%~dp0GitHubDesktopSetup-x64.msi" /qn
REM Wait for install to complete
PING -n 10 127.0.0.1>nul
REM Change directory to install folder and run exe
CD "%ProgramFiles(x86)%GitHub Desktop Deployment" && "GitHubDesktopDeploymentTool.exe" -s
REM Delete desktop shortcut
Del /f "C:Users%username%DesktopGitHub Desktop.lnk"

Run the following commands in windows cmd.exe to install git silently:

powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://github.com/git-for-windows/git/releases/download/v2.21.0.windows.1/Git-2.21.0-64-bit.exe', 'c:git_setup.exe') }"
"C:git_setup.exe"  /VERYSILENT

Leave a Reply

Your email address will not be published. Required fields are marked *