Silent install of OpenJDK MSI

%3CLINGO-SUB%20id%3D%22lingo-sub-2367683%22%20slang%3D%22en-US%22%3ESilent%20install%20of%20OpenJDK%20MSI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2367683%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20silent%20install%20an%20MSI%20in%20PowerShell.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENeed%20silent%20install%20because%20I%20am%20doing%20it%20when%20building%20my%20Windows%20JDK11%20docker%20image.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirst%20download%20the%20AdoptOpenJDK%20OpenJDK%2011%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EInvoke-WebRequest%20https%3A%2F%2Fapi.adoptopenjdk.net%2Fv3%2Finstaller%2Flatest%2F11%2Fga%2Fwindows%2Fx64%2Fjdk%2Fhotspot%2Fnormal%2Fadoptopenjdk%3Fproject%3Djdk%20-OutFile%20C%3A%5CTemp%5Copenjdk11.msi%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETrying%20with%20silent%20install%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EStart-Process%20-Wait%20-FilePath%20msiexec%20-ArgumentList%20%2Fi%2C%20%22C%3A%5CTemp%5Copenjdk11.msi%22%2C%20%22ADDLOCAL%3DFeatureMain%2CFeatureEnvironment%2CFeatureJarFileRunWith%2CFeatureJavaHome%22%2C%20%22INSTALLDIR%3D'C%3A%5CProgram%20Files%5CJava'%22%2C%20%2Fquiet%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20install%20process%20just%20hangs%20there%20forever.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2367683%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

I am trying to silent install an MSI in PowerShell.

 

Need silent install because I am doing it when building my Windows JDK11 docker image.

 

First download the AdoptOpenJDK OpenJDK 11

 

 

Invoke-WebRequest https://api.adoptopenjdk.net/v3/installer/latest/11/ga/windows/x64/jdk/hotspot/normal/adoptopenjdk?project=jdk -OutFile C:\Temp\openjdk11.msi

 

 

Trying with silent install:

 

 

Start-Process -Wait -FilePath msiexec -ArgumentList /i, "C:\Temp\openjdk11.msi", "ADDLOCAL=\"FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome\"", "INSTALLDIR=\"C:\Program Files\Java\"", /quiet

 

 

 

The install process just hangs there forever.

1 Reply
The solutions was

Start-Process -Wait -FilePath msiexec -ArgumentList /i, "C:\Temp\openjdk11.msi", "ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome", 'INSTALLDIR="C:\Program Files\Java"', /quiet -Verb RunAs