Solved

How to view the content of a PKG file on OSX

Posted on 2016-08-23
6
72 Views
Last Modified: 2016-08-28
hi OSX folks

can some one tell me how to view the content of a PKG file in an installation image?

e.g. i'd like to check the Google Earth Pro app's version from the disk image file i downloaded from Google. but when i open the downloaded DMG file, i can only see an installer package file, as shown below.
Screen-Shot-2016-08-24-at-12.21.53.png
how can i view its content and get the individual APP file?

thanks,
bbao
0
Comment
Question by:Bing CISM / CISSP
  • 3
  • 2
6 Comments
 
LVL 53

Assisted Solution

by:strung
strung earned 50 total points
ID: 41768087
Download Pacifist:  https://www.charlessoft.com
0
 
LVL 37

Author Comment

by:Bing CISM / CISSP
ID: 41768128
thank you for the link strung.

i actually just tried The Unarchiver and opened the PKG file! i guess the Pacifist basically does the same thing?

The Unarchiver has extracted the content of the PKG file into a folder named "Install Google Earth" on my Desktop. as shown below, it contains another PKG file "Google_Earth_Pro.pkg". it is interesting that this time the PKG file can be opened by right-clicking and choosing "show packet contents".
Screen-Shot-2016-08-24-at-12.49.28.png
after checking the contents of the 2nd PKG file, i saw a file named "Payload" which should be APP file (due to size). see below.
Screen-Shot-2016-08-24-at-12.45.10.png
in a few words, i still can't find the APP file, something like the "Google Earth Pro.app" already in my Application folder.

any thought please? thanks in advance.
0
 
LVL 27

Assisted Solution

by:serialband
serialband earned 450 total points
ID: 41769339
The first package is a single self contained file executable package, otherwise it would be problematic for someone to download from the internet.  Once extracted, the internal packages can be organized in other ways.

You'll find the App structure in the Packageinfo.plist file as a standard XML text file.  The Bom file has some strings that you can view. (strings Bom|more).  Unfortunately, the other 2 are completely binary.  They do seem to start with the same few bytes in the header, but I don't happen to know what filetype that represents, since I haven't created any Xcode Packages before.  This means that the App folder is contained here, but you'll have to know how to extract it from the payload.

Why do you need to extract this?
1
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 37

Author Comment

by:Bing CISM / CISSP
ID: 41769559
thanks for the explanation Serialband.

> Why do you need to extract this?

1. to compare the difference between the installed version and the one just downloaded.

2. to learn how a PKG file is organised. a curiosity for a long time.
0
 
LVL 27

Accepted Solution

by:
serialband earned 450 total points
ID: 41769719
1.  Keep the old package and run diff on the Info.plist to see what files are different.  The binaries are generally going to be different.

2.  Install XCode.  It has utilities to manipulate packages.
https://coolaj86.com/articles/how-to-unpackage-and-repackage-pkg-osx.html

I didn't have time during my earlier answer to check deeply, but now that I do, it seems that the payload is a .tar.gz or .tgz file.  You should be able to extract the app with the tar command.  I should have guessed it was done in standard unix/linux.

tar -xzf payload

That should extract your App folder structure to compare.
1
 
LVL 37

Author Closing Comment

by:Bing CISM / CISSP
ID: 41773904
> That should extract your App folder structure to compare.

YES!

followed the instruction and done, exactly as given above. thanks so much for your help Serialband.

also thanks to Strung for the suggestion.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Are you looking to clear some space on your phone for the latest iOS 8 update? Did you switch to Spotify so you no longer need to keep music native on your phone? Run out of space for taking photos while in the middle of vacation? Sometimes the quic…
Set up iPhone and iPad email signatures to always send in high-quality HTML with this step-by step guide.
Users will learn how resize a batch of photos from a single command in Photoshop via Photoshop's Image Processor. Open up an Image you'd like to resize in Adobe Photoshop: Adjust the image size according to your preferences. Image > Adjustments > …
Users will learn how to set proper sequence settings, scale images, paste attributes, add transitions, fades, and music. Open up Final Cut Pro 7 and Create a new Project: Set the Sequence Settings. a) Click File > Easy Setup > Format > Apple ProRe…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now