Skip to content

Commit

Permalink
Temurin addition
Browse files Browse the repository at this point in the history
  • Loading branch information
ajshastri committed Jan 1, 2024
1 parent 219245a commit 1734725
Show file tree
Hide file tree
Showing 30 changed files with 1,516 additions and 0 deletions.
53 changes: 53 additions & 0 deletions temurin-11-jdk/Temurin11.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Temurin11</id>
<version>11.0.21.900</version>
<title>Temurin jdk11 hotspot 11.0.21.9</title>
<authors>Adoptium</authors>
<owners>JohanJanssen</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://github.com/adoptium/jdk11u/blob/master/LICENSE</licenseUrl>
<projectUrl>https://adoptium.net/</projectUrl>
<iconUrl>https://adoptium.net/images/temurin-light.png</iconUrl>
<description>## Temurin

The Temurin11 package uses OpenJDK_HotSpot VM from Temurin using the msi file format.

Using a msi file provides a rich source of installation options :

** The following Features must be listed after `/ADDLOCAL=` using a comma after each feature. **

| Feature | Description |
|----|----|
| FeatureMain &amp;nbsp; | &amp;nbsp; Core Temurin installation (DEFAULT) |
| FeatureEnvironment &amp;nbsp; | &amp;nbsp; Update the PATH environment variable (DEFAULT) |
| FeatureJarFileRunWith &amp;nbsp; | &amp;nbsp; Associate .jar files with Java applications (DEFAULT) |
| FeatureJavaHome &amp;nbsp; | &amp;nbsp; Update the JAVA_HOME environment variable |
| FeatureIcedTeaWeb &amp;nbsp; | &amp;nbsp; Install IcedTea-Web |
| FeatureJNLPFileRunWith &amp;nbsp; | &amp;nbsp; Associate .jnlp files with IcedTea-web (Temurin 8 only) |
| FeatureOracleJavaSoft &amp;nbsp; | &amp;nbsp; Updates registry keys HKLM\SOFTWARE\JavaSoft\ (Temurin 8 only) |

** Note: FeatureOracleJavaSoft can be used to prevent Oracle Java launching from PATH when Temurin is uninstalled. Reinstall Oracle Java if you need to restore the Oracle registry keys. **

Optional parameters can be used that group some of the features together:

| Parameter | Features |
|----|----|
| &amp;nbsp; INSTALLLEVEL=1 &amp;nbsp; | &amp;nbsp; FeatureMain,FeatureEnvironment,FeatureJarFileRunWith &amp;nbsp; |
|----|----|
| &amp;nbsp; INSTALLLEVEL=2 &amp;nbsp; | &amp;nbsp; FeatureMain,FeatureEnvironment,FeatureJarFileRunWith, FeatureJavaHome,FeatureIcedTeaWeb &amp;nbsp; |
|----|----|
| &amp;nbsp; INSTALLLEVEL=3 &amp;nbsp; | &amp;nbsp; FeatureMain,FeatureEnvironment,FeatureJarFileRunWith, FeatureJavaHome,FeatureIcedTeaWeb,FeatureJNLPFileRunWith &amp;nbsp; |

The following example silently installs Temurin, updates the PATH, associates .jar files with Java applications and defines JAVA_HOME:
Example: `choco install Temurin11 --params="/ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome /INSTALLDIR=$env:Programfiles\Eclipse Adoptium\ /quiet"`
** Note: You must use INSTALLDIR with FeatureMain. INSTALLDIR Default is `$env:Programfiles\Eclipse Adoptium` **

This will install both the 32 bit and 64 bit versions of the desired package by using the parameter `/both`
Example: `choco install Temurin11 --params="/both"`</description>
<summary>Adoptium provides prebuilt OpenJDK build binaries. This one uses OpenJDK_HotSpot.</summary>
<tags>openjdk java jvm</tags>
<packageSourceUrl>https://github.com/johanjanssen/TemurinChocolateyPackages</packageSourceUrl>
</metadata>
</package>
28 changes: 28 additions & 0 deletions temurin-11-jdk/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$ErrorActionPreference = 'Stop'
if(!$PSScriptRoot){ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent }
. "$PSScriptRoot\helper.ps1"

# Get Package Parameters
$parameters = (Get-PackageParameters); $pp = ( Test-PackageParamaters $parameters ).ToString() -replace('""|="True"','') -replace(";", ' ') -replace("==", '=')

