#!/bin/bash #--------------------------------------------------------------------- # File information. # File: smc.wrapper.in # Purpose: Single-instance wrapper (Laclin-specific) # License: BSD-style (for this file only) # Revision: 211023 #--------------------------------------------------------------------- # Wrapper parameters. BASEDIR=$PRODTREE/smc BINDIR=$BASEDIR/bin LIBDIR=$BASEDIR/lib SNDFLAG=true TARGET=$BINDIR/smc.bin PROGNAME="Secret Maryo" #--------------------------------------------------------------------- # Run the target if it's available. if [ -f $TARGET ]; then # Run the target cd # Go to user's home directory if [ \! -d .smc ]; then # If ".smc" directory is missing rm -fr .smc dotsmc # Safety measure # Populate ".smc" directory unzip -qo $BASEDIR/data/dotsmc.zip || exit 1 mv dotsmc .smc fi cd .smc if [ \! -f config.xml ]; then rm -fr config.xml unzip -qo $BASEDIR/data/dotsmc.zip dotsmc/config.xml mv dotsmc/config.xml . rm -fr dotsmc fi if [ \! -d cache ]; then rm -fr cache unzip -qo $BASEDIR/data/dotsmc.zip dotsmc/cache/\* mv dotsmc/cache . rm -fr dotsmc fi #--------------------------------------------------------------------- cd # Go to user's home directory if [ "@$SNDFLAG" == "@true" ]; then resetpcmvol # Adjust volume fi if [ -d $LIBDIR ]; then # Adjust LD_LIBRARY_PATH LD_LIBRARY_PATH=$LIBDIR:$LD_LIBRARY_PATH export LD_LIBRARY_PATH fi PATH=$BINDIR:$PATH # Adjust PATH /laclin/lacutil/single-instance --wait --usewin \ "^Secret Maryo Chronicles\b" \ $TARGET $* & exit fi #--------------------------------------------------------------------- # Display a missing-program dialog. TITLE="$PROGNAME isn't installed" /laclin/lacutil/single-instance \ --wait --usewin "^$TITLE" \ zenity --error --no-wrap --title="$TITLE" --text="$TITLE"