1 -- Tor Uninstaller.applescript
4 -- ===============================================================================
5 -- Tor Uninstaller is distributed under this license:
7 -- Copyright (c) 2005 Andrew Lewman ( pgp key: 31B0974B )
9 -- Redistribution and use in source and binary forms, with or without
10 -- modification, are permitted provided that the following conditions are
13 -- * Redistributions of source code must retain the above copyright
14 -- notice, this list of conditions and the following disclaimer.
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
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.
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 -- Validate & find disk paths
39 set boot_disk
to (
path to startup disk)
as string
40 set default_tor_path
to boot_disk &
"Library:Tor"
41 set default_privoxy_path
to boot_disk &
"Library:Privoxy"
42 set default_tor_startup_path
to boot_disk &
"Library:StartupItems:Tor"
43 set default_privoxy_startup_path
to boot_disk &
"Library:StartupItems:Privoxy"
44 set shell_script
to default_tor_path &
":uninstall_tor_bundle.sh"
45 set doomed_path_list
to {default_tor_path, default_privoxy_path, default_tor_startup_path, default_privoxy_startup_path}
47 -- Display what we're removing and ask for validation
48 -- this is the simplest way to do this
49 set remove_me
to display dialog "Welcome to the Tor + Privoxy Uninstaller. This program will remove:" &
return & default_tor_path &
return & default_privoxy_path &
return & default_tor_startup_path &
return & default_privoxy_startup_path &
return &
return &
"If this does not look right, choose Yes. Otherwise, choose No." buttons {
"Yes",
"No"}
default button "No"
51 -- Run a shell script to do all the unix work since applescript can't see it at all
52 if button returned
of result
is "Yes" then
54 do shell
script (shell_script)
with administrator privileges
56 display dialog "Too many errors, quitting." buttons {
"Quit"}
default button "Quit" with icon stop giving up
after 5
59 -- So Long and Thanks for all the Fish!
60 display dialog "Thank you for using tor!" buttons {
"Ok"} giving up
after 5
62 display dialog "Thank you for your continued use of Tor & Privoxy" buttons {
"You're welcome."}