#!/bin/bash ACTION="$1" PKG="$2" MUSER=$(getent passwd | grep x:$PKEXEC_UID: | cut -d ":" -f 1) USERHOME=$(getent passwd $MUSER | cut -f6 -d ':') DESKTOP_PATH=$USERHOME"/.local/share/applications/wine/Programs/Google SketchUp 8/Google SketchUp.desktop" case $ACTION in getStatus) case $PKG in google-sketchup) if [ -f "${DESKTOP_PATH}" ];then echo 0 else echo 1 fi ;; esac ;; installPackage) echo "Launching installation wizard..." su -c "wine /var/cache/epi-downloads/GoogleSketchUpWES.exe" $MUSER su -c "regedit /usr/share/google-sketchup/hw_ok_set.reg" $MUSER echo "Ending installation..." if ! [ -f "${DESKTOP_PATH}" ];then exit 1 fi ;; remove) echo "Launching uninstall wizard..." su -c "wine uninstaller" $MUSER if [ -f "${DESKTOP_PATH}" ];then rm -f "${DESKTOP_PATH}" fi ;; esac exit 0