可可应用程序的卸载程序

发布于 2024-10-07 02:06:20 字数 107 浏览 1 评论 0原文

我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

缘字诀 2024-10-14 02:06:20

在为某些 MAC 操作系统应用程序实现卸载程序时,我们想到了一个想法。正如 SerpicoLugNut 所说:

说真的 - 98% 的 Mac 应用程序不提供卸载程序,如果大多数人想要卸载该应用程序,他们只会将应用程序拖到垃圾箱

我们设备可以查看垃圾箱,以防我们的应用程序出现在垃圾箱中,我们可以询问用户是否要卸载它。

幸运的是,MAC 操作系统提供了开箱即用的功能来实现这一点。您只需将以下 .plist 放入 /Library/LaunchAgents 中:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.your.app</string>
<key>WatchPaths</key>
<array>
    <string>~/.Trash</string>
</array>
<key>ProgramArguments</key>
<array>
    <string>osascript</string>
    <string>/path/to/your/app/Check Trash.applescript</string>
</array>
<key>KeepAlive</key>
<false/>

在此示例中,一旦用户的“废纸篓”被修改,就会运行 Check Trash.applescript。此脚本应检查您的应用程序是否在垃圾箱中,并询问用户是否要继续卸载。当然,这可以是任意脚本,甚至可以是二进制可执行文件,而不仅仅是苹果脚本。有关更多信息,请参阅 launchd.plist 的手册页

While implementing an uninstaller for some MAC OS application, we've come up with an idea. As SerpicoLugNut says:

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

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:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.your.app</string>
<key>WatchPaths</key>
<array>
    <string>~/.Trash</string>
</array>
<key>ProgramArguments</key>
<array>
    <string>osascript</string>
    <string>/path/to/your/app/Check Trash.applescript</string>
</array>
<key>KeepAlive</key>
<false/>

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.plist

゛清羽墨安 2024-10-14 02:06:20

OS 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文