PicViewerを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id junjieqin.PicViewer -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id junjieqin.PicViewer -e --silentwinget uninstall --id junjieqin.PicViewer -e --silentインストーラー別
64ビット · MSI · すべてのユーザー
サイレントインストール
msiexec /i PicViewer-0.8.0.msi /qn /norestartログを出力
msiexec /i PicViewer-0.8.0.msi /qn /norestart /l*v "%TEMP%\picviewer-install.log"アンインストール
msiexec /x {BFCD6BC9-6E64-4FFF-B952-225C2C3B894D} /qn /norestart- MSIプロダクトコード
- {BFCD6BC9-6E64-4FFF-B952-225C2C3B894D}
- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BFCD6BC9-6E64-4FFF-B952-225C2C3B894D}
- UpgradeCode
- {E85C5722-4F09-5B7E-A7F2-76B6273E9C23}
- インストール先フォルダー
- %ProgramFiles%\PicViewer
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-picviewer.ps1
$url = 'https://github.com/junjieqin97/PicViewer/releases/download/v0.8.0/PicViewer-0.8.0.msi'
$sha256 = '42608490E07B464F935D3C528F7C106B87EA49AD498A3D7479910F58B4BBD35E'
$file = Join-Path $env:TEMP 'PicViewer-0.8.0.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