Old Moho/ASP Linux versions: workarounds for running on Ubuntu 18.04

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
eok
Posts: 19
Joined: Fri Jun 12, 2009 6:34 am
Location: Earth (approximately)

Old Moho/ASP Linux versions: workarounds for running on Ubuntu 18.04

Post by eok »

So, short story long: I've been doing more stuff on Linux for a long while now. Recently, I was reorganizing my software collection & I realized I had some old versions of Moho & ASP. Like the early Linux Moho versions (5.2, 5.4) and the early Linux ASP versions (5.6 and 6.1). Those releases worked on older versions of Ubuntu, but I found they crashed on 64bit Ubuntu 18.04. This always happened when selecting Import... Image from the File drop-down menu of the installed old 5.4-6.1 versions of Moho/ASP. I decided to identify the cause of the crashing & how to get the releases to work.

Yes, yes, these old versions of Moho/ASP are not as slick as 12.5/13 - but they do have enough of a feature set to do good stuff.

I figure there's at least a couple folks that wish their old Linux version of Moho worked on 64bit Ubuntu 18.04. So, here 'ya go.

So the cause of the crashing Ubuntu 18.04 64bit was two-fold: 1) I didn't have adequate 32bit support installed and 2) the Moho/ASP GTK+ code choked on startup due to issues parsing the system icon sets in /usr/share/icons. Both of these were easy enough to fix or workaround via a few changes to the Moho/ASP startup scripts and making sure 32bit support (shared libs) was adequate. I've done some testing and the fixes seem to work fine - but I cannot promise you won't encounter other bugs from running these old releases on 64bit Ubuntu 18.04.

And at this point let me make this clear: I'm just sharing info that may help someone that can help themselves. if you are not comfortable wrangling Linux/Unix /bin/sh scripts then stop reading at this point & move on. I rarely visit this site anymore. So, if you choose to use the stuff that follows then you are truly on your own. I'm not trying to be insensitive - just honest.

The very first step: install your old 5.x Linux version of Moho or old 5.6-6.1 Linux version of ASP on your 64bit Ubuntu system. This generally means you log into your account on the system and simply extract the Moho/ASP installation zip file in your home directory. This will create a moho or AnimeStudioPro dir in your home directory and the dir will contain the installed files.

I'll just list the scripts here as I heavily commented them to explain things. My mods are between the ######## Begin_EOK and ######## End_EOK lines.

Be sure to read the section at the beginning of my script patch about installing libgtk2.0-0:i386 and perform the command described.

---

So, this is the startup script for Moho 5.4. Probably works for any of the older versions of Moho (5.4 or less).

The script name is "moho" and should be placed where the version is installed - in the same dir as where the version's moho.donotrunme and ming.so live.

Before putting this version in place, please copy the original "moho" script to moho.save.
#!/bin/sh

# If you have purchased a copy of Moho, fill in the registration code below.
export MOHO_REGISTRATION=

# Modify the following path to point to a font folder. The default setting points
# to some included fonts in Red Hat 8. You can point to any folder of TrueType or
# Type1 fonts. A big collection of freely-downloadable fonts that work well for
# animation can be found here:
# http://www.chank.com/freefonts.php
export MOHO_FONTS=/usr/X11R6/lib/X11/fonts/Type1

if echo $(dirname $0) | grep '^/.*' > /dev/null; then
MOHO_DIR=$(dirname $0)
else
MOHO_DIR=$(pwd)/$(dirname $0)
fi
MOHO_LOCATION=$MOHO_DIR/moho.donotrunme
export MOHO_LOCATION

######### Begin_EOK
# NOTE: About using old versions of Moho/Animestudio on 64bit versions of Ubuntu...
#
# The old Linux versions of thes apps are 32bit. So, to run on a 64bit system you need to make
# sure proper Ubuntu 32bit support is installed for the apps.
#
# For 64bit Ubuntu 18.04, you will at least have to:
#
# sudo apt-get install --reinstall libgtk2.0-0:i386
#
# That will install libgtk2.0 and will pull in all the other 32bit stuff it requires - which should
# be enough for these apps.
#
#########
#
# Workaround for Ubuntu 18.04 compatability: hide /usr/share/icons from application via changes to startup script
#
#
# Older linux versions of Moho/AnimeStudio (5.4 to 6.1 in my case) can be incompatible on Ubuntu 18.04 installations
# and the apps will crash immediately upon selecting "Import -> Image" from the File menu. The crash has something
# to do with parsing icons in /usr/share/icons during the apps initialization phase of the Import code. Apparently,
# the apps cannot handle some/all of the newer icons. Or: perhaps a bug in the apps on how they use libpng - which
# is called when parsing icons (libpng has had multiple securty updates since the apps were released).
#
# so...
#
# The apps rely on GTK+ for GUI code. XDG_DATA_* env vars set the paths to where GTK+ looks for things like icons.
# Setting them to $MOHO_DIR effectively hides /usr/share/icons from the program. The app will then revert to using
# "default" built-in GTK+ icons - avoiding the crash.
#
# EOK 10/2020
#
#
# Moho's startup script uses "$MOHO_DIR" and AnimeStudio's startup script uses "$ANIME_STUDIO_DIR". So, this
# allows this patch to to work in either version of startup script.
if [ $ANIME_STUDIO_DIR ]; then
MOHO_DIR="$ANIME_STUDIO_DIR"
fi
#
#
# Set the env vars to point GTK at $MOHO_DIR for GTK icons and GTK data.
XDG_DATA_HOME=$MOHO_DIR
XDG_DATA_DIRS=$MOHO_DIR
export XDG_DATA_HOME
export XDG_DATA_DIRS
#
#
######### END_EOK

