Skip to content

Commit

Permalink
RWSGH-48: Add installaton of AdoptOpenJDK and JRE pre-requisite
Browse files Browse the repository at this point in the history
  • Loading branch information
beutepa committed Oct 30, 2018
1 parent a80a773 commit e4c9e04
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**1.7**

Issues:
- GH-48: SAdd installaton of AdoptOpenJDK pre-requisite
- GH-48: SAdd installaton of AdoptOpenJDK and JRE pre-requisite

**1.6**

Expand Down
1 change: 1 addition & 0 deletions Source/Modules/ISHServer/Get-ISHPrerequisites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ function Get-ISHPrerequisites
if($PSCmdlet.MyInvocation.MyCommand.Module.Name -eq "ISHServer.14")
{
$filesToDownload+=Get-Variable -Name "ISHServer:AdoptOpenJDK" -ValueOnly
$filesToDownload+=Get-Variable -Name "ISHServer:AdoptOpenJRE" -ValueOnly
}

$osInfo=Get-ISHOSInfo
Expand Down
4 changes: 3 additions & 1 deletion Source/Modules/ISHServer/ISHServer.14.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

Set-Variable -Name "ISHServer:JDK" -Value "jdk-8u144-windows-x64.exe" -Scope "Script" -Option Constant
Set-Variable -Name "ISHServer:JRE" -Value "jre-8u144-windows-x64.exe" -Scope "Script" -Option Constant
Set-Variable -Name "ISHServer:AdoptOpenJDK" -Value "OpenJDK11-jre_x64_windows_hotspot_11_28.zip" -Scope "Script" -Option Constant
Set-Variable -Name "ISHServer:AdoptOpenJDK" -Value "OpenJDK11-jdk_x64_windows_hotspot_11_28.zip" -Scope "Script" -Option Constant
Set-Variable -Name "ISHServer:AdoptOpenJRE" -Value "OpenJDK11-jre_x64_windows_hotspot_11_28.zip" -Scope "Script" -Option Constant
Set-Variable -Name "ISHServer:JavaHelp" -Value "javahelp-2_0_05.zip" -Scope "Script" -Option Constant
Set-Variable -Name "ISHServer:HtmlHelp" -Value "htmlhelp.zip" -Scope "Script" -Option Constant
Set-Variable -Name "ISHServer:AntennaHouse" -Value "V6-5-R1-Windows_X64_64E.exe" -Scope "Script" -Option Constant
Expand Down Expand Up @@ -64,6 +65,7 @@ $exportNames=@(
"Install-ISHToolVisualCPP"
"Install-ISHToolJAVA"
"Install-ISHToolAdoptOpenJDK"
"Install-ISHToolAdoptOpenJRE"
"Install-ISHToolJavaHelp"
"Install-ISHToolHtmlHelp"
"Install-ISHToolAntennaHouse"
Expand Down
52 changes: 52 additions & 0 deletions Source/Modules/ISHServer/Install-ISHToolAdoptOpenJRE.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<#
# Copyright (c) 2014 All Rights Reserved by the SDL Group.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#>

. $PSScriptRoot\Get-ISHServerFolderPath.ps1

function Install-ISHToolAdoptOpenJRE
{
[CmdletBinding()]
Param()

begin
{
. $PSScriptRoot\Private\Test-RunningAsElevated.ps1
Test-RunningAsElevated -StopCallerPSCmdlet $PSCmdlet
}

process
{
# http://docs.sdl.com/LiveContent/content/en-US/SDL%20Knowledge%20Center%20full%20documentation-v2/GUID-48FBD1F6-1492-4156-827C-30CA45FC60E9
$fileName=Get-Variable -Name "ISHServer:AdoptOpenJRE" -ValueOnly
$filePath=Join-Path (Get-ISHServerFolderPath) $fileName
$targetPath="C:\AdoptOpenJDK\"
if(Test-Path $targetPath)
{
Write-Warning "$fileName is already installed in $targetPath"
return
}
Write-Debug "Creating $targetPath"
New-Item $targetPath -ItemType Directory |Out-Null
Write-Debug "Unzipping $filePath to $targetPath"
[System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem')|Out-Null
[System.IO.Compression.ZipFile]::ExtractToDirectory($filePath, $targetPath)|Out-Null
Write-Verbose "Installed $filePath"
}
end
{

}
}

0 comments on commit e4c9e04

Please sign in to comment.