Make install and uninstall scripts smarter