Kommandon för att installera GnuWin32: Flex 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.Flex -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id GnuWin32.Flex -e --silentwinget uninstall --id GnuWin32.Flex -e --silentPer installationsfil
32-bitars · EXE (Inno Setup)
Tyst installation
flex-2.5.4a-1.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-Egen mapp
flex-2.5.4a-1.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\gnuwin32-flex"PowerShell: ladda ner, kontrollera, installera
Laddar ner den officiella filen, kontrollerar dess SHA256 och installerar tyst.
install-gnuwin32-flex.ps1
$url = 'https://downloads.sourceforge.net/project/gnuwin32/flex/2.5.4a-1/flex-2.5.4a-1.exe'
$sha256 = 'E8DD37C5E132B52248B58DA14F7608C45D1DD239B020EFA80B03788501D633E5'
$file = Join-Path $env:TEMP 'flex-2.5.4a-1.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