Extracting a .pkg from a .pkg

Discussion in 'macOS' started by mike31mets, Oct 25, 2010.

  1. mike31mets macrumors member

    Joined:
    Dec 30, 2007
    #1
    There's a System Restore DVD I have which contains some .pkg files within a .pkg. However the disk does not give me the option to Show Package Contents like some other DVDs will. I tried using Pacifist to extract the .pkgs that are contained in the main .pkg file, but that literally extracts all the files within the .pkg I select, not the .pkg itself.

    Is there any way that I can just get the .pkg itself? I'm trying to figure this out and it's driving me nuts. I tried searching online for applications but haven't had much luck.

    If it's unclear what I'm trying to do, the only comparison I can think of is on Windows. If I have a zip file within a zip file, I can simply extract that one zip file intact without having the folders/files within it extracted. How can I do this with a .pkg within a .pkg?

    On a related note, is there a site that's good for learning commands on Terminal in OS X?
     
  2. miles01110 macrumors Core

    miles01110

    Joined:
    Jul 24, 2006
    Location:
    The Ivory Tower (I'm not coming down)
    #2
  3. spinnerlys Guest

    spinnerlys

    Joined:
    Sep 7, 2008
    Location:
    forlod bygningen
    #3
    While selecting the first (root) .pkg file and selecting Show Package Contents and viewing the package contents, how about dragging that second .pkg file to your HDD (Desktop for example) and doing it all over again (Show Package Contents > drag .third .pkg file to your HDD, ...)?

    Terminal:
     
  4. mike31mets thread starter macrumors member

    Joined:
    Dec 30, 2007
    #4
    Well I can only see the actual .pkg using Pacifist. It seems to be hidden otherwise by OS X. And when I tried to simply drag the .pkg that I want to the desktop using Pacifist, it starts export the folders/files instead of the actual .pkg file.

    I'm thinking there's a way to extract the .pkg within the .pkg using Terminal, but I'm not having such luck.
     
  5. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #5
    This is probably a flat-file package, and is therefore a single file. Here is a tip: flat-file packages are nearly regular packages that have been wrapped up in a xar file. There is a command-line utility in MacOS X for handling xar files (/usr/bin/xar), you can use it to take apart the pkg file.

    But you should probably tell us what you are trying to accomplish here. There is probably a better way.
     
  6. mike31mets thread starter macrumors member

    Joined:
    Dec 30, 2007
    #6
    Hey larkost,

    I've actually written about this in the AFP548 forums. What I'm doing is working on an InstaDMG image. I want to include iLife 09 which is based on the System Restore disks that I have. For some reason, when I tried to create packages using Apple's PackageMaker, the program will crash every time when I add iDVD and GarageBand. It's rather odd. I figured if I can simply using the packages without having to re-package then I would be able to use it in my InstaDMG image. But alas I haven't had any luck.
     
  7. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #7
    I am going to assume that you are making hardware specific images (otherwise you really need to go out and get retail discs... trust me on this)...

    With that in mind you have two options:

    1) Image the whole disc. Since there is only a single installer at the root of the volume that is the only one InstaDMG will pick up, and you can then use a InstallerChoices.xml file to pick out exactly what you want. I recommend that you use what I have referred to as the "new style" as the installer folks in the iLife team are very creative and use a lot of corners of the .pkg system that don't get exercised otherwise.

    2) I don't think that you need to use this, but my guess is that if you get the size of the .pkg that you are trying to disassemble you will be surprised at how small it is. The latest disc I have in easy reach right here is for a MacBookPro5,3, and on that one it was very small... The real packages are linked in from it from non-Finder-visible folders on the disc. A little ferreting will get you what you want... but it is still better to use them intact.


    See... it is always better to tell people your real goals, so they can do a better job answering the real question.
     

Share This Page