$packageArgs = @{
PackageName = 'Temurin11'
fileType = 'msi'
Url = 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_x86-32_windows_hotspot_11.0.21_9.msi'
Url64bit = 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jdk_x64_windows_hotspot_11.0.21_9.msi'
Checksum = '57111DF6BFB24D0F9977A3940AAE41940CC42C6A6F43AA98D03C73F568BED30A'
ChecksumType = 'sha256'
Checksum64 = 'CCAA09811F488CF95340E2702E8D9176058A52E89808AE6E1A1D20DE39E5CE34'
ChecksumType64 = 'sha256'
SilentArgs = $pp
}

if ($parameters.both){
write-warning "Installing 32bit version"
Install-ChocolateyPackage $packageArgs.packageName $packageArgs.fileType $packageArgs.SilentArgs $packageArgs.url -checksum $packageArgs.checksum -checksumtype $packageArgs.ChecksumType
write-warning "Installing 64bit version"
Install-ChocolateyPackage $packageArgs.packageName $packageArgs.fileType $packageArgs.SilentArgs $packageArgs.Url64bit $packageArgs.Url64bit -checksum $packageArgs.Checksum64 -checksumtype $packageArgs.ChecksumType64
} else {
write-warning "Installing only Get-OSArchitectureWidth"
Install-ChocolateyPackage @packageArgs
}
75 changes: 75 additions & 0 deletions temurin-11-jdk/tools/helper.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

<# Bol Updating of hashtable to string for ToString method #>
Update-TypeData -TypeName System.Collections.HashTable `
-MemberType ScriptMethod `
-MemberName ToString `
-Value { $keys = $this.keys; foreach ($key in $keys) { $v = $this[$key];
if ($key -match "\s") { $hashstr += "`"$key`"" + "=" + "`"$v`"" + ";" }
else { $hashstr += $key + "=" + "`"$v`"" + ";" } };
return $hashstr }
<# Eol Updating of hashtable to string for ToString method #>

function Test-PackageParamaters {
[CmdletBinding()]
param(
[hashtable]$pp
)
$disabledMsg = "This switch has been disabled"
$New_pp = @{};
$toolsDir = @{$true="${env:ProgramFiles}\Temurin";$false="${env:programfiles(x86)}\Temurin"}[ ((Get-OSArchitectureWidth 64) -or ($env:chocolateyForceX86 -eq $true)) ]
if (![string]::IsNullOrEmpty($pp.transforms)) {
$New_pp.add( "transforms", $pp.transforms )
}
if (![string]::IsNullOrEmpty($pp.INSTALLDIR) -and (($New_pp.ADDLOCAL -match "FeatureMain") -or ($pp.ADDLOCAL -match "FeatureMain")) -and ([string]::IsNullOrEmpty($pp.INSTALLLEVEL)) ) {
Write-Warning "You must use INSTALLDIR with FeatureMain."
Write-Warning "Using provided $($pp.INSTALLDIR)"
$New_pp.add( "InstallDir", "`"`"$($pp.INSTALLDIR)`"`"" )
} elseif ([string]::IsNullOrEmpty($pp.INSTALLDIR) -and (($New_pp.ADDLOCAL -match "FeatureMain") -or ($pp.ADDLOCAL -match "FeatureMain")) -and ([string]::IsNullOrEmpty($pp.INSTALLLEVEL)) ) {
Write-Warning "Using Default of $toolsDir"
$New_pp.add( "InstallDir", "`"`"$toolsDir`"`"" )
}
if ((![string]::IsNullOrEmpty($pp.ADDLOCAL)) -and ([string]::IsNullOrEmpty($pp.INSTALLLEVEL)) ) {
Write-Warning "Using Addlocal"
$addlocalArray = ($pp.ADDLOCAL -split "\,")
foreach ( $_ in $addlocalArray) {
switch -Wildcard ($_) {
"FeatureMain" {
$pp_addlocal_array += -join ("FeatureMain", ",")
}
"FeatureEnvironment" {
$pp_addlocal_array += -join ("FeatureEnvironment", ",")
}
"FeatureJarFileRunWith" {
$pp_addlocal_array += -join ("FeatureJarFileRunWith", ",")
}
"FeatureJavaHome" {
$pp_addlocal_array += -join ("FeatureJavaHome", ",")
}
"FeatureIcedTeaWeb" {
$DisabledMsg | Write-Warning
# $pp_addlocal_array += -join ("FeatureIcedTeaWeb", ",")
}
"FeatureJNLPFileRunWith" {
$DisabledMsg | Write-Warning
# $pp_addlocal_array += -join ("FeatureJNLPFileRunWith", ",")
}
"FeatureOracleJavaSoft" {
$pp_addlocal_array += -join ("FeatureOracleJavaSoft", ",")
}
}
}
Write-Warning "No InstallLevel detected. Defaulting to AddLocal"
$New_pp.add( "ADDLOCAL", ($pp_addlocal_array -replace ".{1}$") )
}
if (![string]::IsNullOrEmpty($pp.INSTALLLEVEL) ) {
$New_pp.add( "INSTALLLEVEL", $pp.INSTALLLEVEL )
}
if ([string]::IsNullOrEmpty($pp.quiet)) {
$New_pp.add( "/quiet", $true )
} else {
# Added to make sure the /quiet silent install is carried over if the user adds it to the params switch list
$New_pp.add( "/quiet", $true )
}

return $New_pp
}
53 changes: 53 additions & 0 deletions temurin-11-jre/Temurin11jre.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Temurin11jre</id>
<version>11.0.21.900</version>
<title>Temurin jre11 hotspot 11.0.21.9</title>
<authors>Adoptium</authors>
<owners>JohanJanssen</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://github.com/adoptium/jdk11u/blob/master/LICENSE</licenseUrl>
<projectUrl>https://adoptium.net/</projectUrl>
<iconUrl>https://adoptium.net/images/temurin-light.png</iconUrl>
<description>## Temurin

