可可应用程序的卸载程序
我使用 PackageMaker 作为我的应用程序的安装程序(这不仅仅是一个简单的捆绑包)。 我想知道如何创建卸载程序、在哪里安装它以及如何向用户提供启动它的方式。
预先感谢您的帮助,
I am using PackageMaker for the installer of my application (which is more than a simple bundle).
I am wondering how to create an uninstaller, where to install it and how to provide to the user a way to launch it.
Thanks in advance for your help,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在为某些 MAC 操作系统应用程序实现卸载程序时,我们想到了一个想法。正如 SerpicoLugNut 所说:
我们设备可以查看垃圾箱,以防我们的应用程序出现在垃圾箱中,我们可以询问用户是否要卸载它。
幸运的是,MAC 操作系统提供了开箱即用的功能来实现这一点。您只需将以下 .plist 放入 /Library/LaunchAgents 中:
在此示例中,一旦用户的“废纸篓”被修改,就会运行
Check Trash.applescript
。此脚本应检查您的应用程序是否在垃圾箱中,并询问用户是否要继续卸载。当然,这可以是任意脚本,甚至可以是二进制可执行文件,而不仅仅是苹果脚本。有关更多信息,请参阅 launchd.plist 的手册页While implementing an uninstaller for some MAC OS application, we've come up with an idea. As SerpicoLugNut says:
We deviced that we can watch the Trash, and in case our application appears in the Trash, we can ask a user if he/she wants to uninstall it.
Fortunately, the MAC OS provides an out-of-box functionality to implement this. You just have to put the following .plist to the /Library/LaunchAgents:
In this example, a
Check Trash.applescript
is run once the user's Trash is modified. This script should check that your application is in the Trash and ask the user if he/she wants to proceed with the uninstall. Of course this can be an arbitrary script or even a binary executable, not only an applescript. For more information, look at the man page for launchd.plistOS X 上没有官方的卸载方法。有些应用程序会获取您的应用程序二进制文件,并找到与其一起安装的关联文件,并删除这些文件,但除此之外,您唯一的卸载选项是:
1 )编写您自己的卸载程序脚本。
2) 使用具有卸载功能的安装程序。我现在不太熟悉 VISE 安装程序提供的功能,但在早期,我记得它具有卸载功能。
3) 做大多数应用程序所做的事情,不用担心卸载。说真的 - 98% 的 Mac 应用程序不提供卸载程序,如果大多数人想要卸载应用程序,他们只会将应用程序拖到垃圾箱,或者(如果他们更精明的话)使用 AppZapper 或 AppDelete 等卸载程序应用程序。
There is no official un-installation method on OS X. There are apps that will take your app binary, and find the associated files it installs with it, and delete those as well, but apart from those, your only uninstallation options are:
1) Write your own uninstaller script.
2) Use an installer that features un-installation capabilities. I'm not familiar with what the VISE installer has to offer these days, but back in the early days, I remember it had un-installation capabilities.
3) Do what most applications do, and don't worry about un-installation. Seriously - 98% of Mac apps don't offer an uninstaller, and if most people want the app uninstalled, they will just drag the app to the trash, or (if they are slightly more savvy) use an uninstaller app like AppZapper or AppDelete.