免互動安裝SPIN、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id from104.SPIN -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id from104.SPIN -e --silentwinget uninstall --id from104.SPIN -e --silent依安裝檔
64位元 · MSI · 所有使用者
靜默安裝
msiexec /i SPIN_0.6.9_x64_en-US.msi /qn /norestart寫入記錄檔
msiexec /i SPIN_0.6.9_x64_en-US.msi /qn /norestart /l*v "%TEMP%\spin-install.log"解除安裝
msiexec /x {DA12D3F1-1D72-4976-ABD6-E054B1825195} /qn /norestart- MSI產品代碼
- {DA12D3F1-1D72-4976-ABD6-E054B1825195}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DA12D3F1-1D72-4976-ABD6-E054B1825195}
- UpgradeCode
- {1505F1FB-FE06-58D8-9238-328F6C31C686}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-spin.ps1
$url = 'https://github.com/from104/spin/releases/download/v0.6.9/SPIN_0.6.9_x64_en-US.msi'
$sha256 = 'ED6256F118D06755A302E3476E3F13BB4341E2168DB904C999D8442B05501BEA'
$file = Join-Path $env:TEMP 'SPIN_0.6.9_x64_en-US.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