pandaforum 发表于 2012-02-22 15:07

用packagemaker制作安装包遇到的奇怪问题

我写了一个usb驱动,用packagemaker做的安装包,其中用了postinstall和postupgrade脚本来做拷贝文件等操作。
但是,做成的安装包在某些机器上会安装失败,错误信息如下,希望朋友们帮我看看是什么原因,谢谢。


===============================================================================================
12-2-21 下午4:55:44.758 Installer: Configuring volume "MACINTOSH"
12-2-21 下午4:55:44.785 Installer: Free space on "MACINTOSH": 292.42 GB (292423786496 bytes).
12-2-21 下午4:55:44.785 Installer: Create temporary directory "/var/folders/04/99l2st157fb_f6tn6kcfrt_80000gn/T//Install.2095ZqRAfE"
12-2-21 下午4:55:44.792 Installer: IFPKInstallElement (4 packages)
12-2-21 下午4:55:44.918 authorizationhost: SFBuiltinEntitled: Installer.app is not entitled for system.install.apple-software
12-2-21 下午4:55:44.952 authorizationhost: SFBuiltinEntitled: Installer.app is not entitled for system.install.app-store-software
12-2-21 下午4:55:44.971 authorizationhost: SFBuiltinEntitled: Installer.app is not entitled for system.install.app-store-software
12-2-21 下午4:55:44.972 com.apple.SecurityServer: Failed to authorize right 'system.install.app-store-software' by client '/System/Library/PrivateFrameworks/PackageKit.framework/Versions/A/Resources/installd' for authorization created by '/System/Library/CoreServices/Installer.app'
12-2-21 下午4:55:45.001 installd: PackageKit: ----- Begin install -----
12-2-21 下午4:56:29.104 xpchelper: could not open dyld map file: (null)
12-2-21 下午4:56:30.529 installd: PackageKit: *** launch path not accessible
12-2-21 下午4:56:30.617 installd: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “XXXusbser.pkg”." UserInfo=0x7ff622d9ac70 {NSFilePath=./postinstall, NSURL=file://localhost/Users/Goldwatch/Downloads/XXX%20USB%20Drivers%201.0.5.mpkg/Contents/Packages/XXXusbser.pkg, PKInstallPackageIdentifier=com.XXX.XXXUsbDrivers104.XXXUsbSer.pkg, NSLocalizedDescription=An error occurred while running scripts from the package “XXXusbser.pkg”.} {
    NSFilePath = "./postinstall";
    NSLocalizedDescription = "An error occurred while running scripts from the package \U201cXXXusbser.pkg\U201d.";
    NSURL = "file://localhost/Users/Goldwatch/Downloads/XXX%20USB%20Drivers%201.0.5.mpkg/Contents/Packages/XXXusbser.pkg";
    PKInstallPackageIdentifier = "com.XXX.XXXUsbDrivers104.XXXUsbSer.pkg";
}
12-2-21 下午4:56:31.130 Installer: Install failed: 安装器遇到了一个错误,导致安装失败。请联系软件制造商以获得帮助。
12-2-21 下午4:56:31.360 Installer: IFDInstallController 9A63A6C0 state = 7
12-2-21 下午4:56:31.360 Installer: Displaying 'Install Failed' UI.
12-2-21 下午4:56:31.362 Installer: 'Install Failed' UI displayed message:'安装器遇到了一个错误,导致安装失败。请联系软件制造商以获得帮助。'.
12-2-21 下午4:56:31.363 Installer: 安装器遇到了一个错误,导致安装失败。请联系软件制造商以获得帮助。
===============================================================================================


说是执行脚本的时候失败,但是我检查了下脚本,并没有什么问题。
希望朋友们帮我分析下。谢谢。

tonyliu2ca 发表于 2012-02-22 19:39

本帖最后由 tonyliu2ca 于 2012-02-22 08:45 编辑

它说launch path not accessible
而且文件PATH="./postinstall"
而且他说"An error occurred while running scripts "
可能是脚本本身的问题,那就要看脚本了

pandaforum 发表于 2012-02-23 11:14

回复 2# tonyliu2ca


    谢谢你的分析,不过很奇怪,只在某些机器上会出现这个问题,单独执行脚本也是成功的,把脚本贴出来看下:

====================================================================

#!/bin/bash   (以前是sh 后来改成了bash)
#
# Script args:
# $0: full path to script
# $1: full path to top level package dir, no trailing slash
# $2: full path to installed location
# $3:????? Path to install Volume????
# $4:?????

if [[ "`sw_vers -productVersion`" > "10.5" ]]
then
rm -Rf /System/Library/Extensions/XXXUsbSer.kext
mv -f /System/Library/XXXUsbSer.kext /System/Library/Extensions/XXXUsbSer.kext
chown -R root:wheel /System/Library/Extensions/XXXUsbSer.kext
chmod -R 755 /System/Library/Extensions/XXXUsbSer.kext
else
rm -Rf /System/Library/XXXUsbSer.kext
fi;


exit 0


====================================================================

脚本只是简单的判断了下系统版本,然后是一些文件操作,想不出来有什么错误的地方。

谢谢。

pandaforum 发表于 2012-02-23 19:50

刚刚发现似乎可以从install.log中寻找一些线索,明天再分析下。

tonyliu2ca 发表于 2012-03-05 12:44

你的脚本问题
你使用的是绝对的当前系统的根:/
而安装目标目录可能是其它的
应该使用$3

老师的课件 发表于 2012-03-17 11:42

一点也没看懂

pandaforum 发表于 2012-03-21 10:49

问题找到了,package属性的问题,在编译package之前,要将属性设置为10.5.x。

pandaforum 发表于 2012-03-21 10:49

谢谢tonyliu2ca。
页: [1]
查看完整版本: 用packagemaker制作安装包遇到的奇怪问题