Error extracting dmg archives #109

berbie opened this Issue Oct 26, 2011 · 3 comments


None yet

3 participants

berbie commented Oct 26, 2011

I have a side effect on the NSFileManager::copyItemAtPath:toPath:error: change above.
My binary is being distributed as a .dmg and does not only contain the .app but also a ReadMe.
SUDiskImageUnarchiver::extractDMG fails with an error because it cannot copy the mountPoint using NSFileManager::copyItemAtPath
I patched this by iterating over the contained files in mountPoint and copying only files with an .app extension.
I am not sure why this ever worked in the previous FSCopyObjectSync implementation.

My proposal would be this single patch:

As a sidenote: in addition the error returned from NSFileManager::copyItemAtPath:toPath:error: is not being logged, which did cost me a while to nail down the problem in the framework.


Thanks for investigating this issue, Berbie. I've landed your patch, with some modifications:
– we can't use fast enumeration, since we support 10.4.
– we support payloads that aren't .apps.

berbie commented Oct 28, 2011

Thanks, andy! My donation to your project is on it's way…

  • berbie.
hofman commented Nov 2, 2011

You should also check for isReadableFileAtPath:, as was done in the past. Otherwise it will fail to copy unreadable files that often are in the .dmg, but that certainly are not of interest for installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment