You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

uninstall.applescript 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. -- Copyright (C)2010 D. R. Commander
  2. -- Copyright (C)2009 Sun Microsystems, Inc.
  3. --
  4. -- This library is free software and may be redistributed and/or modified under
  5. -- the terms of the wxWindows Library License, Version 3.1 or (at your option)
  6. -- any later version. The full license is in the LICENSE.txt file included
  7. -- with this distribution.
  8. --
  9. -- This library is distributed in the hope that it will be useful,
  10. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. -- wxWindows Library License for more details.
  13. set disk to (path to startup disk) as string
  14. set tmpfile to path to temporary items from user domain
  15. set tmpfile to POSIX path of tmpfile & "tigervnc_uninstall.log"
  16. set uninstaller to disk & "opt:tigervnc:bin:uninstall"
  17. set uninstaller to "sh " & POSIX path of uninstaller & " 2>&1 >" & tmpfile
  18. set success to 0
  19. display dialog "You are about to uninstall TigerVNC. Proceed?" buttons {"Yes", "No"} default button "No"
  20. if button returned of result is "Yes" then
  21. try
  22. do shell script (uninstaller) with administrator privileges
  23. set success to 1
  24. on error errstr number errnum
  25. if errnum is -128 then
  26. display dialog "Uninstall aborted." buttons {"OK"}
  27. else if errnum is 255 then
  28. 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."
  29. display dialog errmsg buttons {"OK"} default button "OK" with icon caution
  30. else if errnum is 127 then
  31. 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
  32. else
  33. set errmsg to "ERROR " & errnum & ": " & errstr
  34. display dialog errmsg buttons {"OK"} default button "OK" with icon stop
  35. end if
  36. end try
  37. if success is 1 then
  38. display dialog "TigerVNC has been successfully uninstalled." buttons {"OK"}
  39. end if
  40. else
  41. display dialog "Uninstall aborted." buttons {"OK"}
  42. end if