Skip to main content

Has anyone taken a look at Aspera Connect 3.5.2.x? Owned by IBM, and until today not listed under Third-Party Products, it is distributed as an .app installer, with the requisite PKG icon, probably a hint that IBM thinks we won't notice. It has a 501 line .script (AppleScript) intrusive script embedded in it. It has an embedded flat *.mpkg installer, that has embedded scripts with such lovely syntax as:



Apparently the person writing the preflight script doesn't believe in close quotes...



if [ $is_admin = "yes" ] ; then
echo removing system wide apps
rm -rf /Applications/Aspera Connect.app
rm -rf /Applications/Aspera Crypt.app
echo removing system wide plugin
rm -rf /Library/Internet Plug-Ins/Aspera Web.plugin
rm -rf /Library/Internet Plug-Ins/Aspera Web.webplugin
# this is for versioned plugin dirs
rm -rf /Library/Internet Plug-Ins/Aspera Web*
fi

echo removing local user plugin
rm -rf ~/Library/Internet Plug-Ins/Aspera Web.plugin
rm -rf ~/Library/Internet Plug-Ins/Aspera Web.webplugin
rm -rf ~/Library/Internet Plug-Ins/Aspera Web*

echo exiting preflight


The postflight littered with copy/pasted blocks of unquoted commands like...



    rmdir "$source_dir/Library/Internet Plug-Ins" || echo $target_dir/Library/Internet Plug-Ins not empty
rmdir "$source_dir/Library" || echo $target_dir/Library not empty


(believe it, the snippet is unedited...the required quotes did not disappear into the ether)



I'm writing this a second time, since IBM's Aspera Connect developers felt it was OK to force my browsers to close.

Arranged for a remote session with Aspera's dev team to discuss their PKG, and the hidden cost of Mac admins having to re-engineer their software to deploy. Will post more info after the call.


Different kind of products, but it's a race between Aspera and [BlueJeans](shttps://jamfnation.jamfsoftware.com/discussion.html?id=17624#responseChild123654)...who can redesign their PKG to align with Apple guidelines first... :)


OMG took a close look at the pre/post scripts in their new version 3.6.6.119698 PKG and...well...



preinstall



loving the tildes...really...they're cute...if not stupid.



#!/bin/sh -x
#
# preflight
#
# runs immediately after user clicks "Install" but before the actual installer
#
# ============================================================================= #

# comment out to debug
set -v off

# check for admin priveleges

echo starting preflight

# try to handle exceptions and exit cleanly
trap "echo caught exception!; exit 0" SIGINT SIGTERM

# grep returns 0 if it finds a match. 1 if no match
/usr/sbin/dseditgroup -o checkmember admin | grep yes > /dev/null
if [ $? -ne 0 ]; then
is_admin="no"
echo user is not an admin
else
is_admin="yes"
echo user is an admin
fi

connect_support_dir="$HOME/Library/Application Support/Aspera/Aspera Connect"
path_file="$connect_support_dir/etc/asperaconnect.path"
# remove local user install bits (even if they are running) to prevent
# the web installer from relaunching an outdated connect
if [ -f "$path_file" ]; then
echo found path file
connect_path=`cat "$path_file"`

# this causes the installer to fail...?
#echo killing crypt
#echo looking for connect and crypt processes
#ps -Ax | grep -i asperacrypt | sed /grep/d | awk '{ print $1 }' | xargs kill -9
#echo killing connect
#ps -Ax | grep -i asperaconnect | sed /grep/d | awk '{ print $1 }' | xargs kill -9

if [ -d "$connect_path/Aspera Connect.app" ]; then
echo removing "$connect_path/Aspera Connect.app"
rm -rf "$connect_path/Aspera Connect.app"
fi
if [ -d "$connect_path/Aspera Crypt.app" ]; then
echo removing "$connect_path/Aspera Crypt.app"
rm -rf "$connect_path/Aspera Crypt.app"
fi
echo removing $connect_support_dir
rm -rf "$connect_support_dir"
fi

