You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide non-admin mode from the Windows installer #1740
I'm trying to install github cli, but it seems like it needs admin privileges on windows. Is there a way to get a non-admin installer or a portable version?
Thanks!
Reacted by Rob Cannon, Michail Plushnikov, Teoh Sin Yee (Skye), David Daniels, lidmaylid, Azeem, liujip0, Norman Dankert, BobSaidHi, Domenic Denicola and 5 more
Reacted by Kamarulzamansalehudin, bl-ue, Brian Blaylock, Erek Speed, Santiago Rendón, Luca Trazzi, Leonard Brünings, Amadeusz Sadowski, Annoying POTATO, Chris and 7 more
It would be nice if the zip install were mentioned in the install notes and linked to from the download page. For those in an enterprise environment, admin privileges or package managers are usually not options.
Reacted by Kamarulzamansalehudin and Christian Prior-Mamulyan
winget users expect a silent installation. Ideally there should be a command-line argument for the msi to specify installation for all users or for the current user.
Reacted by Kamarulzamansalehudin, Christian Prior-Mamulyan and Riley Cunningham
+1 for an easy way to get Git on the commandline in a restricted corporate environment. i.e. %APPDATA%.
There are thousands of developers who only understand Git by using a "3rd party GUI interface". As a result they are lacking some fundamental understandings of how Git works. Git commands get LOCALIZED in these GUIs!?!
With a solid way to install a CLI client one could start writing tutorials.
Ironically came up again today and finally looked at the wix. Not only is it hard coded to Program Files which you can override with INSTALLDIR, but then it assumes it can write to HKLM so needs admin even if the install path isn't protected. May need to dust off my wix skills and see if I can make a control script that handles the User vs machine wide (+UI) and then still persist to the proper registry location.
Downloading the .zip, extracting it and putting it in a folder with PATH access is a pain as opposed to typing in a command in winget. This is especially frustrating considering that the .zip essentially contains a single file, gh.exe.
I'm surprised this issue takes so long to fix. Anyway, I just threw together a PowerShell function to install the latest amd64 gh.exe binary for the current user without requiring elevation. Seems to work pretty well, so I thought I'd share it with others in case they want to give it a go. Here's the function, you should just be able to drop it into your profile script and then use it to install or update, as long as they don't change the way they're posting these too much.
functionInstall-GitHubCli {
# Create .gh folder if it doesn't exist$userProfileFolder= [Environment]::GetFolderPath('UserProfile')
$ghFolder=Join-Path-Path $userProfileFolder-ChildPath '.gh'if (-not (Test-Path-LiteralPath $ghFolder)) {
New-Item-Path $ghFolder-ItemType Directory >$null
}
# Get the main releases page HTML$releasesUrl='https://github.com/cli/cli/releases'$releasesHtml=Invoke-WebRequest-Uri $releasesUrl-UseBasicParsing
# Identify the latest version using the first release linkif ($releasesHtml.Content-notmatch'/cli/cli/releases/tag/(?<Version>[^"]+)') {
Write-Error-Message 'No release link found.'return
}
$version=$matches['Version']
# Download the zip file$downloadUrl="https://github.com/cli/cli/releases/download/${version}/gh_$($version-replace'^v')_windows_amd64.zip"$zipFileName="gh_${version}_windows_amd64.zip"$zipPath=Join-Path-Path $env:TEMP-ChildPath $zipFileNameInvoke-WebRequest-Uri $downloadUrl-OutFile $zipPath# Extract gh.exe using Expand-ArchiveExpand-Archive-LiteralPath $zipPath-DestinationPath $ghFolder-Force
# Clean upRemove-Item-LiteralPath $zipPath# Add to environment PATH for the current process and future processes via a user environment setting update if the path is not already present$currentPath= [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::Process)
$ghExeFolder=Join-Path-Path $ghFolder-ChildPath 'bin'if ($currentPath.Split(';') -notcontains$ghExeFolder) {
${env:Path}="${currentPath};${ghExeFolder}"
[Environment]::SetEnvironmentVariable('Path',${env:Path}, [EnvironmentVariableTarget]::Process)
[Environment]::SetEnvironmentVariable('Path',${env:Path}, [EnvironmentVariableTarget]::User)
}
Write-Output"gh.exe installed to ${ghFolder} and ${ghExeFolder} added to PATH."
}
Reacted by Jonas Kuske, morelli-capgemini, Dmitri Sichinava, Lars Bo Rasmussen and Kayo Souza
Reacted by Nguyen Van Hiep, lborba-tc, Lars Bo Rasmussen and Philipp Kochański
Activity
cosmicle0 commentedon Sep 17, 2020
Sorry, I just found out that there's a zip release in the releases page. Thanks :)
mislav commentedon Sep 17, 2020
Thanks for letting us know! In the future, we might try to allow a non-admin install.
Protip: you can also install over package managers such as Chocolatey or Scoop 👍
l3ender commentedon Sep 18, 2020
It would be nice if the zip install were mentioned in the install notes and linked to from the download page. For those in an enterprise environment, admin privileges or package managers are usually not options.
leonard84 commentedon Oct 15, 2020
IMHO, the installer should ask whether to install for all users (admin) or only for current user (appdata local).
mislav commentedon Oct 16, 2020
Thanks for the additional context; reopening this as a feature request to tweak the Windows installer. 👍
[-]Non admin version[/-][+]Provide non-admin mode from the Windows installer[/+]just1a-person commentedon Dec 10, 2020
This shouldn't affect
wingetmislav commentedon Dec 10, 2020
@itsme-alan Could you elaborate?
just1a-person commentedon Dec 10, 2020
wingetusers expect a silent installation. Ideally there should be a command-line argument for the msi to specify installation for all users or for the current user.4 remaining items
cprima commentedon Jan 15, 2022
+1 for an easy way to get Git on the commandline in a restricted corporate environment. i.e. %APPDATA%.
There are thousands of developers who only understand Git by using a "3rd party GUI interface". As a result they are lacking some fundamental understandings of how Git works. Git commands get LOCALIZED in these GUIs!?!
With a solid way to install a CLI client one could start writing tutorials.
JM-AlanSmith commentedon Jan 31, 2022
+1 for this too. Especially as the git-scm cli is there, as is Visual Studio Code and Python!
mislav commentedon Feb 2, 2022
I've found some Wix documentation that sounds like it might address making a single MSI that covers both per-machine and per-user installation, but I have no experience with this. If someone wants to take a stab, our current Wix setup is here https://github.com/cli/cli/blob/trunk/build/windows/gh.wxs
byjrack commentedon Mar 9, 2023
yup for winget it should align w the https://learn.microsoft.com/en-us/windows/package-manager/winget/settings#scope setting.
byjrack commentedon Nov 28, 2023
Ironically came up again today and finally looked at the wix. Not only is it hard coded to Program Files which you can override with INSTALLDIR, but then it assumes it can write to HKLM so needs admin even if the install path isn't protected. May need to dust off my wix skills and see if I can make a control script that handles the User vs machine wide (+UI) and then still persist to the proper registry location.
RobCannon commentedon Jan 9, 2024
It would be great if this could be fixed since the default way most Windows users are going to install this is via winget.
RYRY1002 commentedon May 3, 2024
+1 also.
Downloading the
.zip, extracting it and putting it in a folder withPATHaccess is a pain as opposed to typing in a command inwinget. This is especially frustrating considering that the.zipessentially contains a single file,gh.exe.Syntex9000 commentedon Aug 12, 2024
Would love to see this fixed. We work in restricted environments all the time and having the option to install on a user-level is a necessity.
totkeks commentedon Mar 7, 2025
Would be nice to support that using winget / installer.
KirkMunroSagent commentedon Jun 11, 2025
I'm surprised this issue takes so long to fix. Anyway, I just threw together a PowerShell function to install the latest amd64 gh.exe binary for the current user without requiring elevation. Seems to work pretty well, so I thought I'd share it with others in case they want to give it a go. Here's the function, you should just be able to drop it into your profile script and then use it to install or update, as long as they don't change the way they're posting these too much.
robert-plagge-usps commentedon Jul 27, 2026
Following up on this. While @KirkMunroSagent provided a nice reply, it'll be nice to have this built-in.
Has there been any progress on this feature request?