Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to view the content of a PKG file on OSX

Posted on 2016-08-23
6
Medium Priority
?
222 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:bbao
  • 3
  • 2
6 Comments
 
LVL 53

Assisted Solution

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

Author Comment

by:bbao
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 31

Assisted Solution

by:serialband
serialband earned 1800 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 37

Author Comment

by:bbao
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 31

Accepted Solution

by:
serialband earned 1800 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:bbao
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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

A professional opinion on which Apple product to buy, and a tidbit about the WWDC.
Is your phone running out of space to hold pictures?  This article will show you quick tips on how to solve this problem.
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 > …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

971 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