【问题标题】:Are PackageMaker installations with preinstall scripts broken on Snow Leopard?带有预安装脚本的 PackageMaker 安装在 Snow Leopard 上是否损坏?
【发布时间】:2010-11-28 03:12:51
【问题描述】:

在 10.5 上一切正常,但现在我的 PackageMaker 安装项目已损坏。这几天我一直在和一个问题作斗争,要么

  • Snow Leopard (OS X 10.6.1) 已损坏 PackageMaker 安装
  • 我缺乏非常非常基本的知识花絮

为了缩小问题的范围,我已经到了这一点:

  1. 创建新的 PackageMaker 安装
  2. 让它在我的主目录中安装一个 jpeg 图像
  3. 定义一个不执行任何操作的 preinstall 脚本
#!/bin.sh 出口 0

运行上述...并观察它失败并显示以下错误消息,例如时钟工作

Sep 14 15:09:45 manoa installd[5620]: PackageKit: ----- Begin install -----
Sep 14 15:09:45 manoa installd[5620]: PackageKit: request=PKInstallRequest <1 packages, destination=/>
Sep 14 15:09:45 manoa installd[5620]: PackageKit: packages=(\n    "PKLeopardPackage <file://localhost/Users/stu/Desktop/asdf.pkg>"\n)
Sep 14 15:09:46 manoa installd[5620]: PackageKit: Extracting /Users/stu/Desktop/asdf.pkg (destination=/var/folders/Hb/HbXJFyEpFaupt5QyLN-pTk+++TI/-Tmp-/PKInstallSandbox-tmp/Root/~, uid=501)
Sep 14 15:09:46 manoa installd[5620]: PackageKit: Executing script "./preinstall" in /private/tmp/PKInstallSandbox.cmlS2H/Scripts/test.test.5year_header.pkg.PFrHNB
Sep 14 15:09:46 manoa installd[5620]: PackageKit: *** launch path not accessible
Sep 14 15:09:46 manoa installd[5620]: PackageKit: Install Failed: PKG: pre-install scripts for "test.test.5year_header.pkg"\nError Domain=PKInstallErrorDomain Code=112 UserInfo=0x100149430 "An error occurred while running scripts from the package “asdf”." {\n    NSFilePath = "./preinstall";\n    NSLocalizedDescription = "An error occurred while running scripts from the package \U201casdf\U201d.";\n    NSURL = "file://localhost/Users/stu/Desktop/asdf.pkg";\n    PKInstallPackageIdentifier = "test.test.5year_header.pkg";\n}
Sep 14 15:09:46 manoa Installer[5614]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=112 UserInfo=0x1195917c0 "An error occurred while running scripts from the package “asdf”."
Sep 14 15:09:46 manoa Installer[5614]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
Sep 14 15:09:47 manoa Installer[5614]: IFDInstallController 144040 state = 7
Sep 14 15:09:47 manoa Installer[5614]: Displaying 'Install Failed' UI.
Sep 14 15:09:47 manoa Installer[5614]: 'Install Failed' UI displayed message:'The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.'.

/private/tmp/PKInstallSandbox.cmlS2H/Scripts/test.test.5year_header.pkg.PFrHNB/ 中没有文件,这让我觉得问题出在 PackageMaker,而不是我。但我是 OS X 软件安装领域的新手,所以仍有疑问。

那么,问题是:带有预安装脚本的 PackageMaker 在 OS X 10.6 上是否损坏?或者是否有一些关于预安装脚本的要求我不明白?

【问题讨论】:

  • 看来你的shebang线路是错误的。也许应该是“#!/bin.sh”
  • 糟糕。它仍然运行,但这是一个很好的捕获......会尝试一下。

标签: osx-snow-leopard packagemaker


【解决方案1】:

我遇到了同样的问题。检查脚本的第一行。在我的情况下,! 丢失了 来自#!/bin/sh

【讨论】:

    【解决方案2】:

    “启动路径不可访问”很可能与正在压缩和/或解压缩 PKG 的软件有关。

    所以,我遇到了我的 postflight 脚本没有运行并导致我的 PKG 失败的问题。查看安装程序日志(要查看此运行有问题的 PKG,然后菜单项“窗口 > 安装程序日志”并从下拉列表中选择“显示所有日志”),当它试图运行脚本(由 PackageMaker 重命名为“postflight”)。

    问题只出现在我客户的系统上。这是一个真正的难题,因为我的两台 Mac 测试机器在运行 PKG 时都没有问题,而且它们的环境似乎与客户的机器相同。

    然后在赛门铁克网站上的一个不起眼的帖子中,我看到有人发现这个问题与 PKG 的压缩和/或解压缩方式有关。

    果然。我的客户正在从 DropBox 下载 PKG,而 DropBox 压缩它的方式损坏了 PKG 中的某些内容。

    解决方案是让我在上传到 DropBox 之前在我的系统上压缩 PKG,然后一切顺利。

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题,为脚本设置可执行权限为我解决了这个问题!

      pkgutil --expand my.pkg my 
      chmod +x my/inner.pkg/Scripts/preinstall 
      pkgutil --flatten my my-fixed.pkg 
      

      this thread at golang-nuts groups找到这个解决方案

      【讨论】:

      • 我发现将执行权限添加到原始文件本身(在构建安装程序文件之前)也可以。这样,您就不必篡改 pkg 文件。
      • 圣牛 - 非常感谢。这有帮助。
      猜你喜欢
      • 2023-04-09
      • 2015-01-20
      • 2011-11-12
      • 1970-01-01
      • 1970-01-01
      • 2023-03-04
      • 2011-05-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多