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