Commands for installing GnuWin32: Flex without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.
Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell
With 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 --silentBy installer
32-bit · EXE (Inno Setup)
Silent install
flex-2.5.4a-1.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-Custom folder
flex-2.5.4a-1.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\gnuwin32-flex"PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
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