免互動安裝mGBA、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id JeffreyPfau.mGBA -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id JeffreyPfau.mGBA -e --silentwinget uninstall --id JeffreyPfau.mGBA -e --silent依安裝檔
64位元 · EXE(Inno Setup) · 所有使用者 · en-US
靜默安裝
mGBA-0.10.5-win64-installer.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-自訂安裝資料夾
mGBA-0.10.5-win64-installer.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\mgba"- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\mGBA_is1
32位元 · EXE(Inno Setup) · 所有使用者 · en-US
靜默安裝
mGBA-0.10.5-win32-installer.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-自訂安裝資料夾
mGBA-0.10.5-win32-installer.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\mgba"- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\mGBA_is1
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-mgba.ps1
$url = 'https://github.com/mgba-emu/mgba/releases/download/0.10.5/mGBA-0.10.5-win64-installer.exe'
$sha256 = 'EDD0454B8FE69F20DC2F0B47F2CFC32A14E3848550762FFBB3D782E649669C6B'
$file = Join-Path $env:TEMP 'mGBA-0.10.5-win64-installer.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 '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait install-mgba.ps1
$url = 'https://github.com/mgba-emu/mgba/releases/download/0.10.5/mGBA-0.10.5-win32-installer.exe'
$sha256 = '90B19D1D8871E306133C6D428E2C78A9670746815894F370E0E616A7373083D3'
$file = Join-Path $env:TEMP 'mGBA-0.10.5-win32-installer.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 '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait