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