免互動安裝SA201B、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Thorlabs.SA201B -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Thorlabs.SA201B -e --silentwinget uninstall --id Thorlabs.SA201B -e --silent依安裝檔
32位元 · ZIP · 所有使用者
靜默安裝
v1.3.0.zip /S /V/quiet /V/norestart解除安裝
msiexec /x {3D5A0C32-3789-4D32-B02E-C9EE2E981BCA} /qn /norestart- MSI產品代碼
- {3D5A0C32-3789-4D32-B02E-C9EE2E981BCA}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{3D5A0C32-3789-4D32-B02E-C9EE2E981BCA}
- UpgradeCode
- {F8987FCC-F964-4EC7-8524-A6D12DA0CD28}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-sa201b.ps1
$url = 'https://thin01mstroc282prod.dxcloud.episerver.net/contentassets/ed2884aeeb7848f9974e9d53a727e830/v1.3.0.zip'
$sha256 = '7A13E0A2923017775097B1FC2DEC3A60C3EC25A2B458542808E86FD98D2F3458'
$file = Join-Path $env:TEMP 'v1.3.0.zip'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/S /V/quiet /V/norestart' -Wait