Ordres per instal·lar GnuWin32: M4 sense preguntes, desinstal·lar-lo i detectar-lo des d’eines de desplegament. Només es mostra una ordre quan és segura: la que indica el manifest o el valor per defecte documentat de la tecnologia de l’instal·lador.
Guia relacionada: Instal·lació silenciosa: MSI, NSIS, Inno Setup · Desinstal·lar un programa amb el registre o PowerShell
Amb 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 instal·lador
32 bits · EXE (Inno Setup)
Instal·lació silenciosa
m4-1.4.13-setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-Una altra carpeta
m4-1.4.13-setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\gnuwin32-m4"PowerShell: baixar, verificar, instal·lar
Baixa el fitxer oficial, en comprova l’SHA256 i l’instal·la en mode silenciós.
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