ConfigMgr: JRE 8u71 verteilen

Update 20160130: Im Script fehlte ein kleiner Teil, daher war die Verteilung nicht in jedem Fall erfolgreich. Dies ist jetzt angepasst.

Nachdem ich im letzten Post die Verteilung von 8u66 beschrieben habe, schiebe ich direkt die Verteilung vom aktuellen 8u71 hinterher. Wie gewünscht ist es hauptsächlich das Austauschen der EXE und Anpassen der Filenamen bzw. GUIDs und Versionsnummern.

<appdefinition>
<file>jre-8u71-windows-i586.exe</file>
<hash type="SHA256">3CC0BE2A34F0989692C30F2CACB89CACFCA7159570D5FC8C1B1498C60CBC07FB</hash>             
<info>
	<setupType>InnoSetup</setupType>
	<isX86>true</isX86>
	<company>Oracle Corporation</company>
	<productName>Java 8 Update 71</productName>
	<msiProductCode>{26A24AE4-039D-4CA4-87B4-2F83218071F0}</msiProductCode>
</info>
<install>
Show-InstallationProgress -StatusMessage 'Installing Java JRE. This may take some time. Please wait...'
$path=join-path (join-path $env:programdata 'Oracle') 'Java'
if ((Test-Path $path) -eq $false) {
   New-Item -Type Directory $path |out-null
}
new-item -type File (join-path $path 'java.settings.cfg') -force | out-null
if ($is64Bit) {
	$path=join-path $envWinDir "System32\config\systemprofile\AppData\LocalLow\Oracle"
	$symName=join-path $envWinDir "SysWOW64\config\systemprofile\AppData\LocalLow\Oracle"
	if  (Test-Path $symname) {
		remove-Item -Recurse -Path $symName
	}
	if (-not (Test-Path $path)) {
		new-item -ItemType Directory -Path $path
	}
	#Quelle: https://gallery.technet.microsoft.com/scriptcenter/New-SymLink-60d2531e
	        Try {
	            $null = [mklink.symlink]
	        } Catch {
	            Add-Type @"
	            using System;
	            using System.Runtime.InteropServices;
	 
	            namespace mklink
	            {
	                public class symlink
	                {
	                    [DllImport("kernel32.dll")]
	                    public static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, int dwFlags);
	                }
	            }
"@
	        }
	            Try {
	                $return = [mklink.symlink]::CreateSymbolicLink($SymName,$Path,1)
	            } Catch {
	            }
}

Execute-Process -Path "jre-8u71-windows-i586.exe" -Parameters "/s INSTALL_SILENT=Enable AUTO_UPDATE=Disable WEB_JAVA=Disable WEB_ANALYTICS=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable" -WindowStyle Hidden
</install>
<uninstall>
Execute-MSI -Action Uninstall -Path "{26A24AE4-039D-4CA4-87B4-2F83218071F0}"
</uninstall>
<detection>
if ([IntPtr]::Size -eq 8) {$regPath="HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"} else { $regPath="HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*"}
Get-ItemProperty $regPath | where {$_.psChildname -like "{26A24AE4-039D-4CA4-87B4-2F83218071F0}" -and $_.DisplayVersion -eq "8.0.710.15" -and $_.WindowsInstaller -eq 1}
</detection>
</appdefinition>

 

This entry was posted in automateAppDeployment, Configuration Manager, Deutsch, Powershell, System Center and tagged , , , . Bookmark the permalink.

1 Response to ConfigMgr: JRE 8u71 verteilen

  1. Pingback: ConfigMgr: Softwarepaketierung Übersicht | Markus Bäker

Leave a Reply