if [ $is_admin = "yes" ] ; then
echo removing system wide apps
rm -rf /Applications/Aspera Connect.app
rm -rf /Applications/Aspera Crypt.app
echo removing system wide plugin
rm -rf /Library/Internet Plug-Ins/Aspera Web.plugin
rm -rf /Library/Internet Plug-Ins/Aspera Web.webplugin
# this is for versioned plugin dirs
rm -rf /Library/Internet Plug-Ins/Aspera Web*
fi

echo removing local user plugin
rm -rf ~/Library/Internet Plug-Ins/Aspera Web.plugin
rm -rf ~/Library/Internet Plug-Ins/Aspera Web.webplugin
rm -rf ~/Library/Internet Plug-Ins/Aspera Web*

echo exiting preflight


postinstall



I guess they didn't get the notice re lack of postflight in flag PKGs. Loving how they decided to circe back AFTER the install to remove OLD versions of their stuff. #facepalm



#!/bin/sh -x

echo IN POSTFLIGHT

env | sort

user=`whoami`
echo "User : $user"

echo postflight.non_legacy

target_dir="$2"
source_dir="$target_dir"

os_ver=`sw_vers -productVersion | grep 10.7`
current_user=`whoami`
# If the installer has elevated to root, then set user back to the user who launched the installer
if [ -e "/tmp/au9jlassscJLHCkhsf2398fsfHBHUD" -a "$current_user" = "root" ]; then
set_user=`cat /tmp/au9jlassscJLHCkhsf2398fsfHBHUD`
rm -rf /tmp/au9jlassscJLHCkhsf2398fsfHBHUD
else
set_user="$current_user"
fi
primary_group='staff'
admin_user='root'
admin_group='admin'

webplugin_path="/Library/Internet Plug-Ins/Aspera Web.webplugin"
webplugin_homefolder_path="$HOME/Library/Internet Plug-Ins/Aspera Web.webplugin"

# Check if the user is an admin
# If is_admin is "" = admin
# If is_admin is "no <user> is NOT a member of admin" = not admin
is_admin=`dseditgroup -o checkmember admin | grep NOT | grep no`

# Define location of current installation
app_install_location="/Applications"
plugin_install_location="/Library/Internet Plug-Ins"
home_app_install_location=`cat "$HOME/Library/Application Support/Aspera/Aspera Connect/etc/asperaconnect.path"`
home_plugin_install_location="$HOME/Library/Internet Plug-Ins"

# Exit if user is not root or Scp is installed
if [ `whoami` != "root" -o
-e "/Applications/Aspera Scp.app" -o
-e "/Applications/Aspera Enterprise Server.app" -o
-e "/Applications/Aspera Client.app" -o
-e "/Applications/Aspera Point to Point.app" ]; then
echo "Skipping uninstall - User is not root, or shared files exist."
else
echo "Uninstalling previous installation of Connect."

rm -rf /Library/Aspera
rm -rf "/Library/Application Support/Aspera"
rm -rf /Library/StartupItems/FaspBuffers
if [ -f /usr/bin/scp.aspera ]; then
rm -f /usr/bin/scp.aspera
fi
if [ -f /usr/bin/ssh.aspera ]; then
rm -f /usr/bin/ssh.aspera
fi
fi


# Exit if not installing to the default location
if [ "$target_dir" = "/" ]; then
echo "installing to /"
# we only deliver QT packages with Connect to reduce dmg size. Copy them to Crypt
cp -R /Applications/Aspera Connect.app/Contents/Frameworks /Applications/Aspera Crypt.app/Contents/Frameworks
chmod -R ug+rw /Applications/Aspera Crypt.app/Contents/Frameworks

cp -R /Applications/Aspera Connect.app/Contents/PlugIns /Applications/Aspera Crypt.app/Contents/PlugIns
chmod -R ug+rw /Applications/Aspera Crypt.app/Contents/PlugIns

