OTG Install Script - PowerShell - Windows
Notes:
This script can be used for general use, and is best used in single application scenarios:
- The PowerShell script below will download the OTG install file (setup.msi) and save it to the directory where the PowerShell script is created.
- Once downloaded, it will prompt for the OTG install key for the client's session.
- It will then prompt for the location of the WebTitan Cloud instance, this can found in the URL they use to log into the platform with. Ex: usa1, usa2, usa3, uk1, eu1, ca1...
- If there are any errors with the prompted entries, you can re-run the script without requiring it to re-download the setup.msi file.
- Once confirmed, the script will install the OTG agent software!
Installation instructions:
1. To convert this to a PowerShell script, take the text from the bottom of this document and add this to a Notepad document. See the below image for an example:
2. Save the Notepad file with your preferred name and append .ps1 to the end of it, and select save.
3. Right click the file, and "Run with PowerShell"
OTG installation script variations:
Option 1: -- This prompts for both the location and install key. **This is great for a general use script since it will prompt for both the location and install key, this would not be specific to any customer or location**
# Set ProgressPreference to SilentlyContinue
$ProgressPreference = 'SilentlyContinue'
# Message indicating the download process
Write-Host "Downloading OTG install package..."
# Set the URL and the output filename
$URL = "https://wtcdownload.titanhq.com/otg2/setup.msi"
$OUTPUT_FILENAME = "setup.msi"
# Check if the file already exists
if (-not (Test-Path -Path $OUTPUT_FILENAME)) {
# Download the file using Invoke-WebRequest
Invoke-WebRequest -Uri $URL -OutFile $OUTPUT_FILENAME
Write-Host "The OTG package has been downloaded!"
} else {
Write-Host "The OTG package already exists!"
}
# Prompt for installation key and WTC location
$installKey = Read-Host "Enter the Install Key"
$location = Read-Host "Enter your WTC location: For reference see the URL used to access your WTC account -- (usa1, usa2, usa3, eu1, uk1, ca1)"
$locationWithApi = $location + "-api"
# Append msiexec command to run the OTG installer
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i `"$OUTPUT_FILENAME`" /qn /passive /L* installer_log.log PREFER_MASTER_CONFIG=true RPC_URL=https://$locationWithApi.webtitancloud.com:7771 INSTALL_KEY=$installKey" -Wait
Write-Host "The OTG Agent has been successfully installed!"
Option 2: -- This prompts only for the installation key and assumes the location: **This is great for an MSP, since the location will be static and the only thing that would change is the install key.**
This will assume usa1, see the lower lines in the script to adjust to another location this version is a cleaner install but would be conditional based on the client you are working with.
# Set ProgressPreference to SilentlyContinue
$ProgressPreference = 'SilentlyContinue'
# Message indicating the download process
Write-Host "Downloading OTG install package..."
# Set the URL and the output filename
$URL = "https://wtcdownload.titanhq.com/otg2/setup.msi"
$OUTPUT_FILENAME = "setup.msi"
# Check if the file already exists
if (-not (Test-Path -Path $OUTPUT_FILENAME)) {
# Download the file using Invoke-WebRequest
Invoke-WebRequest -Uri $URL -OutFile $OUTPUT_FILENAME
Write-Host "The OTG package has been downloaded!"
} else {
Write-Host "The OTG package already exists!"
}
# Prompt for installation key and WTC location
$installKey = Read-Host "Enter the Install Key"
# Append msiexec command to run the OTG installer
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i `"$OUTPUT_FILENAME`" /qn /passive /L* installer_log.log PREFER_MASTER_CONFIG=true RPC_URL=https://usa1-api.webtitancloud.com:7771 INSTALL_KEY=$installKey" -Wait
Write-Host "The OTG Agent has been successfully installed!"
Option 3: -- This will not prompt for either the install key or location but will need to be pre-configured for/with the client: **This would be best used in an onboarding scenario, we would know the location and can add that automatically into the script. If they are an end user we can pull the install key. If they are an MSP we would need them to create the client, and share the install key. The script will run, and prompt for no additional information.**
This will assume usa1, see the lower lines in the script to adjust to another location. This will also assume the installation key based on what is pre-configured in the script. Please replace xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx in the 2nd to last line in the script with the installation key from the client's instance.
# Set ProgressPreference to SilentlyContinue
$ProgressPreference = 'SilentlyContinue'
# Message indicating the download process
Write-Host "Downloading OTG install package..."
# Set the URL and the output filename
$URL = "https://wtcdownload.titanhq.com/otg2/setup.msi"
$OUTPUT_FILENAME = "setup.msi"
# Check if the file already exists
if (-not (Test-Path -Path $OUTPUT_FILENAME)) {
# Download the file using Invoke-WebRequest
Invoke-WebRequest -Uri $URL -OutFile $OUTPUT_FILENAME
Write-Host "The OTG package has been downloaded!"
} else {
Write-Host "The OTG package already exists!"
}
# Append msiexec command to run the OTG installer
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i `"$OUTPUT_FILENAME`" /qn /passive /L* installer_log.log PREFER_MASTER_CONFIG=true RPC_URL=https://usa1-api.webtitancloud.com:7771 INSTALL_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Wait
Write-Host "The OTG Agent has been successfully installed!"
Change Log:
10/12/2023 - Added the following to the beginning of the script, this has improved download speeds of the setup.msi file by removing the progress bar.
# Set ProgressPreference to SilentlyContinue
$ProgressPreference = 'SilentlyContinue'