Fix a couple of non-cleared key issues in hidden services
[tor/rransom.git] / contrib / osx / Tor_Uninstaller.applescript
blob246e265bbecb45c0f60d1e49fdae5bb952ad8140
1 -- Tor Uninstaller.applescript
2 -- Tor Uninstaller
4 -- ===============================================================================
5 -- Tor Uninstaller is distributed under this license:
6 --
7 -- Copyright (c) 2005 Andrew Lewman ( pgp key: 31B0974B )
8 --
9 -- Redistribution and use in source and binary forms, with or without
10 -- modification, are permitted provided that the following conditions are
11 -- met:
12 --
13 -- * Redistributions of source code must retain the above copyright
14 -- notice, this list of conditions and the following disclaimer.
15 --
16 -- * Redistributions in binary form must reproduce the above
17 -- copyright notice, this list of conditions and the following disclaimer
18 -- in the documentation and/or other materials provided with the
19 -- distribution.
20 --
21 -- * Neither the names of the copyright owners nor the names of its
22 -- contributors may be used to endorse or promote products derived from
23 -- this software without specific prior written permission.
24 --
25 -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 -- ===============================================================================
38 on run
40 -- Validate & find disk paths
41 set boot_disk to (path to startup disk) as string
42 set default_tor_path to boot_disk & "Library:Tor"
43 set default_privoxy_path to boot_disk & "Library:Privoxy"
44 set default_tor_startup_path to boot_disk & "Library:StartupItems:Tor"
45 set default_privoxy_startup_path to boot_disk & "Library:StartupItems:Privoxy"
46 set shell_script to default_tor_path & ":uninstall_tor_bundle.sh"
47 set doomed_path_list to {default_tor_path, default_privoxy_path, default_tor_startup_path, default_privoxy_startup_path}
49 -- Display what we're removing and ask for validation
50 -- this is the simplest way to do this
51 set remove_me to display dialog "Welcome to the Tor + Privoxy Uninstaller. This program will remove:" & return & return & POSIX path of default_tor_path & return & POSIX path of default_privoxy_path & return & POSIX path of default_tor_startup_path & return & POSIX path of default_privoxy_startup_path & return & return & "If this looks correct, choose Yes. Otherwise, choose No." buttons {"Yes", "No"} default button "No"
53 -- Run a shell script to do all the unix work since applescript can't see it at all
54 if button returned of result is "Yes" then
55 try
56 do shell script (POSIX path of shell_script) with administrator privileges
57 on error
58 display dialog "Too many errors, quitting." buttons {"Quit"} default button "Quit" with icon stop giving up after 3
59 quit
60 end try
61 -- So Long and Thanks for all the Fish!
62 display dialog "Thank you for using tor!" buttons {"Ok"} giving up after 3
63 else
64 display dialog "Thank you for your continued use of Tor & Privoxy" buttons {"You're welcome."} giving up after 3
65 end if
67 end run
68 -- We're done