On Aug 21, 2012, at 10:27 AM, "Bernstein, Gary" <
bern...@gmail.com> wrote:
> I was wondering how people are packaging up App Store apps to distribute via munki?
>
> I can think of several ways to do this using copy_dmg or composer or packagemaker. I tried to make a disk image of iBooks Author (free) and I am running into error messages.
We distribute directly from the App Store downloaded installer, which is a bit complicated. This may be vast overkill but we haven't had any trouble with it. Note that you can only redistribute apps from the App Store that don't check their receipt, which is most free apps.
1. Start and pause the download immediately.
2. With Terminal, find the temporary com.apple.appstore directory under /var/folders. Something like "find /var/folders -name com.apple.appstore 2>/dev/null" - if you're not root you'll get some permission errors here so redirect stderr to null.
3. Under that you'll find a directory with some large number, and a few files inside that - flyingIcon, mzm.junk.pkg, preflight.pfpkg, and receipt. the mzm.junk.pkg is the actual app. Now if you resume downloading it will get deleted after installation, but if you make a hardlink to the file, the hardlink will stay around. For example, ln /var/folders/1v/6c9xr5zn6nz92c_vnj3jv17m0000gn/C/com.apple.appstore/12345678/mzm.exgoawfi.pkg ~/Desktop/
4. Resume the download and let it finish.
5. It would seem like you can use this linked mzm pkg directly, but it won't work. Instead, we expand it to get to the pkg inside, and then flatten that.
pkgutil --expand mzm.exgoawfi.pkg appstore.pkg
pkgutil --flatten appstore.pkg/whatever.pkg whatever.pkg
6. You can now use the whatever.pkg with makepkginfo. We sometimes unpack the Payload file from inside the expanded pkg (e.g. appstore.pkg/whatever.pkg/Payload) using pax, and then feed that as -f's to makepkginfo.
--Jim