#!/bin/bash

#This will only install the application and its own libraries.  It does not check for missing dependencies.
#Ubuntu and Mint should be fine. Other out-of-the-box distros may require you to install gtk+3, libunwind and/or libwebgitgtk.

#If you prefer another location to /opt, edit this file.  If you do, also edit the 'exec' and 'icon' paths in FTProofsheet.desktop.
#If you just want to run FTProofsheet in your home directory, you don't even need this script. Simply unpack the tarball and run in place.
if mkdir -p /opt/seafortyone
   
then

     #We will delete an existing installation, because obsolete libraries may not be overwritten and we don't want detritus.  A new install will throw a harmless error here.
    #With version 3.6 we added "Client" to the name, for parity with other platforms.  We will also remove the old version in case it is there.
    
    #rm -r /opt/seafortyone/Demo-FTProofsheet
   rm -r /opt/seafortyone/Demo-FTProofsheet-Client
    
    echo "Found/Created target directory"
    
    if tar -zxvf Demo-FTProofsheet-Client.tar.gz -C /opt/seafortyone
       
    then
	
	
	echo "Application successfully installed."
	
#Copy the .desktop file so it is in your Application menu.  Will be in the Graphics category.
	
	if cp FTProofsheet.desktop /usr/share/applications/FTProofsheet.desktop
	   
	then
	    
	    echo "FTProofsheet is now in your Applications menu, under Graphics."
	    echo "Installation completed.  Enjoy!"
	else
	       echo "An error occurred installing the .desktop file. This will happen if the script was not run under sudo."
	fi
	   
     
     else
	echo "An error occurred during installation."
	exit 1
     fi

 else
	 echo "An error occured accessing the target directory. This may happen if you did not run under sudo."
	 exit 1;
 fi
	   
	       

    


 

       

