Pulse 6.5.1 silent installer

Hi all,

We have been using a script provided to us by the Pulse Devs to install Pulse since the 6.0.x versions, but it seems to have broken after the Elasticsearch → Opensearch update in 6.5.1.

What updates need to be done for the Opensearch update? In the meantime I will try to back-engineer, but ideally it would be nice to have the updated script to help prevent any data loss.

I’ve included below an inline version of the original script, adapted to the last version we had installed, 6.3.1.

$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path

$PulseVersion = '6.3.1'
$PulseInstallationZip = "$ScriptDir\Pulse.zip"
if( $env:PULSE_ENVIRONMENT -eq "DEV") {# IF DEV, use License-nonprod.xml else use License-prod.xml {
  $PulseLicenseFile = "$ScriptDir\License-nonprod.xml"
} else {
  $PulseLicenseFile = "$ScriptDir\License-prod.xml"
}
# $PulseFolder          = "$env:ProgramFiles\Pulse for TM1"
$PulseFolder = "D:\TSP\Pulse for TM1"
$ElasticJVMMax        = 20000
$JvmMx                = 90000
$ElasticHosts         = '[http://localhost:8097]'
$ElasticVersion       = '7.0.1'
$KibanaVersion        = '7.0.1'

# PULSE
New-Item -Path "$PulseFolder" -ItemType Directory -Force
Expand-Archive -Path "$PulseInstallationZip" -DestinationPath "$PulseFolder\" -Force

Copy-Item "$PulseFolder\`$WINDIR\System32\NTEventLogAppender.amd64.dll" "$env:WinDir\System32\"
Remove-Item "$PulseFolder\`$WINDIR" -Recurse -Force
Remove-Item "$PulseFolder\`$PLUGINSDIR" -Recurse -Force

New-Item -Path "$PulseFolder\temp" -ItemType Directory -Force
New-Item -Path 'HKLM:\SOFTWARE\' -Name 'Pulse for TM1' -Force
New-ItemProperty -Path 'HKLM:\SOFTWARE\Pulse for TM1' -Name 'Path' -Value "$PulseFolder" -PropertyType STRING -Force
New-ItemProperty -Path 'HKLM:\SOFTWARE\Pulse for TM1' -Name 'StartupMenuGroup' -Value 'Pulse for TM1' -PropertyType STRING -Force
New-ItemProperty -Path 'HKLM:\SOFTWARE\Pulse for TM1' -Name 'ElasticJVMMax' -Value $ElasticJVMMax -PropertyType DWORD -Force
New-ItemProperty -Path 'HKLM:\SOFTWARE\Pulse for TM1' -Name 'JvmMx' -Value $JvmMx -PropertyType DWORD -Force
New-Item -Path 'HKLM:\SOFTWARE\Pulse for TM1' -Name 'Components' -Force
New-ItemProperty -Path 'HKLM:\SOFTWARE\Pulse for TM1\Components' -Name 'Server' -Value '1' -PropertyType STRING -Force

& "$PulseFolder\bin\monitor.exe" -install -serviceversion="$PulseVersion"
New-ItemProperty -Path 'HKLM:\SOFTWARE\Pulse for TM1\Components' -Name 'monitor' -Value '1' -PropertyType STRING -Force

& "$PulseFolder\bin\pulseas.exe" //IS//PulseAppServer --DisplayName="Pulse Application Server" --Description="Pulse ($PulseVersion) Application Server" --Startup=auto --StartPath="$PulseFolder" --DependsOn="PulseElasticsearchServer" --JavaHome="$PulseFolder\jre" --StartClass org.apache.catalina.startup.Bootstrap --StopClass org.apache.catalina.startup.Bootstrap --StartParams start --StopParams stop
& "$PulseFolder\bin\pulseas.exe" //US//PulseAppServer --Jvm="$PulseFolder\jre\bin\server\jvm.dll" --Classpath="$PulseFolder\bin\bootstrap.jar;$PulseFolder\bin\tomcat-juli.jar;$PulseFolder\bin\tomcat-juli.jar"
& "$PulseFolder\bin\pulseas.exe" //US//PulseAppServer --JvmOptions "-Dcatalina.base=$PulseFolder;-Dcatalina.home=$PulseFolder;-Djava.endorsed.dirs=$PulseFolder\endorsed;-Dfile.encoding=UTF8" --StartMode jvm --StopMode jvm --JvmMs 256 --JvmMx $JvmMx
& "$PulseFolder\bin\pulseas.exe" //US//PulseAppServer ++JvmOptions "-Djava.io.tmpdir=$PulseFolder\bin\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=$PulseFolder\bin\conf\logging.properties;-XX:+UseG1GC;-XX:+UseStringDeduplication;"

# ELASTICSEARCH
New-Item -Path "$PulseFolder\temp\elastic" -ItemType Directory -Force

