Add uninstaller for the .pkg part of the disk writer on macOS (#1740).
[dcpomatic.git] / platform / osx / uninstall_disk.applescript
1 --    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
2 --
3 --    This file is part of DCP-o-matic.
4 --
5 --    DCP-o-matic is free software; you can redistribute it and/or modify
6 --    it under the terms of the GNU General Public License as published by
7 --    the Free Software Foundation; either version 2 of the License, or
8 --    (at your option) any later version.
9 --
10 --    DCP-o-matic is distributed in the hope that it will be useful,
11 --    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 --    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 --    GNU General Public License for more details.
14 --
15 --    You should have received a copy of the GNU General Public License
16 --    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
17
18 set askText to "Do you want to uninstall the .pkg part of the DCP-o-matic Disk Writer?"
19 set reply to (display dialog askText buttons {"Cancel", "Uninstall"} default button "Uninstall" cancel button "Cancel")
20 if button returned of reply = "Uninstall" then
21         do shell script "rm -rf \"/Library/Application Support/com.dcpomatic\"" with administrator privileges
22         set doneText to "Uninstall complete.  Now close and delete the DCP-o-matic Disk Writer app."
23         display dialog doneText buttons {"OK"}
24 end if