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