cp -R /Applications/Aspera Connect.app/Contents/Resources/qt.conf /Applications/Aspera Crypt.app/Contents/Resources/qt.conf
chmod -R ug+rw /Applications/Aspera Crypt.app/Contents/Resources/qt.conf
# Put the uninstaller the someplace usable
mkdir -p /Library/Application Support/Aspera/Aspera Connect
chmod -R ug+rw /Library/Application Support/Aspera/Aspera Connect
mv /Applications/Aspera Connect.app/uninstall_connect.sh /Library/Application Support/Aspera/Aspera Connect

chown -R root:admin /Applications/Aspera Connect.app
chown -R root:admin /Applications/Aspera Crypt.app
chown -R root:admin /Library/Application Support/Aspera/Aspera Connect
chown -R root:admin "/Library/Internet Plug-Ins/Aspera Web 3.2.0.71890-x-30.plugin"

# This occurs if running on Lion or privileges has been escalated to root
if [ "$os_ver" != "" -o "$current_user" = "root" ]; then

# Clean up plugins in the user's home folder when doing an installation into /Library and /Applications
if [ -d "$HOME/Library/Internet Plug-Ins/Aspera Web*.plugin" ]; then
find "$HOME/Library/Internet Plug-Ins" -name "Aspera Web*.plugin" -type d -exec bash -c 'chown -R "$set_user":$primary_group "$0"' {} ;
find "$HOME/Library/Internet Plug-Ins" -name "Aspera Web*.plugin" -type d -exec bash -c 'rm -rf "$0"' {} ;
fi

if [ -d "$HOME/Library/Internet Plug-Ins/Aspera Web.webplugin" ]; then
chown -R "$set_user":$primary_group "$HOME/Library/Internet Plug-Ins/Aspera Web.webplugin"
rm -rf "$HOME/Library/Internet Plug-Ins/Aspera Web.webplugin"
fi

fi

# Remove files from ~/Library and ~/Applications for upgrade
if [ -e "$HOME/Library/Internet Plug-Ins/Aspera Web.plugin" ]; then
rm -rf "$HOME/Library/Internet Plug-Ins/Aspera Web.plugin"
fi
if [ -e "$HOME/Library/Internet Plug-Ins/Aspera Web.webplugin" ]; then
rm -rf "$HOME/Library/Internet Plug-Ins/Aspera Web.webplugin"
fi
if [ -e "$HOME/Applications/Aspera Connect.app" ]; then
rm -rf "$HOME/Applications/Aspera Connect.app"
fi
if [ -e "$HOME/Applications/Aspera Crypt.app" ]; then
rm -rf "$HOME/Applications/Aspera Crypt.app"
fi
# only remove ~/Applications if it's empty
if [ -e "$HOME/Applications" ]; then
if [ ! "$(ls -A $HOME/Applications)" ]; then
rm -rf "$HOME/Applications"
fi
fi
if [ -e "$HOME/Aspera Connect.app" ]; then
rm -rf "$HOME/Aspera Connect.app"
fi
if [ -e "$HOME/Library/Application Support/Aspera Connect.app" ]; then
rm -rf "$HOME/Library/Application Support/Aspera Connect.app"
fi
if [ -e "$home_app_install_location/Aspera Connect.app" ]; then
rm -rf "$home_app_install_location/Aspera Connect.app"
fi
if [ -e "$HOME/Library/Application Support/Aspera/Aspera Connect" ]; then
rm -rf "$HOME/Library/Application Support/Aspera/Aspera Connect"
fi
# remove the parent Aspera directory only if it's empty
if [ -e "$HOME/Library/Application Support/Aspera" ]; then
if [ "$(ls -A $HOME/Library/Application Support/Aspera)" ]; then
echo "Leaving $HOME/Library/Application Support/Aspera since it's not empty"
else
rm -rf "$HOME/Library/Application Support/Aspera"
fi
fi

# Delete web plugin since it's not used in the non-legacy installation
if [ "$is_admin" = "" ]; then
# If admin, then delete the following files
if [ -e "$webplugin_path" ]; then
rm -rf "$webplugin_path"
fi
else
# If not admin, then delete the following files
if [ -e "$webplugin_homefolder_path" ]; then
rm -rf "$webplugin_homefolder_path"
fi
fi

