hdiutil error -5341 creating .dmg

I am trying to construct a .dmg containing my application bundle, an examples directory, and a readme file. I use a shell script to construct the directory "G4beamline-3.01" containing them, and then do

$ hdiutil create -srcdir G4beamline-3.01 G4beamline-3.01.dmg

...................................................................

hdiutil: create failed - error -5341


What does that error mean? How can I fix it?


Here's the crazy part -- if I move the app bundle out of that directory, I can create two .dmg-s:

$ mv G4beamline-3.01/G4beamline.app .

$ hdiutil create -srcdir G4beamline-3.01 one.dmg

....................................

created: ...path/one.dmg

$ hdiutil create -srcdir G4beamline.app two.dmg

...................................................................

created: ...path/two.dmg


So the puzzle is: why is it that it can create the .dmg when the two pieces are separate, but not when they are together (as required)?


Note that all .dmg-s open normally, and if there is an app inside it runs correctly. There is plenty of space on the drive. In Terminal I did "su - g4bl" to build the app as a user other than the primary user, but tests as the primary user give the same error. Inside the app bundle I of course copied all non-system dylib-s into Contents/lib, and used install_name_tool to modify all executables and dylib-s to reference them there. This used to work, but with an older version of the app bundle.


In an attempt to fix this, I just re-installed Mac OS X (Mavericks), and did software update. No change.

In playing with this, I found that if I do any one of these, then hdiutil will create the .dmg:

  1. remove Contents/bin from the source directory
  2. remove Contents/lib from the source directory
  3. move Contents/bin/* to Contents/MacOS and remove Contents/bin

Of course doing any of these will break the application! I could live with #3, but that requires OS-specific code that I try to avoid (on other OSs the helper programs are all in bin). I guess I can do #3 and symbolically link MacOS to bin.


Why is hdiutil looking inside my app bundle? -- but not if it is the top-level directory! (previous message)

How can I stop it from doing that?

That workaround no longer works after I added another executable to my bin dir.


I suspect this is not hdiutil looking inside the app bundle, but rather some more subtle error related to the overall size.

hdiutil error -5341 creating .dmg
 
 
Q