The Temurin11jre package uses OpenJDK_HotSpot VM from Temurin using the msi file format.

Using a msi file provides a rich source of installation options :

** The following Features must be listed after `/ADDLOCAL=` using a comma after each feature. **

| Feature | Description |
|----|----|
| FeatureMain &amp;nbsp; | &amp;nbsp; Core Temurin installation (DEFAULT) |
| FeatureEnvironment &amp;nbsp; | &amp;nbsp; Update the PATH environment variable (DEFAULT) |
| FeatureJarFileRunWith &amp;nbsp; | &amp;nbsp; Associate .jar files with Java applications (DEFAULT) |
| FeatureJavaHome &amp;nbsp; | &amp;nbsp; Update the JAVA_HOME environment variable |
| FeatureIcedTeaWeb &amp;nbsp; | &amp;nbsp; Install IcedTea-Web |
| FeatureJNLPFileRunWith &amp;nbsp; | &amp;nbsp; Associate .jnlp files with IcedTea-web (Temurin 8 only) |
| FeatureOracleJavaSoft &amp;nbsp; | &amp;nbsp; Updates registry keys HKLM\SOFTWARE\JavaSoft\ (Temurin 8 only) |

** Note: FeatureOracleJavaSoft can be used to prevent Oracle Java launching from PATH when Temurin is uninstalled. Reinstall Oracle Java if you need to restore the Oracle registry keys. **

Optional parameters can be used that group some of the features together:

| Parameter | Features |
|----|----|
| &amp;nbsp; INSTALLLEVEL=1 &amp;nbsp; | &amp;nbsp; FeatureMain,FeatureEnvironment,FeatureJarFileRunWith &amp;nbsp; |
|----|----|
| &amp;nbsp; INSTALLLEVEL=2 &amp;nbsp; | &amp;nbsp; FeatureMain,FeatureEnvironment,FeatureJarFileRunWith, FeatureJavaHome,FeatureIcedTeaWeb &amp;nbsp; |
|----|----|
| &amp;nbsp; INSTALLLEVEL=3 &amp;nbsp; | &amp;nbsp; FeatureMain,FeatureEnvironment,FeatureJarFileRunWith, FeatureJavaHome,FeatureIcedTeaWeb,FeatureJNLPFileRunWith &amp;nbsp; |

The following example silently installs Temurin, updates the PATH, associates .jar files with Java applications and defines JAVA_HOME:
Example: `choco install Temurin11jre --params="/ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome /INSTALLDIR=$env:Programfiles\Eclipse Adoptium\ /quiet"`
** Note: You must use INSTALLDIR with FeatureMain. INSTALLDIR Default is `$env:Programfiles\Eclipse Adoptium` **

This will install both the 32 bit and 64 bit versions of the desired package by using the parameter `/both`
Example: `choco install Temurin11jre --params="/both"`</description>
<summary>Adoptium provides prebuilt OpenJDK build binaries. This one uses OpenJDK_HotSpot.</summary>
<tags>openjdk java jvm</tags>
<packageSourceUrl>https://github.com/johanjanssen/TemurinChocolateyPackages</packageSourceUrl>
</metadata>
</package>
28 changes: 28 additions & 0 deletions temurin-11-jre/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$ErrorActionPreference = 'Stop'
if(!$PSScriptRoot){ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent }
. "$PSScriptRoot\helper.ps1"

# Get Package Parameters
$parameters = (Get-PackageParameters); $pp = ( Test-PackageParamaters $parameters ).ToString() -replace('""|="True"','') -replace(";", ' ') -replace("==", '=')

