免互動安裝QR-Code Reader、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id OttoZumkeller.QR-CodeReader -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id OttoZumkeller.QR-CodeReader -e --silentwinget uninstall --id OttoZumkeller.QR-CodeReader -e --silent依安裝檔
64位元 · MSI · en-US
靜默安裝
msiexec /i QR-Code-Reader-1.1.2-x64.msi /qn /norestart寫入記錄檔
msiexec /i QR-Code-Reader-1.1.2-x64.msi /qn /norestart /l*v "%TEMP%\qr-code-reader-install.log"解除安裝
msiexec /x {691C4204-0C75-4AF3-9F12-E8A2DC8AA66D} /qn /norestart- MSI產品代碼
- {691C4204-0C75-4AF3-9F12-E8A2DC8AA66D}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{691C4204-0C75-4AF3-9F12-E8A2DC8AA66D}
- UpgradeCode
- {8633B604-CBB1-4F1A-988A-2F038D70DDBC}
32位元 · MSI · en-US
靜默安裝
msiexec /i QR-Code-Reader-1.1.2-x86.msi /qn /norestart寫入記錄檔
msiexec /i QR-Code-Reader-1.1.2-x86.msi /qn /norestart /l*v "%TEMP%\qr-code-reader-install.log"解除安裝
msiexec /x {2208B206-AC05-48E1-B0D9-A9AC6BA08254} /qn /norestart- MSI產品代碼
- {2208B206-AC05-48E1-B0D9-A9AC6BA08254}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{2208B206-AC05-48E1-B0D9-A9AC6BA08254}
- UpgradeCode
- {8633B604-CBB1-4F1A-988A-2F038D70DDBC}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-qr-code-reader.ps1
$url = 'https://github.com/ottozumkeller/QR-Code-Reader/releases/download/v1.1.2/QR-Code-Reader-1.1.2-x64.msi'
$sha256 = '30F0C649A760E2E09047AC5B0407813D7BF67A5F46A3177CB81A01B334DE5F23'
$file = Join-Path $env:TEMP 'QR-Code-Reader-1.1.2-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-qr-code-reader.ps1
$url = 'https://github.com/ottozumkeller/QR-Code-Reader/releases/download/v1.1.2/QR-Code-Reader-1.1.2-x86.msi'
$sha256 = 'A77693658C64FBE418F616AB2AC751C979A2458BB1AB6C1281284487F9BC7AC5'
$file = Join-Path $env:TEMP 'QR-Code-Reader-1.1.2-x86.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