# register protocol handler
echo "registering protocol handler for system install"
/Applications/Aspera Connect.app/Contents/MacOS/asperaconnect --register-protocol-system

# launch connect
open /Applications/Aspera Connect.app

# initially we run connect as root but HOME is set to user who ran installer
if [ ! -d "$HOME/Library/Logs/Aspera" ]; then
mkdir -p "$HOME/Library/Logs/Aspera"
fi
chmod ug+w "$HOME/Library/Logs/Aspera"
chown -R "$USER":$primary_group "$HOME/Library/Logs/Aspera"

exit 0
fi

# If we got here, we have a custom location

# The packager installs the plugins under the custom location
# in directories called Library and Applications.
# We don't want that so we are moving the plug-ins and the
# application to their final locations.

# Silent installs set target dir to $HOME

# This is a special case for non-admin installations where the user selects their
# home directory as the installation location.
if [ "$target_dir" = "$HOME/Library/Application Support" ]; then
target_dir="$HOME"

rm -rf "$HOME/Library/Internet Plug-Ins/Aspera Web.plugin"
rm -rf "$HOME/Library/Internet Plug-Ins/Aspera Web.webplugin"
mkdir -p -v "$HOME/Library/Internet Plug-Ins/Aspera Web.plugin"
mv "$source_dir/Library/Internet Plug-Ins/Aspera Web.plugin" "$HOME/Library/Internet Plug-Ins"
mv "$source_dir/Library/Internet Plug-Ins/Aspera Web.webplugin" "$HOME/Library/Internet Plug-Ins"
rmdir "$source_dir/Library/Internet Plug-Ins" || echo $target_dir/Library/Internet Plug-Ins not empty
rmdir "$source_dir/Library" || echo $target_dir/Library not empty

fi
echo "INFO: target_dir=$target_dir"
echo "INFO: source_dir=$source_dir"


# Install plugins
if [ "$target_dir" != "$HOME" ]; then
echo "installing to $target_dir"

# On Lion only
if [ "$os_ver" != "" -a "$current_user" = "root" ]; then

echo "$set_user":$primary_group "$source_dir/Library/Internet Plug-Ins/Aspera Web.plugin"
if [ -e "$source_dir/Library/Internet Plug-Ins/Aspera Web.webplugin" ]; then
chown -R "$set_user":$primary_group "$source_dir/Library/Internet Plug-Ins/Aspera Web.webplugin"
fi
find "$source_dir" -name "Aspera Web*.plugin" -type d -exec bash -c 'chown -R "$set_user":$primary_group "$0"' {} ;
chown -R "$set_user":$primary_group "$source_dir/Applications/Aspera Connect.app"
chown -R "$set_user":$primary_group "$source_dir/Applications/Aspera Crypt.app"
fi

rm -rf "$HOME/Library/Internet Plug-Ins/Aspera Web.plugin"
rm -rf "$HOME/Library/Internet Plug-Ins/Aspera Web.webplugin"
mv "$source_dir/Library/Internet Plug-Ins/Aspera Web.plugin" "$HOME/Library/Internet Plug-Ins"
mv "$source_dir/Library/Internet Plug-Ins/Aspera Web.webplugin" "$HOME/Library/Internet Plug-Ins"
rmdir "$source_dir/Library/Internet Plug-Ins" || echo $target_dir/Library/Internet Plug-Ins not empty
rmdir "$source_dir/Library" || echo $target_dir/Library not empty
fi

# Delete Aspera Web.webplugin from the user's home folder during installation/upgrade
# This code is only specific to postflight.non_legacy
if [ "$target_dir" = "$HOME" ]; then
echo "installing to $HOME"

# Remove old plugin if it exists
if [ -e /tmp/aoficnsoff8oaonfaefvnff83a7UIHN ]; then
echo "/tmp/aoficnsoff8oaonfaefvnff83a7UIHN exists"
find "/Library/Internet Plug-Ins" -name "Aspera Web*" -exec /tmp/aoficnsoff8oaonfaefvnff83a7UIHN -rf {} 2>/dev/null ;
fi

