Skip to content

Commit

Permalink
GH-53 & GH-54 & GH-55: Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarafian committed Apr 7, 2017
1 parent 4f4b0eb commit 4e68928
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Source/Server/Install/Install-ISHDeployment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@ $newParameterScriptBlock={
}

$installScriptBlock={
[int]$major=($ISHVersion -split '\.')[0]
if($major -ge 13)
{
# Fixing JAVA_HOME not set because we didn't restart
$envVarName="JAVA_HOME"
if(-not (Get-Item -Path ENV:\$envVarName -ErrorAction SilentlyContinue))
{
$value=Get-ChildItem -Path $Env:ProgramFiles\Java |Sort-Object -Property Name -Descending|Select-Object -First 1 -ExpandProperty Name
Set-Item -Path ENV:\$envVarName -Value $value
Write-Warning "Environment variable $envVarName could not be retrieved. Setting to $value"
}
}

$fileName="inputparameters-$Name.xml"
$folderPath=Resolve-Path "$CDPath\.."
$inputParametersPathPath=Join-Path $folderPath $fileName
Expand Down Expand Up @@ -347,7 +360,7 @@ try

$blockName="Installing $Name"
Write-Progress @scriptProgress -Status $blockName
Invoke-CommandWrap -ComputerName $Computer -Credential $Credential -ScriptBlock $installScriptBlock -BlockName $blockName -UseParameters @("cdPath","Name")
Invoke-CommandWrap -ComputerName $Computer -Credential $Credential -ScriptBlock $installScriptBlock -BlockName $blockName -UseParameters @("cdPath","ISHVersion","Name")
}
catch
{
Expand Down

0 comments on commit 4e68928

Please sign in to comment.