Kommandon för att installera Micro Hosts Editor 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 xvitaly.MicroHostsEditor -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id xvitaly.MicroHostsEditor -e --silentwinget uninstall --id xvitaly.MicroHostsEditor -e --silentPer installationsfil
32-bitars · EXE (Inno Setup)
Tyst installation
mhed_162_setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-Egen mapp
mhed_162_setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\micro-hosts-editor"- Avinstallationsnyckel i registret
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{1A3295AB-919E-4E58-B2A3-1B8B9BF8E29D}_is1
PowerShell: ladda ner, kontrollera, installera
Laddar ner den officiella filen, kontrollerar dess SHA256 och installerar tyst.
install-micro-hosts-editor.ps1
$url = 'https://github.com/xvitaly/mhed/releases/download/v1.6.2/mhed_162_setup.exe'
$sha256 = '987761294C76DB76D3F6B660440DC2EAB52F70ADECB9E12BF3D5DEFC03639F4A'
$file = Join-Path $env:TEMP 'mhed_162_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