Ordres per instal·lar Amazon Corretto 21 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 Amazon.Corretto.21.JDK -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Amazon.Corretto.21.JDK -e --silentwinget uninstall --id Amazon.Corretto.21.JDK -e --silentPer instal·lador
64 bits · MSI · Tots els usuaris
Instal·lació silenciosa
msiexec /i amazon-corretto-21.0.13.0.11-windows-x64.msi /qn /norestartDesar un registre
msiexec /i amazon-corretto-21.0.13.0.11-windows-x64.msi /qn /norestart /l*v "%TEMP%\amazon-corretto-21-install.log"Desinstal·lar
msiexec /x {E0EC7B2A-F026-4580-BF35-021BF022B7DD} /qn /norestart- Codi de producte MSI
- {E0EC7B2A-F026-4580-BF35-021BF022B7DD}
- Clau de desinstal·lació al registre
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E0EC7B2A-F026-4580-BF35-021BF022B7DD}
- UpgradeCode
- {590058C2-642A-4980-A36B-A1212D1C4E5D}
PowerShell: baixar, verificar, instal·lar
Baixa el fitxer oficial, en comprova l’SHA256 i l’instal·la en mode silenciós.
install-amazon-corretto-21.ps1
$url = 'https://corretto.aws/downloads/resources/21.0.13.0.11/amazon-corretto-21.0.13.0.11-windows-x64.msi'
$sha256 = '9B2470F031616C8CE92274EF64635551659E644AF94B6BAC8FD72A84F59211E3'
$file = Join-Path $env:TEMP 'amazon-corretto-21.0.13.0.11-windows-x64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait