Choiceを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id EastMoney.Choice -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id EastMoney.Choice -e --silentwinget uninstall --id EastMoney.Choice -e --silentインストーラー別
32ビット · EXE(NSIS) · すべてのユーザー
サイレントインストール
ChoiceSetup_win_x86.exe /Sインストール先を指定
ChoiceSetup_win_x86.exe /S /D=C:\Apps\choice- アンインストール用レジストリキー
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ChoicePro
- インストール先フォルダー
- C:\Eastmoney\Choice
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-choice.ps1
$url = 'https://choice-app.eastmoney.com/choice/OfflinePackage/ChoiceSetup_win_x86.exe'
$sha256 = 'EB49EDD014D37E8FDC1CE1E5235971001E7E83665D76768D3223168C316232EF'
$file = Join-Path $env:TEMP 'ChoiceSetup_win_x86.exe'
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' -Wait