Mac 安装程序会检查以前安装的版本吗?
我们制作的程序有不同的版本,我只希望人们能够在已经安装了当前版本的情况下安装新版本。在 Windows 机器上,我通过注册表中的一个键来解决这个问题,但我以前从未做过 mac 安装程序,所以我不知道如何在那里解决它。我宁愿没有激活系统,这就是我们之前解决它的方法。我想 PackageMaker 不会削减它?
A program we make come in different versions, and I only want people to be able to install the new version if they already have the current version installed. On Windows machines I solve this with a key in the registry, but I have never done a mac installer before, so I have no idea how to solve it there. I'd rather not have an activation system for it, that is how we have solved it before. I guess PackageMaker won't cut it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您的安装灵活性,您有多种选择。最简单的方法是根据文件(如果存在/不存在就是您想要的)或捆绑包(您的应用程序)中的信息在 PM 中添加要求,这允许您指定确切的版本。仅当您有固定的安装位置(如 /Applications 或 /Library)时,两者才能可靠地工作。
或者,您可以通过“脚本结果”获得最大的灵活性,其中脚本可以简单地使用 pkgutil 来检查您的软件包是否已安装(例如通过 pkgutil --pkg-info id.of.your .app)及其版本(或位置,如果您关心的话)。
一般来说,您不需要任何外部注册表,因为安装程序会自动处理该操作。
You have several options depending on how flexible your installation is. The easiest is to simply add a requirement in PM based on either a file (if present/absent is all you want) or info from bundle (your app) which allows you to specify exact version. Both work reliably only if you have a fixed location to install (like /Applications or /Library).
Alternatively you have the ultimate flexibility with "result of script" where the script can simply use
pkgutil
to check whether your package is installed (e.g. viapkgutil --pkg-info id.of.your.app
) as well its version (or location if you care).In general you don't need any external registry since the Installer takes care of that automatically.