export LC_ALL=C
export LANG=C
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MOHO_DIR

if [ -e "$MOHO_LOCATION" ]; then
$MOHO_LOCATION $*
else
echo "Please edit the startup script before running Moho."
fi
Also, be sure to make the moho startup script executable via running this command where the file is:
chmod 755 moho

---


And here's the script I use for the older 32bit ASP 5.6 and 6.1 versions...

Same ritual: before putting this version in place, please copy the original "AnimeStudioPro" script to AnimeStudioPro.save.

Similar deal as for the old moho version before, except the script name is AnimeStudioPro and it goes in where the old 5.x/6.x version of ASP is installed - where ASP.donotrunme and ming.so exist.
#!/bin/sh

# If you have purchased a copy of Moho, fill in the registration code below.
export MOHO_REGISTRATION=

# Modify the following path to point to a font folder. The default setting points
# to some included fonts in Red Hat 8. You can point to any folder of TrueType or
# Type1 fonts. A big collection of freely-downloadable fonts that work well for
# animation can be found here:
# http://www.chank.com/freefonts.php
export MOHO_FONTS=/usr/X11R6/lib/X11/fonts/Type1

if echo $(dirname $0) | grep '^/.*' > /dev/null; then
MOHO_DIR=$(dirname $0)
else
MOHO_DIR=$(pwd)/$(dirname $0)
fi
MOHO_LOCATION=$MOHO_DIR/ASP.donotrunme
export MOHO_LOCATION

######### BEGIN_EOK
# NOTE: About using old versions of Moho/Animestudio on 64bit versions of Ubuntu...
#
# The old Linux versions of thes apps are 32bit. So, to run on a 64bit system you need to make
# sure proper Ubuntu 32bit support is installed for the apps.
#
# For 64bit Ubuntu 18.04, you will at least have to:
#
# sudo apt-get install --reinstall libgtk2.0-0:i386
#
# That will install libgtk2.0 and will pull in all the other 32bit stuff it requires - which should
# be enough for these apps.
#
#########
#
# Workaround for Ubuntu 18.04 compatability: hide /usr/share/icons from application via changes to startup script
#
#
# Older linux versions of Moho/AnimeStudio (5.4 to 6.1 in my case) can be incompatible on Ubuntu 18.04 installations
# and the apps will crash immediately upon selecting "Import -> Image" from the File menu. The crash has something
# to do with parsing icons in /usr/share/icons during the apps initialization phase of the Import code. Apparently,
# the apps cannot handle some/all of the newer icons. Or: perhaps a bug in the apps on how they use libpng - which
# is called when parsing icons (libpng has had multiple securty updates since the apps were released).
#
# so...
#
# The apps rely on GTK+ for GUI code. XDG_DATA_* env vars set the paths to where GTK+ looks for things like icons.
# Setting them to $MOHO_DIR effectively hides /usr/share/icons from the program. The app will then revert to using
# "default" built-in GTK+ icons - avoiding the crash.
#
# EOK 10/2020
#
#
# Moho's startup script uses "$MOHO_DIR" and AnimeStudio's startup script uses "$ANIME_STUDIO_DIR". So, this
# allows this patch to to work in either version of startup script.
if [ $ANIME_STUDIO_DIR ]; then
MOHO_DIR="$ANIME_STUDIO_DIR"
fi
#
#
# Set the env vars to point GTK at $MOHO_DIR for GTK icons and GTK data.
XDG_DATA_HOME=$MOHO_DIR
XDG_DATA_DIRS=$MOHO_DIR
export XDG_DATA_HOME
export XDG_DATA_DIRS
#
#
######### END_EOK

export LC_ALL=C
export LANG=C
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MOHO_DIR

if [ -e "$MOHO_LOCATION" ]; then
$MOHO_LOCATION $*
else
echo "Please edit the startup script before running Moho."
fi
Also, be sure to make the AnimeStudioPro startup script executable via running this command where the file is:
chmod 755 AnimeStudioPro

---


Yes, if you look at what my patches to the scripts actually do, it's just a few functional lines of actual script code. The toughest part was tracing the crashes to figure out the cause. I'm still uncertain exactly what it is about Ubuntu 18.04's icon sets that causes the crash.

And, that's it! Hope this helps someone, but: ... I'm not available...no promises or warranty...use this at your own risk...backup your installation files first...blah, blah blah.
---
eok
Post Reply