diff options
Diffstat (limited to 'installer_scripts/scripts/preinstall')
| -rwxr-xr-x | installer_scripts/scripts/preinstall | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/installer_scripts/scripts/preinstall b/installer_scripts/scripts/preinstall new file mode 100755 index 00000000..165128a7 --- /dev/null +++ b/installer_scripts/scripts/preinstall @@ -0,0 +1,35 @@ +#!/bin/bash +set -e +inkstitch_folder=($HOME/Library/Application\ Support/org.inkscape.Inkscape/config/inkscape/extensions/inkstitch) +location_inkscape=(/Applications/Inkscape.app) + +# Checking if Inkscape is installed +if [[ -d "${location_inkscape}" ]]; then + echo "Inkscape is found and installed "${location_Inkscape}"." +else + osascript <<-AppleScript + set theDialogText to "Ink/Stich is an Inkscape plugin. Please install and run Inkscape before installing Ink/Stitch." + display dialog theDialogText buttons {"Okay"} default button "Okay" + AppleScript + exit 1 +fi + +# Checking if Inkscape configuration folders are created +if [[ -d "${inkstitch_folder%config*}" ]]; then + echo "Inkscape configs are found and installed "${inkstitch_folder%config*}"." +else + osascript <<-AppleScript + set theDialogText to "Please run Inkscape before installing Ink/Stitch." + display dialog theDialogText buttons {"Okay"} default button "Okay" + AppleScript + exit 1 +fi + +if [[ -L "${inkstitch_folder}" ]]; then + unlink "${inkstitch_folder}" + echo "Unlinking manual install, to avoid damaging user local repository." +else + rm -rf "${inkstitch_folder}" + echo "Removing previous Ink/Stitch installation." +fi +exit 0 |
