免互動安裝SnapX、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id SnapXL.SnapX -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id SnapXL.SnapX -e --silentwinget uninstall --id SnapXL.SnapX -e --silent依安裝檔
64位元 · MSI · 所有使用者 · en-US
靜默安裝
msiexec /i SnapX-Release-Windows-0.4.0-alpha.0+g7eafb0f-X64.msi /qn /norestart寫入記錄檔
msiexec /i SnapX-Release-Windows-0.4.0-alpha.0+g7eafb0f-X64.msi /qn /norestart /l*v "%TEMP%\snapx-install.log"解除安裝
msiexec /x {1F045278-E58D-4142-8626-D149E117D455} /qn /norestart- MSI產品代碼
- {1F045278-E58D-4142-8626-D149E117D455}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1F045278-E58D-4142-8626-D149E117D455}
- UpgradeCode
- {1F045278-E58D-4142-8626-D149E1D7D454}
- 安裝資料夾
- %ProgramFiles%\SnapXL\SnapX
ARM64 · MSI · 所有使用者 · en-US
靜默安裝
msiexec /i SnapX-Release-Windows-0.4.0-alpha.0+g7eafb0f-Arm64.msi /qn /norestart寫入記錄檔
msiexec /i SnapX-Release-Windows-0.4.0-alpha.0+g7eafb0f-Arm64.msi /qn /norestart /l*v "%TEMP%\snapx-install.log"解除安裝
msiexec /x {69DC4E4A-971D-4579-BFCE-F68876073076} /qn /norestart- MSI產品代碼
- {69DC4E4A-971D-4579-BFCE-F68876073076}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{69DC4E4A-971D-4579-BFCE-F68876073076}
- 安裝資料夾
- %ProgramFiles%\SnapXL\SnapX
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-snapx.ps1
$url = 'https://github.com/SnapXL/SnapX/releases/download/v0.4.0/SnapX-Release-Windows-0.4.0-alpha.0+g7eafb0f-X64.msi'
$sha256 = 'EF57AC310056DCE16534518011D2E8EFEB82003B0050674999227E86D5CABBE0'
$file = Join-Path $env:TEMP 'SnapX-Release-Windows-0.4.0-alpha.0+g7eafb0f-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-snapx.ps1
$url = 'https://github.com/SnapXL/SnapX/releases/download/v0.4.0/SnapX-Release-Windows-0.4.0-alpha.0+g7eafb0f-Arm64.msi'
$sha256 = '08341A5895B9631776FC8DA27B3D71AF6FE70EEE59B2434C0EEFAC1BB4916584'
$file = Join-Path $env:TEMP 'SnapX-Release-Windows-0.4.0-alpha.0+g7eafb0f-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