Re: Packages - how to make an uninstaller?
Re: Packages - how to make an uninstaller?
- Subject: Re: Packages - how to make an uninstaller?
- From: Oakman <email@hidden>
- Date: Mon, 27 Mar 2017 15:35:50 -0400
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
On Mar 26, 2017, at 3:14PM, Stephen Kay wrote:
> What I really need to see is an example script for removing installed
> files.
This is how I did it using a postinstall script. I am only an amateur, so take it for what its worth.
----------
#!/bin/sh
#
####################################################
### Remove our application, Foo, if present. ###
####################################################
## Is Foo installed? ##
if [[ -d "$3/Applications/Foo.app" ]] ; then
## Remove the application ##
rm -rf "$3/Applications/Foo.app"
sleep 1
## Is the optional FooSelection service installed? ##
if [[ -d "$3/Library/Services/FooSelection.service" ]] ; then
## Remove Foo service if it exists ##
rm -rf "$3/Library/Services/FooSelection.service"
fi
## Remove the files Mac OS X created when ##
## Foo was run per Boss's instructions ##
/usr/bin/su $USER -c "/bin/rm -R ~/Library/Saved\ Application\ State/Foo\ *.foo.prefs.savedState"
/usr/bin/su $USER -c "/bin/rm -R ~/Library/Preferences/Foo\ *.foo.prefs.plist"
## Remove record of Foo having been installed ##
/usr/sbin/pkgutil --forget "com.foo.pkg"
/usr/sbin/pkgutil --forget "com.foo.service.pkg"
fi
exit 0
----------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden