Skip to content

Commit

Permalink
GH-48: Add installaton of AdoptOpenJDK and JRE pre-requisite (#49)
Browse files Browse the repository at this point in the history
* GH-48: Add installaton of AdoptOpenJDK and JRE pre-requisite
  • Loading branch information
beutepa authored Oct 31, 2018
1 parent a80a773 commit 5b51726
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 6 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
10 changes: 6 additions & 4 deletions Source/Modules/ISHServer/Install-ISHToolAdoptOpenJDK.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ function Install-ISHToolAdoptOpenJDK
$targetPath="C:\AdoptOpenJDK\"
if(Test-Path $targetPath)
{
Write-Warning "$fileName is already installed in $targetPath"
return
Write-Warning "$targetPath already exists"
}
else
{
Write-Debug "Creating $targetPath"
New-Item $targetPath -ItemType Directory |Out-Null
}
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
Expand Down
54 changes: 54 additions & 0 deletions Source/Modules/ISHServer/Install-ISHToolAdoptOpenJRE.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<#
# 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 "$targetPath already exists"
}
else
{
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 5b51726

Please sign in to comment.