SCRIPT | Install-RoyalTSX-5.0.6.1000

Install Royal TSX

Summary

This script will install the version 5.0.6.1000 of Royal TSX.

Although the script installs a static version of Royal TSX (in this case 5.0.6.1000), the script can easily be modified for new versions as they become available simply be editing the version number in the variables for the “dmgname” and the “dmglink“.


Script Content

#!/bin/zsh
cd "/Library/Application Support/JAMF/tmp"

# Update variables
dmgname="royaltsx_5.0.6.1000.dmg"
dmglink="https://royaltsx-v5.royalapps.com/updates/royaltsx_5.0.6.1000.dmg"
dmgmountedname="Royal TSX"
apptoreplace="Royal TSX.app"
apptoreplacerunningname="RoyalTSX"

# Download DMG
curl -L -O "$dmglink"

# Convert DMG to CDR to bypass EULA and mount DMG 
hdiutil convert $dmgname -format UDTO -o $dmgname.cdr
hdiutil mount -nobrowse $dmgname.cdr

# Kill the app if it is running
killall -Kill "$apptoreplacerunningname"

# Remove the app from the Applications Folder
rm -rf "/Applications/$apptoreplace"

# Copy the new version into the Applications Folder
cp -R "/Volumes/$dmgmountedname/$apptoreplace" /Applications

# Set the user as the current logged in user
netname=`ls -l /dev/console | cut -d " " -f 4`

chown -R ${netname}:Staff "/Applications/$apptoreplace"

sudo xattr -rc "/Applications/$apptoreplace/"

# Unmount the DMG
hdiutil unmount "/Volumes/$dmgmountedname"

# Remove the downloaded DMG
rm $dmgname
rm $dmgname.cdr

# Clear out the used variables
unset dmgname
unset dmglink
unset dmgmountedname
unset apptoreplace
unset apptoreplacerunningname
unset netname
exit 0

Concluding Comments

Royal TS is the only true cross-platform remote management solution available for Windows, macOS, iOS and Android. Documents created with Royal TS can be opened on all the supported platforms.