Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

thinkingwind

macrumors newbie
Original poster
Jul 13, 2010
1
0
i am new cocoa coder.
Use packageMaker, don't understand howto use scritps.
i test it, drag a png to package
p545072428.jpg

bash :
Code:
#!/usr/bin/env bash
touch -c "$2"
echo " postinstall script to touch $2" 
exit 0

i bulid package and run it, it Install failed.

Code:
Jul 13 17:40:10 bogon Installer[1018]: 		test.pkg#test.pkg : com.test.test.test.pkg : 1.0
Jul 13 17:40:10 bogon Installer[1018]: ================================================================================
Jul 13 17:40:10 bogon Installer[1018]: It took 0.00 seconds to summarize the package selections.
Jul 13 17:40:10 bogon Installer[1018]: -[IFDInstallController(Private) _buildInstallPlan]: location = file://localhost
Jul 13 17:40:10 bogon Installer[1018]: -[IFDInstallController(Private) _buildInstallPlan]: file://localhost/Users/thinking/Desktop/test.pkg#test.pkg
Jul 13 17:40:10 bogon Installer[1018]: Will use PK session
Jul 13 17:40:10 bogon Installer[1018]: Starting installation:
Jul 13 17:40:10 bogon Installer[1018]: Configuring volume "Macintosh HD"
Jul 13 17:40:10 bogon Installer[1018]: Preparing disk for local booted install.
Jul 13 17:40:10 bogon Installer[1018]: Free space on "Macintosh HD": 74.27 GB (74274979840 bytes).
Jul 13 17:40:10 bogon Installer[1018]: Create temporary directory "/var/folders/aJ/aJWeuxOZG483GhHxKfBr5k+++TI/-Tmp-//Install.101881H2zE"
Jul 13 17:40:10 bogon Installer[1018]: IFPKInstallElement (1 packages)
Jul 13 17:40:10 bogon installd[1026]: PackageKit: ----- Begin install -----
Jul 13 17:40:10 bogon installd[1026]: PackageKit: request=PKInstallRequest <1 packages, destination=/>
Jul 13 17:40:10 bogon installd[1026]: PackageKit: packages=(\n    "PKLeopardPackage <file://localhost/Users/thinking/Desktop/test.pkg#test.pkg>"\n)
Jul 13 17:40:10 bogon installd[1026]: PackageKit: Extracting /Users/thinking/Desktop/test.pkg (destination=/var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Tmp-/PKInstallSandbox-tmp/Root/Applications/test.png, uid=0)
Jul 13 17:40:11 bogon installd[1026]: PackageKit: Executing script "./preinstall" in /private/tmp/PKInstallSandbox.hUbNjr/Scripts/com.test.test.test.pkg.qH2RUZ
Jul 13 17:40:11 bogon installd[1026]: PackageKit: Install Failed: PKG: pre-install scripts for "com.test.test.test.pkg"\nError Domain=PKInstallErrorDomain Code=112 UserInfo=0x100228380 "An error occurred while running scripts from the package “test.pkg”." {\n    NSFilePath = "./preinstall";\n    NSLocalizedDescription = "An error occurred while running scripts from the package \U201ctest.pkg\U201d.";\n    NSURL = "#test.pkg -- file://localhost/Users/thinking/Desktop/test.pkg";\n    PKInstallPackageIdentifier = "com.test.test.test.pkg";\n}
Jul 13 17:40:11 bogon Installer[1018]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=112 UserInfo=0x1001a8d80 "An error occurred while running scripts from the package “test.pkg”."
Jul 13 17:40:12 bogon Installer[1018]: Install failed: 
Jul 13 17:40:12 bogon Installer[1018]: IFDInstallController 160DD0 state = 7
Jul 13 17:40:12 bogon Installer[1018]: Displaying 'Install Failed' UI.
Jul 13 17:40:12 bogon Installer[1018]: 'Install Failed' UI displayed message:。'.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,751
8,423
A sea of green
Your script says it's a postinstall script.

Your error message says it's failing on the preinstall script.

Post the preinstall script.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.