使用 PackageMaker 安装邮件插件?
我正在尝试为我创建的 Mail.app 插件制作安装程序包。它需要做两件事: 1. 将 .mailbundle (只是一个文件夹)安装到 ~/Library/Mail/Bundles 2. 运行两个终端命令来启用邮件捆绑
问题的症结似乎源于我试图安装在用户的主文件夹中,因为 PackageMaker 应用程序似乎没有“当前登录的用户” " 变量,因此当我指定谁应该是文件的所有者时。现在,我将自己指定为所有者,认为 PackageMaker 会明智地将其视为“当前用户”,但似乎并非如此;当我尝试在另一个人的计算机上安装该软件包时,未知用户(可能是我)是该文件夹的所有者,并且启用邮件捆绑包的安装后脚本似乎没有生效(可能是因为安装程序正在以 root 身份运行,这会阻止默认程序写入当前用户的邮件首选项文件)。
我已经做了很多工作来寻找这些东西,但大多数人似乎都在安装自己的独立应用程序,并且没有人在做严格存在于主文件夹中的东西。我将尝试一个简单的 shell 脚本,用户可以双击该脚本来安装插件,但我确实需要它作为 pkg 工作,以便 Sparkle 工作。
我想做的另一件事是检查 Mail 是否在安装时运行并提示用户退出该程序。现在我可以默默地退出程序,但为了安全起见,我宁愿让用户自己退出。我知道这是可能的,因为 iTunes 更新程序会做到这一点,但我在 PackageMaker 中没有看到任何直接的方法来做到这一点,所以我猜需要一个更有创意的解决方案。
有什么想法吗?
I'm trying to make an Installer package for a Mail.app plugin I've created. It needs to do two things:
1. Install the .mailbundle (which is simply a folder) to ~/Library/Mail/Bundles
2. Run two Terminal commands to enable Mail bundles
The crux of the issue seems to stem from the fact that I'm trying to install in the user's home folder, because the PackageMaker app doesn't seem to have a "currently logged in user" variable so when I specify who should be the owner of a file. Right now I have myself specified as the owner, thinking PackageMaker would intelligently take that to mean "the current user" but it doesn't seem to; when I try to install the package on another person's machine, an unknown user (likely me) is the owner of the folder, and the postinstall script that enables Mail bundles doesn't seem to take effect (likely because Installer is being run as root, which prevents the defaults program from writing to the current user's Mail preferences file).
I've done a great deal of looking for this stuff, but most people seem to be installing their own standalone apps, and nobody's doing stuff that strictly exists in the home folder. I'm going to try a simple shell script that the user can double-click to install the plugin, but I really need this to work as a pkg so that Sparkle works.
Another thing I'd like to be able to do is check whether Mail is running at install time and prompt the user to quit the program. Right now I can silently quit the program but I'd rather have the user quit themselves, just to be safe. I know it's possible because the iTunes updater will do it, but I don't see any straightforward way to do it in PackageMaker, so I'm guessing a more creative solution will be needed.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下载 GrowlMail 源代码并查看 MakeFile。我认为您可能需要使用脚本以这种方式移动文件。
Download the GrowlMail source code and look at the MakeFile. I think you might need to move the files in that manner by the use of a script.