# Remove the old webkit plugin if it exists
if [ -e "$HOME/Library/Internet Plug-Ins/Aspera Web.webplugin" ]; then
rm -rf "$HOME/Library/Internet Plug-Ins/Aspera Web.webplugin"
fi

# Remove app and plugin files from /Applications and /Library if user is an admin
if [ "$is_admin" = "" ]; then
# Remove files from /Library and /Applications for upgrade
if [ -e "/Library/Internet Plug-Ins/Aspera Web.plugin" ]; then
if [ -e "/tmp/aoficnsoff8oaonfaefvnff83a7UIHN" ]; then
/tmp/aoficnsoff8oaonfaefvnff83a7UIHN -rf "/Library/Internet Plug-Ins/Aspera Web.plugin"
else
rm -rf "/Library/Internet Plug-Ins/Aspera Web.plugin"
fi
fi
if [ -e "/Library/Internet Plug-Ins/Aspera Web.webplugin" ]; then
if [ -e "/tmp/aoficnsoff8oaonfaefvnff83a7UIHN" ]; then
/tmp/aoficnsoff8oaonfaefvnff83a7UIHN -rf "/Library/Internet Plug-Ins/Aspera Web.webplugin"
else
rm -rf "/Library/Internet Plug-Ins/Aspera Web.webplugin"
fi
fi
if [ -e "/Applications/Aspera Connect.app" ]; then
if [ -e "/tmp/aoficnsoff8oaonfaefvnff83a7UIHN" ]; then
/tmp/aoficnsoff8oaonfaefvnff83a7UIHN -rf "/Applications/Aspera Connect.app"
else
rm -rf "/Applications/Aspera Connect.app"
fi
fi
if [ -e "/Library/Application Support/Aspera/Aspera Connect" ]; then
if [ -e "/tmp/aoficnsoff8oaonfaefvnff83a7UIHN" ]; then
/tmp/aoficnsoff8oaonfaefvnff83a7UIHN -rf "/Library/Application Support/Aspera/Aspera Connect"
else
rm -rf "/Library/Application Support/Aspera/Aspera Connect"
fi
fi
# Remove Application Support/Aspera if it is empty
if [ ! "$(ls -A /Library/Application Support/Aspera)" ]; then
if [ -e "/tmp/aoficnsoff8oaonfaefvnff83a7UIHN" ]; then
/tmp/aoficnsoff8oaonfaefvnff83a7UIHN -rf "/Library/Application Support/Aspera"
else
rm -rf "/Library/Application Support/Aspera"
fi
fi

fi

# Clean up the app in order to install the latest version
if [ -e "$HOME/Aspera Connect.app" ]; then
rm -rf "$HOME/Aspera Connect.app"
fi
if [ -e "$home_app_install_location/Aspera Connect.app" ]; then
rm -rf "$home_app_install_location/Aspera Connect.app"
fi
if [ -e "/tmp/aoficnsoff8oaonfaefvnff83a7UIHN" ]; then
/tmp/aoficnsoff8oaonfaefvnff83a7UIHN -rf /tmp/aoficnsoff8oaonfaefvnff83a7UIHN
fi
fi

# Install the Connect and Crypt applications
if [ -d "$target_dir/Aspera Connect.app" ]; then
rm -rf "$target_dir/Aspera Connect.app"
fi

if [ -d "$target_dir/Aspera Crypt.app" ]; then
rm -rf "$target_dir/Aspera Crypt.app"
fi

mv "$source_dir/Applications/Aspera Connect.app" "$target_dir/Applications"
mv "$source_dir/Applications/Aspera Crypt.app" "$target_dir/Applications"
# We only deploy QT with Connect. Copy Connect's QT to Crypt
cp -R "$target_dir/Applications/Aspera Connect.app/Contents/Frameworks" "$target_dir/Applications/Aspera Crypt.app/Contents/Frameworks"
cp -R "$target_dir/Applications/Aspera Connect.app/Contents/PlugIns" "$target_dir/Applications/Aspera Crypt.app/Contents/PlugIns"
cp -R "$target_dir/Applications/Aspera Connect.app/Contents/Resources/qt.conf" "$target_dir/Applications/Aspera Crypt.app/Contents/Resources"
rmdir "$source_dir/Applications" || echo $target_dir/Applications not empty

