Recently I was informed that Blackmagic Design is using AppImage to distribute Fusion for Linux. So I had a look, and what I found is rather surprising. They hide the fact that they are using AppImage (using .run
rather than .AppImage
as an extension), and they do not make use of it advantages because they a) encapsulate it in an archive, making unarchiving necessary, and b) run an installer. So they throw away two advantages of AppImages: a) that they do not need to be unpacked, and b) that they do not need to be installed.
What the heck?!
I am doing this analyis on Ubuntu 16.04.
sudo mount Blackmagic_Fusion_8.2_installer.run /mnt/ -o loop
AppRun looks rather interesting:
#!/bin/sh
CURRENT_DIR=`dirname $0`
# INSTALLER_SCRIPT=$CURRENT_DIR/installer.sh
export PATH=$PATH:$CURRENT_DIR/
export FUSION_PLUGIN_PATH=$CURRENT_DIR/Frameworks
$CURRENT_DIR/FusionInstaller $CURRENT_DIR $@
# Launch the try-out
if [ $? == 77 ]; then
unset QT_PLUGIN_PATH
$CURRENT_DIR/Fusion
fi
Why on earth would one produce an AppImage that runs an installer, to only run the application after the installer has ran?
One of the great points is that AppImage allows upstream software authors to distribute software without the need for installation.
This is even more strange as a perfectly valid installed version seems to be inside the AppImage, that can even be started directly:
/mnt/Fusion
However, it is not bundled with everything the software needs to run that cannot be assumed to be part of each base system:
fuscript: error while loading shared libraries: libedit.so.0: cannot open shared object file: No such file or directory
An AppImage should always bundle everything that the software needs to run that cannot be assumed to be part of each base system, in this case, libedit2.
Luckily, the AppImage can be fixed rather easily:
# Unpack existing AppImage
mkdir Fusion/
cd Fusion/
sudo mount ../Blackmagic_Fusion_8.2_installer.run /mnt/ -o loop
cp -r /mnt Fusion.AppDir
# Bundle missing library
wget -c "http://ftp.us.debian.org/debian/pool/main/libe/libedit/libedit2_2.11-20080614-5_amd64.deb"
dpkg -x *deb .
cp usr/lib/x86_64-linux-gnu/libedit.so.2 Fusion.AppDir/libedit.so.0
# Fix AppRun
cat > "Fusion.AppDir/AppRun" <<\EOF
#!/bin/sh
CURRENT_DIR="$(dirname "$(readlink -f "${0}")")"
export PATH=$PATH:$CURRENT_DIR/
export FUSION_PLUGIN_PATH=$CURRENT_DIR/Frameworks
unset QT_PLUGIN_PATH
cd $CURRENT_DIR
"$CURRENT_DIR/Fusion" $@
EOF
# Delete unneccessary installer
rm ./Fusion.AppDir/FusionInstaller
# Fix desktop file (no /opt needed in our case!)
sed -i -e 's|/opt/Fusion/||g' Fusion.AppDir/Fusion.desktop
# Generate fixed AppImage and name it according to the spec
VERSION=8.2
ARCH=$(arch)
APP=Fusion
wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
. ./functions.sh
generate_appimage
mv ../out/Fusion-8.2-x86_64.AppImage ../out/Blackmagic_Fusion-8.2-x86_64.AppImage
# Test run
../out/Blackmagic_Fusion-8.2-x86_64.AppImage
Ready to be uploaded. Please not not put it inside an archive!
The upstream developers might want to:
- Integrate with the desktop by installing the desktop file upon the first application launch. Have a look at the desktopintegration script (which cannot be used 1:1 unchanged here since it assumes a certain directory structure to be present in usr/ inside the AppImage which is not the case here)
- Use AppImageUpdate and include update information in the AppImage to make binary delta updates trivially eays
I'm having some issues. After executing the bash; I'm getting the following error. As soon it is starting with the .appimage generation:
Icon could not be found based on information in desktop file, aborting mv: cannot stat ‘../out/Fusion-8.2-x86_64.AppImage’: No such file or directory ./fusionappimage.sh: 49: ./fusionappimage.sh: ../out/Blackmagic_Fusion-8.2-x86_64.AppImage: not found
Edit: I've created the File "Fusion-8.2-x86_64.AppImage" with the script you shared.
But instead of generating the file "Blackmagic_Fusion-8.2-x86_64.AppImage" it gets deleted.
Do you see what I'm missing out here? Thanks.