$packageArgs = @{
PackageName = 'Temurin11jre'
fileType = 'msi'
Url = 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_x86-32_windows_hotspot_11.0.21_9.msi'
Url64bit = 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_x64_windows_hotspot_11.0.21_9.msi'
Checksum = 'B9D2E1156EED11127C4B583EDDC8B9C36F28A2EE1EB676FDBF4B931F89DCC86B'
ChecksumType = 'sha256'
Checksum64 = '9B0EA6EBE77E70C7AC229074028D64399D72A7FDA499AAD114EF0BA4C375B1A8'
ChecksumType64 = 'sha256'
SilentArgs = $pp
}

if ($parameters.both){
write-warning "Installing 32bit version"
Install-ChocolateyPackage $packageArgs.packageName $packageArgs.fileType $packageArgs.SilentArgs $packageArgs.url -checksum $packageArgs.checksum -checksumtype $packageArgs.ChecksumType
write-warning "Installing 64bit version"
Install-ChocolateyPackage $packageArgs.packageName $packageArgs.fileType $packageArgs.SilentArgs $packageArgs.Url64bit $packageArgs.Url64bit -checksum $packageArgs.Checksum64 -checksumtype $packageArgs.ChecksumType64
} else {
write-warning "Installing only Get-OSArchitectureWidth"
Install-ChocolateyPackage @packageArgs
}
75 changes: 75 additions & 0 deletions temurin-11-jre/tools/helper.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

<# Bol Updating of hashtable to string for ToString method #>
Update-TypeData -TypeName System.Collections.HashTable `
-MemberType ScriptMethod `
-MemberName ToString `
-Value { $keys = $this.keys; foreach ($key in $keys) { $v = $this[$key];
if ($key -match "\s") { $hashstr += "`"$key`"" + "=" + "`"$v`"" + ";" }
else { $hashstr += $key + "=" + "`"$v`"" + ";" } };
return $hashstr }
<# Eol Updating of hashtable to string for ToString method #>

function Test-PackageParamaters {
[CmdletBinding()]
param(
[hashtable]$pp
)
$disabledMsg = "This switch has been disabled"
$New_pp = @{};
$toolsDir = @{$true="${env:ProgramFiles}\Temurin";$false="${env:programfiles(x86)}\Temurin"}[ ((Get-OSArchitectureWidth 64) -or ($env:chocolateyForceX86 -eq $true)) ]
if (![string]::IsNullOrEmpty($pp.transforms)) {
$New_pp.add( "transforms", $pp.transforms )
}
if (![string]::IsNullOrEmpty($pp.INSTALLDIR) -and (($New_pp.ADDLOCAL -match "FeatureMain") -or ($pp.ADDLOCAL -match "FeatureMain")) -and ([string]::IsNullOrEmpty($pp.INSTALLLEVEL)) ) {
Write-Warning "You must use INSTALLDIR with FeatureMain."
Write-Warning "Using provided $($pp.INSTALLDIR)"
$New_pp.add( "InstallDir", "`"`"$($pp.INSTALLDIR)`"`"" )
} elseif ([string]::IsNullOrEmpty($pp.INSTALLDIR) -and (($New_pp.ADDLOCAL -match "FeatureMain") -or ($pp.ADDLOCAL -match "FeatureMain")) -and ([string]::IsNullOrEmpty($pp.INSTALLLEVEL)) ) {
Write-Warning "Using Default of $toolsDir"
$New_pp.add( "InstallDir", "`"`"$toolsDir`"`"" )
}
if ((![string]::IsNullOrEmpty($pp.ADDLOCAL)) -and ([string]::IsNullOrEmpty($pp.INSTALLLEVEL)) ) {
Write-Warning "Using Addlocal"
$addlocalArray = ($pp.ADDLOCAL -split "\,")
foreach ( $_ in $addlocalArray) {
switch -Wildcard ($_) {
"FeatureMain" {
$pp_addlocal_array += -join ("FeatureMain", ",")
}
"FeatureEnvironment" {
$pp_addlocal_array += -join ("FeatureEnvironment", ",")
}
"FeatureJarFileRunWith" {
$pp_addlocal_array += -join ("FeatureJarFileRunWith", ",")
}
"FeatureJavaHome" {
$pp_addlocal_array += -join ("FeatureJavaHome", ",")
}
"FeatureIcedTeaWeb" {
$DisabledMsg | Write-Warning
# $pp_addlocal_array += -join ("FeatureIcedTeaWeb", ",")
}
"FeatureJNLPFileRunWith" {
$DisabledMsg | Write-Warning
# $pp_addlocal_array += -join ("FeatureJNLPFileRunWith", ",")
}
"FeatureOracleJavaSoft" {
$pp_addlocal_array += -join ("FeatureOracleJavaSoft", ",")
}
}
}
Write-Warning "No InstallLevel detected. Defaulting to AddLocal"
$New_pp.add( "ADDLOCAL", ($pp_addlocal_array -replace ".{1}$") )
}
if (![string]::IsNullOrEmpty($pp.INSTALLLEVEL) ) {
$New_pp.add( "INSTALLLEVEL", $pp.INSTALLLEVEL )
}
if ([string]::IsNullOrEmpty($pp.quiet)) {
$New_pp.add( "/quiet", $true )
} else {
# Added to make sure the /quiet silent install is carried over if the user adds it to the params switch list
$New_pp.add( "/quiet", $true )
}

return $New_pp
}
53 changes: 53 additions & 0 deletions temurin-17-jdk/Temurin17.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Temurin17</id>
<version>17.0.9.900</version>
<title>Temurin jdk17 hotspot 17.0.9.9</title>
<authors>Adoptium</authors>
<owners>JohanJanssen</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://github.com/adoptium/jdk17/blob/master/LICENSE</licenseUrl>
<projectUrl>https://adoptium.net/</projectUrl>
<iconUrl>https://adoptium.net/images/temurin-light.png</iconUrl>
<description>## Temurin

