Solved

How to view the content of a PKG file on OSX

Posted on 2016-08-23
6
84 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 28

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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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 28

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of new and distinct gadgets are making their appearance every other day. The latest gadget that has wooed the attention of all gadget lovers and non gadget lovers alike is the Smartwatch. This tiny gadget is capable of offering live access to …
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
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…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

863 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

20 Experts available now in Live!

Get 1:1 Help Now