Kommandon för att installera GnuWin32: M4 utan frågor, ta bort programmet igen och identifiera det i distributionsverktyg. Ett kommando visas bara när det är säkert: från manifestet eller som installationsteknikens dokumenterade standard.
Relaterad guide: Parametrar för tyst installation: MSI, NSIS, Inno · Avinstallera program via registret eller PowerShell
Med winget
PowerShell
winget install --id GnuWin32.M4 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id GnuWin32.M4 -e --silentwinget uninstall --id GnuWin32.M4 -e --silentPer installationsfil
32-bitars · EXE (Inno Setup)
Tyst installation
m4-1.4.13-setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-Egen mapp
m4-1.4.13-setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\gnuwin32-m4"PowerShell: ladda ner, kontrollera, installera
Laddar ner den officiella filen, kontrollerar dess SHA256 och installerar tyst.
install-gnuwin32-m4.ps1
$url = 'http://downloads.sourceforge.net/gnuwin32/m4-1.4.13-setup.exe'
$sha256 = 'B28A2EB300AB56E7F1A028F644CD189BF13E99D90466D4D51DE796F8A50C99B0'
$file = Join-Path $env:TEMP 'm4-1.4.13-setup.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 '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait