diff options
author | DRC <dcommander@users.sourceforge.net> | 2010-04-12 00:25:14 +0000 |
---|---|---|
committer | DRC <dcommander@users.sourceforge.net> | 2010-04-12 00:25:14 +0000 |
commit | ee229f4259df6bc9b046acd43a1e977b822efb93 (patch) | |
tree | 89a8f8426b7e04be754b1e542fd18c521714cd3e /release/uninstall.applescript | |
parent | 752acc7eefeeb0686821d770c023000f91d195e3 (diff) | |
download | tigervnc-ee229f4259df6bc9b046acd43a1e977b822efb93.tar.gz tigervnc-ee229f4259df6bc9b046acd43a1e977b822efb93.zip |
Mac package build
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4017 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'release/uninstall.applescript')
-rw-r--r-- | release/uninstall.applescript | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/release/uninstall.applescript b/release/uninstall.applescript new file mode 100644 index 00000000..e54c72c0 --- /dev/null +++ b/release/uninstall.applescript @@ -0,0 +1,45 @@ +-- Copyright (C)2010 D. R. Commander +-- Copyright (C)2009 Sun Microsystems, Inc. +-- +-- This library is free software and may be redistributed and/or modified under +-- the terms of the wxWindows Library License, Version 3.1 or (at your option) +-- any later version. The full license is in the LICENSE.txt file included +-- with this distribution. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- wxWindows Library License for more details. + +set disk to (path to startup disk) as string +set tmpfile to path to temporary items from user domain +set tmpfile to POSIX path of tmpfile & "tigervnc_uninstall.log" +set uninstaller to disk & "opt:tigervnc:bin:uninstall" +set uninstaller to "sh " & POSIX path of uninstaller & " 2>&1 >" & tmpfile +set success to 0 + +display dialog "You are about to uninstall TigerVNC. Proceed?" buttons {"Yes", "No"} default button "No" + +if button returned of result is "Yes" then + try + do shell script (uninstaller) with administrator privileges + set success to 1 + on error errstr number errnum + if errnum is -128 then + display dialog "Uninstall aborted." buttons {"OK"} + else if errnum is 255 then + set errmsg to "The uninstall script could not remove some of the files or directories installed by the TigerVNC package. Consult:" & return & return & tmpfile & return & return & "for more details." + display dialog errmsg buttons {"OK"} default button "OK" with icon caution + else if errnum is 127 then + display dialog "Could not find the TigerVNC uninstall script. The TigerVNC package may have already been uninstalled." buttons {"OK"} default button "OK" with icon stop + else + set errmsg to "ERROR " & errnum & ": " & errstr + display dialog errmsg buttons {"OK"} default button "OK" with icon stop + end if + end try + if success is 1 then + display dialog "TigerVNC has been successfully uninstalled." buttons {"OK"} + end if +else + display dialog "Uninstall aborted." buttons {"OK"} +end if |