OSX .pkg安装程序有时不安装.app文件 [英] OSX .pkg installer sometimes does not install .app file

查看:367
本文介绍了OSX .pkg安装程序有时不安装.app文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Java应用程序具有一个启动器(即.app)和与其捆绑在一起的帮助器应用程序.

My Java application has a launcher which is a .app and a helper app which is bundled with it.

我正在尝试使用以下命令使用背景图片制作.pkg安装程序:

I am trying to make .pkg installer with a background image using the following commands:

pkgbuild --root "./Temp"  --identifier "com.company.id" --install-location "/Applications" --sign "signature" "temp.pkg"
productbuild  --package-path "temp.pkg" --distribution "./Distribution.xml" --package-path "./Temp" --resources "./Resources" --sign "installer signature"  "$FINAL_PKG"

当我在./Temp目录中查找时,两个.app文件夹都存在,并且当我使用以下命令解构.pkg时:

When I look in the directory at ./Temp both of the .app folders are there and when I deconstruct the .pkg with:

pkgutil --expand "temp.pkg" "temp"

我看到了.app文件夹,但有时从pkg安装.app文件夹时不会显示其中一个.它们似乎总是在首次安装时出现,但是在多次安装和删除应用程序的计算机上(例如在测试和开发计算机上),. app文件夹之一最终将不会显示.我想知道这里会发生什么?

I see the .app folders but sometimes one of the .app folders do not show up when it is installed from the pkg. They always seem to show up the first time it is installed, but on machines where the application is installed and deleted many times (like on test and development machines) one of the .app folders will eventually not show up. I am wondering what could be going on here?

最初,我们将帮助程序应用程序作为主应用程序放在一个单独的目录中,在这种情况下,有时不会安装帮助程序应用程序,但始终会安装主应用程序.接下来,我们尝试将助手应用程序放入主应用程序中,然后这第一次起作用,但是下次我尝试从安装程序安装主应用程序时就不存在了!

Initially we had the helper app inside a separate directory as the main app and in this case, the helper app would sometimes not get installed but the main app always would be. Next, we tried putting the helper app inside of the main app and then this worked the first time but the next time I tried to to install from the installer the main app wasn't there!

推荐答案

我遇到了大致相同的问题.似乎OS X安装程序会使用有关已安装的软件包和应用程序捆绑包的信息,以便决定在何处以及是否安装新软件包.结果,有时我的安装程序未安装任何任何文件,有时它只是覆盖了我的构建树中的.app捆绑包.不一定是用来构建安装程序的那个,而是OS X找到的任何.app捆绑包.为了使安装程序正确安装文件,我必须做两件事:

I have had roughly the same problem. It appears that the OS X installer uses information about already installed packages and application bundles in order to decide where and if to install new packages. As a result, sometimes my installer did not install any files whatsoever, and sometimes it just overwrote the .app bundle in my build tree. Not necessarily the one used to build the installer, but any .app bundle that OS X had found. In order to get the installer to install the files properly I had to do two things:

  1. 告诉OS X忘记安装的软件包

  1. Tell OS X to forget about the installed package

sudo pkgutil --forget <package id>不知道您是否也是我的情况,但这不是一个好主意.

sudo pkgutil --forget <package id> Not sure if this is needed for you nor in my case, but it is probably a good idea anyway.

删除该应用程序的 all 所有现有.app捆绑包.如果我不这样做,那么现有的应用程序捆绑包将在安装时被覆盖,而不是将该应用程序放置在/Applications中.也许在构建安装程序包时可以防止这种情况,但是我没有找到它.

Delete all existing .app bundles for the app. If I didn't do this, the existing app bundle was overwritten on install instead of the app being placed in /Applications. Maybe there is a way to prevent this while building the installer package, but I haven't found it.

如果可以的话,您可能应该尝试使应用程序自成一体,以便用户只需将其拖放到/Applications中就可以安装它.当然,仅当您不需要在.app捆绑包之外安装任何东西时,此方法才起作用.

If you can you should probably try to make your application self contained so that users can install it by just drag and dropping it into /Applications. Of course, this only works if you don't need to install anything outside of your .app bundle.

这篇关于OSX .pkg安装程序有时不安装.app文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