Ordres per instal·lar Micro Hosts Editor 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 xvitaly.MicroHostsEditor -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id xvitaly.MicroHostsEditor -e --silentwinget uninstall --id xvitaly.MicroHostsEditor -e --silentPer instal·lador
32 bits · EXE (Inno Setup)
Instal·lació silenciosa
mhed_162_setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-Una altra carpeta
mhed_162_setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\micro-hosts-editor"- Clau de desinstal·lació al registre
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{1A3295AB-919E-4E58-B2A3-1B8B9BF8E29D}_is1
PowerShell: baixar, verificar, instal·lar
Baixa el fitxer oficial, en comprova l’SHA256 i l’instal·la en mode silenciós.
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