chiark / gitweb /
allow user to cancel automatic installation of dependencies during install
authorJonathan Dahan <jonathan@jedahan.com>
Mon, 19 Nov 2012 17:37:46 +0000 (12:37 -0500)
committerJonathan Dahan <jonathan@jedahan.com>
Mon, 19 Nov 2012 17:37:46 +0000 (12:37 -0500)
scripts/osx64/Cura.app/Contents/MacOS/Cura

index e662bd4a680cd05b46d414dd75faa1a51b70c1c7..58d6f75b0566b1a2129bcb6c1a50c58c087f1b0c 100755 (executable)
@@ -11,12 +11,22 @@ fi
 
 displayMessage()
 {
-       /usr/bin/osascript > /dev/null <<-EOF
+       /usr/bin/osascript > /dev/null << EOF
 tell application "System Events"
        activate
-       display dialog "$@" buttons {"Ok"}
+  set question to display dialog "$@"
 end tell
+return button returned of question
 EOF
+  if [ $? != 0 ]; then
+    /usr/bin/osascript > /dev/null << EOF
+tell application "System Events"
+       activate
+  display dialog "User Cancelled Install" buttons {"Ok"}
+end tell
+EOF
+    exit 1
+  fi
 }
 
 #Testing for python2.7, which we need and is not always installed on MacOS 1.6