# Create pointer to Aspera Connect.app bundle so plugins can start it
mkdir -p "$HOME/Library/Application Support/Aspera/Aspera Connect/etc"
echo "$target_dir/Applications" > "$HOME/Library/Application Support/Aspera/Aspera Connect/etc/asperaconnect.path"
# Put the uninstaller somewhere usable
mv "$source_dir/Applications/Aspera Connect.app/uninstall_connect.sh" "$HOME/Library/Application Support/Aspera/Aspera Connect/"

# Root only FIXME don't think you need root for this
#if [ "$current_user" = "root" ]; then
chown -R "$set_user":$primary_group "$HOME/Library/Application Support/Aspera"
chmod 775 "$HOME/Applications/Aspera Connect.app"
chmod 775 "$HOME/Applications/Aspera Crypt.app"
chown -R "$set_user":$primary_group "$HOME/Applications/Aspera Connect.app"
chown -R "$set_user":$primary_group "$HOME/Applications/Aspera Crypt.app"
find "$HOME/Library/Internet Plug-Ins" -name "Aspera Web*.plugin" -type d -exec bash -c 'chmod -R 775 "$0"' {} ;
find "$HOME/Library/Internet Plug-Ins" -name "Aspera Web*.plugin" -type d -exec bash -c 'chown -R "$set_user":$primary_group "$0"' {} ;
#fi

# Delete web plugin since it's not used in the non-legacy installation
if [ "$is_admin" = "" ]; then
# If admin, then delete the following files
if [ -e "$webplugin_path" ]; then
rm -rf "$webplugin_path"
fi
else
# If not admin, then delete the following files
if [ -e "$webplugin_homefolder_path" ]; then
rm -rf "$webplugin_homefolder_path"
fi
fi

# register protocol handler
echo "registering protocol handler for user install"
"$target_dir/Applications/Aspera Connect.app/Contents/MacOS/asperaconnect" --register-protocol-user

exit 0

sigh


Two years later and nothing's changed...Pacifist shows...




yeah, they suck at packaging




¯_(ツ)_/¯






I just got an email from Aspera Support, two months after I emailed them to report these endless issues, and they ask:



"Are you having issues with Aspera?" <-- seriously? Wow.



So I sent them a link to this thread. I don't expect them to fix this.



They're squeezing whatever money they can out of this, and not spending money on competent dev staff.


Apparently version 3.8.2 was released. This developer is asking us to confirm it resolves the issue.



Confirmed this morning, though I was cringing along the way, expecting the worst, but pleasantly surprised.



Updated product page.


@donmontalvo miracles do happen....but i'm sure next version will add an new issue :D


Thanks for the product update @H3144-IT looks like IBM finally sent their folks to training...



$ defaults read /Applications/Aspera Connect.app/Contents/Info.plist CFBundleVersion
3.9.1.171801
$ defaults read /Applications/Aspera Connect.app/Contents/Info.plist CFBundleShortVersionString
3.9.1

It is always appreciated to get a positive mention @donmontalvo - seeing that keeping this Section of JamfNation up-to-date makes a Difference!


So, where are people getting the system-wide installer these days? This page stops at 3.9.9 and the links don't work anyways.


@cwaldrip
You can either look into JAMF Nation Third Party Products Link,



where fellow Users try to keep Software Update Links timely up-to-date !



You can Search for Aspera Connect



Alternatively have a look at the IBM File Search



Best regards from London


@H3144-IT , the 3rd party product link only links to the normal installer which is crap isn't the system-side version. Their page for system-wide version hasn't been updated and all the links are broken (https://www.ibm.com/support/pages/how-install-ibm-aspera-connect-system-wide-mac).
The answer to the question though was the IBM File Search! Yay!
So after creating an account (because I just love more spam) and going through a few screens about how they will 'use' my data, I got to the page where I could download a system-wide version of the app. Clear as mud, IBM. :-|


Reply