免互動安裝GitHub Desktop、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id GitHub.GitHubDesktop -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id GitHub.GitHubDesktop -e --silentwinget uninstall --id GitHub.GitHubDesktop -e --silent依安裝檔
64位元 · EXE · 僅目前使用者
靜默安裝
GitHubDesktopSetup-x64.exe --silent- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GitHubDesktop
64位元 · MSI · 所有使用者
靜默安裝
msiexec /i GitHubDesktopSetup-x64.msi /qn /norestart寫入記錄檔
msiexec /i GitHubDesktopSetup-x64.msi /qn /norestart /l*v "%TEMP%\github-desktop-install.log"解除安裝
msiexec /x {DA7017AA-1461-48F5-9B6D-B4D895B154BB} /qn /norestart- MSI產品代碼
- {DA7017AA-1461-48F5-9B6D-B4D895B154BB}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DA7017AA-1461-48F5-9B6D-B4D895B154BB}
- UpgradeCode
- {00D8E2EE-13EA-5BEB-87F0-70EFC46A7D4A}
ARM64 · EXE · 僅目前使用者
靜默安裝
GitHubDesktopSetup-arm64.exe --silent- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GitHubDesktop
ARM64 · MSI · 所有使用者
靜默安裝
msiexec /i GitHubDesktopSetup-arm64.msi /qn /norestart寫入記錄檔
msiexec /i GitHubDesktopSetup-arm64.msi /qn /norestart /l*v "%TEMP%\github-desktop-install.log"解除安裝
msiexec /x {23C90CF4-57F6-4986-816E-2323C1475525} /qn /norestart- MSI產品代碼
- {23C90CF4-57F6-4986-816E-2323C1475525}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{23C90CF4-57F6-4986-816E-2323C1475525}
- UpgradeCode
- {00D8E2EE-13EA-5BEB-87F0-70EFC46A7D4A}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-github-desktop.ps1
$url = 'https://desktop.githubusercontent.com/releases/3.6.9-e0ba6bb8/GitHubDesktopSetup-x64.exe'
$sha256 = 'F0017AF2EFB38D22ECFDC519ED387449F112C5CAB486C41214C173230DE953C1'
$file = Join-Path $env:TEMP 'GitHubDesktopSetup-x64.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '--silent' -Wait install-github-desktop.ps1
$url = 'https://desktop.githubusercontent.com/releases/3.6.9-e0ba6bb8/GitHubDesktopSetup-x64.msi'
$sha256 = 'E2BAB1785C348D0C29CB79C1030B07B902322E63FFD4025EF9BFD175DB600555'
$file = Join-Path $env:TEMP 'GitHubDesktopSetup-x64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait install-github-desktop.ps1
$url = 'https://desktop.githubusercontent.com/releases/3.6.9-e0ba6bb8/GitHubDesktopSetup-arm64.exe'
$sha256 = '7489F3D91184A02E8A607DB3A7F34B187516D6DA1729360950AAEE92FC60204C'
$file = Join-Path $env:TEMP 'GitHubDesktopSetup-arm64.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '--silent' -Wait install-github-desktop.ps1
$url = 'https://desktop.githubusercontent.com/releases/3.6.9-e0ba6bb8/GitHubDesktopSetup-arm64.msi'
$sha256 = 'A43454544F991EB244B1E0F384B9316DA7965F78908B29388FCCC26805FFC433'
$file = Join-Path $env:TEMP 'GitHubDesktopSetup-arm64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait