10

My program erlier distibuted as a zipped bundle, but now I planing add daemon that must start after installation. So I decide create package while installing that will run Post-Install script. First, I create a simple package like this:

 productbuil --component MyAppName.app /Applications --sign "common name of my certificate" MyAppName.pkg

and trying to install it.

Installation wase successful but after I not find the app bundle in /Application directory. While inverstigatin this poltergaste I found in /var/log/install.log this line:

installd[1954]: PackageKit: Applications/MyAppName.app relocated to Users/myUserName/PAServer/scratch-dir/UserName1.Kh-profileName/MyAppName.app

After that I find this answer Making OS X Installer Packages like a Pro - Xcode Developer ID ready pkg and try to execute command lines finded in it.

pkgbuild --analyze --root ./MyProgram.app MyProgram.app.plist
pkgbuild: Inferring bundle components from contents of ./MyProgram.app pkgbuild: Writing new component property list to MyProgram.app1.plist

Where I planing to edit plist file but first I was try to simple build package with default params.

pkgbuild --root ./MyProgram.app --component-plist ./MyProgram.app.plist MyProgram.pkg pkgbuild: Reading components from ./MyProgram.app.plist pkgbuild: error: No package identifier specified and not exactly one component to derive it from.

What is wrong?

-----------------------------

I also trying to install old version of XCode aux tools to trying use PackageMaker, but can't find documentation (I needed use PackageMaker from command line) to It even if I installing XCode 4.5. I can't build packages manualy from GUI-tools, because into end-user bundle placed unique resource library, and manual buildin is too expensive. So i search for automatic building methods.

1 Answer 1

11

You're missing the --identifier parameter. Try:

pkgbuild --identifier MyIdentifier --root ./MyProgram.app \
--component-plist ./MyProgram.app.plist MyProgram.pkg 

Where --identifier MyIdentifier is the unique name that can be registered with the system.

P.S. You may choose to follow the suffix.domain.project naming convention via:

pkgbuild --identifier com.mydomain.MyIdentifier --root ./MyProgram.app \
--component-plist ./MyProgram.app.plist MyProgram.pkg 

Where --identifier com.mydomain.MyIdentifier is the unique name that can be registered with the system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.