The Temurin17 package uses OpenJDK_HotSpot VM from Temurin using the msi file format.

Using a msi file provides a rich source of installation options :

** The following Features must be listed after `/ADDLOCAL=` using a comma after each feature. **

| Feature | Description |
|----|----|
| FeatureMain &amp;nbsp; | &amp;nbsp; Core Temurin installation (DEFAULT) |
| FeatureEnvironment &amp;nbsp; | &amp;nbsp; Update the PATH environment variable (DEFAULT) |
| FeatureJarFileRunWith &amp;nbsp; | &amp;nbsp; Associate .jar files with Java applications (DEFAULT) |
| FeatureJavaHome &amp;nbsp; | &amp;nbsp; Update the JAVA_HOME environment variable |
| FeatureIcedTeaWeb &amp;nbsp; | &amp;nbsp; Install IcedTea-Web |
| FeatureJNLPFileRunWith &amp;nbsp; | &amp;nbsp; Associate .jnlp files with IcedTea-web (Temurin 8 only) |
| FeatureOracleJavaSoft &amp;nbsp; | &amp;nbsp; Updates registry keys HKLM\SOFTWARE\JavaSoft\ (Temurin 8 only) |

** Note: FeatureOracleJavaSoft can be used to prevent Oracle Java launching from PATH when Temurin is uninstalled. Reinstall Oracle Java if you need to restore the Oracle registry keys. **

Optional parameters can be used that group some of the features together:

| Parameter | Features |
|----|----|
| &amp;nbsp; INSTALLLEVEL=1 &amp;nbsp; | &amp;nbsp; FeatureMain,FeatureEnvironment,FeatureJarFileRunWith &amp;nbsp; |
|----|----|
| &amp;nbsp; INSTALLLEVEL=2 &amp;nbsp; | &amp;nbsp; FeatureMain,FeatureEnvironment,FeatureJarFileRunWith, FeatureJavaHome,FeatureIcedTeaWeb &amp;nbsp; |
|----|----|
| &amp;nbsp; INSTALLLEVEL=3 &amp;nbsp; | &amp;nbsp; FeatureMain,FeatureEnvironment,FeatureJarFileRunWith, FeatureJavaHome,FeatureIcedTeaWeb,FeatureJNLPFileRunWith &amp;nbsp; |

The following example silently installs Temurin, updates the PATH, associates .jar files with Java applications and defines JAVA_HOME:
Example: `choco install Temurin17 --params="/ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome /INSTALLDIR=$env:Programfiles\Eclipse Adoptium\ /quiet"`
** Note: You must use INSTALLDIR with FeatureMain. INSTALLDIR Default is `$env:Programfiles\Eclipse Adoptium` **

This will install both the 32 bit and 64 bit versions of the desired package by using the parameter `/both`
Example: `choco install Temurin17 --params="/both"`</description>
<summary>Adoptium provides prebuilt OpenJDK build binaries. This one uses OpenJDK_HotSpot.</summary>
<tags>openjdk java jvm</tags>
<packageSourceUrl>https://github.com/johanjanssen/TemurinChocolateyPackages</packageSourceUrl>
</metadata>
</package>
Loading

0 comments on commit 1734725

Please sign in to comment.