Removed version numbering from installer package internal identifier
[OSXPackageBuilder.git] / pkg content skeleton / Applications / Privoxy / uninstall.command
index 1112c00..a237fe1 100755 (executable)
@@ -28,7 +28,8 @@
 #                USA
 #
 # Modification : If you modify this file please consider whether your 
-#                changes ought to be passed back to the macsetup module.
+#                changes ought to be passed back to the OSXPackageBuilder
+#                module.
 #
 
 root_UID=0   # Root has $UID 0.
@@ -69,14 +70,11 @@ if [ "$UID" -eq "$root_UID" ]; then
                        
                        # Delete all items referenced by the installation package
                        echo 'Delete package installation receipt (ignore errors relating to other bundle identifiers).'
-                       # TODO overwrite PKGNAME during postinstall execution with the name of the package being installed.
-                       # In the meantime, the package name must be manually entered for each release.
-                       #pkgutil --forget PKGNAME
-                       # if OS X 10.5 or newer then use the new pkgutil command else simply delete the receipt file
+                       # On OS X 10.5 or newer we can use the new pkgutil command else simply delete the receipt file
                        if [ -x /usr/sbin/pkgutil ]; then
-                               pkgutil --forget org.ijbswa.privoxy3019.pkg
+                               pkgutil --forget org.ijbswa.privoxy.pkg
                        else
-                               rm -rf /Library/Receipts/Privoxy\ 3.0.19\ OS\ X\ 10.4.pkg
+                               rm -rf /Library/Receipts/Privoxy\ OS\ X\ 10.4.pkg
                        fi
 
                        # Check the Trash, just in case the user manually removed the only obvious item from /Applications
@@ -89,8 +87,8 @@ if [ "$UID" -eq "$root_UID" ]; then
                        darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
 
                        case "${darwin_major_rel_num}" in
-                               # Mac OS X 10.7, 10.6, 10.5
-                               11|10|9)
+                               # Mac OS X 10.5 or higher
+                               9|1*)
                                        # Delete Privoxy LaunchDaemon
                                        echo 'Delete Privoxy LaunchDaemon (an error will be thrown regarding "no such process")'
                                        /bin/launchctl unload /Library/LaunchDaemons/org.ijbswa.privoxy.plist