& "$PulseFolder\bin\7za.exe" x "$PulseFolder\utils\elasticsearch_701.log4j.2.19.zip" -aoa -o"$PulseFolder\elastic"
& "$PulseFolder\bin\elastic-tools.exe" -deployJVMOptions=true -cfgPath="$PulseFolder\conf\elastic"

Add-Content -Path "$PulseFolder\conf\elastic\elasticsearch.yml" -Value ""
Add-Content -Path "$PulseFolder\conf\elastic\elasticsearch.yml" -Value "path.data: $PulseFolder\db\_explorer\elastic"
Add-Content -Path "$PulseFolder\conf\elastic\elasticsearch.yml" -Value "path.logs: $PulseFolder\logs\elastic"

# elasticInstaller.bat
$env:JAVA_HOME            = "$PulseFolder\jre"
$env:ES_PATH_CONF         = "$PulseFolder\conf\elastic"
$env:SERVICE_ID           = 'PulseElasticsearchServer'
$env:SERVICE_LOG_DIR      = "$PulseFolder\logs\elastic"
$env:ES_PATH_CONF         = "$PulseFolder\conf\elastic"
$env:ES_START_TYPE        = 'auto'
$env:ES_STOP_TIMEOUT      = 600
$env:SERVICE_DISPLAY_NAME = 'Pulse Elasticsearch'
$env:SERVICE_DESCRIPTION  = "Pulse ($PulseVersion) Elasticsearch ($ElasticVersion)"
& "$PulseFolder\elastic\bin\pulse-elastic-service.bat" install
& "$PulseFolder\bin\elastic-tools.exe" -updateJVMOptions=true -esServiceName='PulseElasticsearchServer' -esTempPath="$PulseFolder\temp\elastic" -esGCPath="$PulseFolder\logs\elastic\gc.log"

New-ItemProperty -Path 'HKLM:\SOFTWARE\Pulse for TM1\Components' -Name 'PulseExplorer' -Value '1' -PropertyType STRING -Force

# KIBANA
& "$PulseFolder\bin\7za.exe" x "$PulseFolder\utils\kibana_701.zip" -aoa -o"$PulseFolder\kibana"

Set-Content -Path "$PulseFolder\bin\kibanaInstaller.bat" -Value "cd ""$PulseFolder\kibana\bin"""
Add-Content -Path "$PulseFolder\bin\kibanaInstaller.bat" -Value """$PulseFolder\kibana\bin\kibana.bat"" --config ""$PulseFolder\conf\kibana\kibana.yml""" 

New-Service -Name 'PulseKibana' -BinaryPathName """$PulseFolder\bin\pulse-kibana-service.exe""" -DisplayName 'Pulse Kibana' -Description "Pulse ($PulseVersion) Kibana ($KibanaVersion)" -StartupType 'Automatic' -DependsOn 'PulseAppServer'
New-Item -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\PulseKibana' -Name 'Parameters' -Force
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\PulseKibana\Parameters' -Name 'AppDirectory' -Value "$PulseFolder\kibana\bin" -PropertyType STRING -Force
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\PulseKibana\Parameters' -Name 'Application' -Value "$PulseFolder\bin\kibanaInstaller.bat" -PropertyType STRING -Force

& "$PulseFolder\bin\elastic-tools.exe" -moveLegacyExplorerDB=true -pulseInstallationPath="$PulseFolder"

Add-Content -Path "$PulseFolder\conf\kibana\kibana.yml" -Value "elasticsearch.hosts: $ElasticHosts"
Add-Content -Path "$PulseFolder\conf\kibana\kibana.yml" -Value "path.data: $PulseFolder\db\_explorer\kibana"
Add-Content -Path "$PulseFolder\conf\kibana\kibana.yml" -Value "logging.dest: $PulseFolder\logs\kibana.log"

# Set services to Automatic startup
Set-Service PulseMonitor             -StartupType Automatic
Set-Service PulseElasticsearchServer -StartupType Automatic
Set-Service PulseKibana              -StartupType Automatic
Set-Service PulseAppServer           -StartupType Automatic

New-NetFirewallRule -DisplayName "Allow Pulse" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 8093,8099

# copy License.xml file to "$PulseFolder\conf\License.xml" before starting services
If(Test-Path -Path "$PulseLicenseFile")
{
  Copy-Item "$PulseLicenseFile" "$PulseFolder\conf\License.xml" 
}

# Start the services (note that the ordering is important here)
Start-Service PulseElasticsearchServer
Start-Service PulseAppServer
Start-Service PulseKibana
Start-Service PulseMonitor

Hi @zachary.allin,

For the moment, we are looking into having an uninstaller via the PS. We are also testing on the silent installation option of Pulse - though it is an all or nothing install. Through that, uninstallation can be silently done as well.

Let us update this post once we have a working PS for uninstallation.

Cheers,

Paul

Hi @plim, any idea of a rough delivery date? A working silent installer is a blocker for us to update.

Hi @zachary.allin,

It is still in the middle of testing but is so far working alright. Would you mind creating a ticket for this? We can discuss further in there at this phase of the silent installer option.

Cheers,

Paul