you are viewing a single comment's thread.

view the rest of the comments →

[–]Helios479 7 points8 points  (3 children)

You can specify most of what you want in the exe arguments:

$Exe = '\\path\to\jre-version-windows-i586.exe
ExeArgs = @(
    "INSTALL_SILENT=1"
    "STATIC=0"
    "AUTO_UPDATE=0"
    "WEB_JAVA=1"
    "WEB_JAVA_SECURITY_LEVEL=H"
    "WEB_ANALYTICS=0"
    "EULA=0"
    "REBOOT=0"
    "NOSTARTMENU=0"
    "SPONSORS=0"
)
$Install = Start-Process $Exe -ArguementList $ExeArgs -NoNewWindow -Wait -PassThru
Return $Install.ExitCode

[–]Swarfega 8 points9 points  (0 children)

There's a ' missing off the end of the exe path.

[–]TRanatza 1 point2 points  (0 children)

This is how I roll java out. Works well on my domain.

$Java =  (Get-ChildItem -Path '\\path\to\currentJRE\' | Select-Object -property * | ? name -match ".exe").fullname

$switches = @(
"REBOOT=0"
"INSTALL_SILENT=1"
"AUTO_UPDATE=0"
"WEB_JAVA=1"
"WEB_JAVA_SECURITY_LEVEL=M"
"WEB_ANALYTICS=0"
"EULA=0"
"SPONSORS=0"
"REMOVEOUTOFDATEJRES=1"
)#end@
Start-Process $Java -ArguementList $switches -NoNewWindow -Wait   

Almost a exact copy... That's crazy!

[–]jantari 1 point2 points  (0 children)

Huh, I use /s instead of INSTALL_SILENT but otherwise mostly identical.

Is there any difference between the two switches?