Geek Posted September 26, 2011 Posted September 26, 2011 <div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2011/09/extract-package-file-contents.jpg" alt="Extract Package (.pkg) file contents without installing them in Mac OS X" title="extract-package-file-contents" width="620" height="306" class="aligncenter size-full wp-image-21574" /></p> <p>Continuing on with the theme of <a href="http://osxdaily.com/2011/09/23/show-what-files-to-be-installed-and-where-files-go/">inspecting the contents of app installers</a>, you can also extract package files and sort through their contents without actually installing them. To do this, you can often just right-click on a pkg file and select “Show Package Contents” – but that isn’t always displayed. Assuming that option is unavailable, we can extract .pkg files using a command line tool called pkgutil that is bundled with OS X:</p> <ul> <li>Launch Terminal (in /Applications/Utilities/)</li> <li>Use the following syntax:</li> <p><code>pkgutil --expand /path/to/package.pkg /output/destination/</code></p> <p>Hint: recall that you can <a href="http://osxdaily.com/2011/03/02/drag-drop-finder-items-into-the-terminal-for-their-full-path/">drag & drop items into the Terminal</a> to print their full path, making this tip easier by typing: pkgutil –expand [drop file here] /destination/path/ <img src="http://osxdaily.com/wp-content/uploads/2011/09/extract-package-file.jpg" alt="Extract package files" title="extract-package-file" width="484" height="36" class="aligncenter size-full wp-image-21575" /></p> <li>Go to the outputs path in the Finder and check out the extracted files</li> </ul> <p>You’ll notice that some package files contain even more package files, quickly leading you into a deeply nested package extraction process. Other than that, this is an excellent way to see what’s contained within packages, particularly the ones where the alt-click “Show Package Contents” option isn’t available, which is increasingly common in <a href="http://osxdaily.com/tag/mac-os-x-10-7/">Mac OS X Lion</a>, although ultimately it depends on how the package was constructed.</p> </div> <p><a href="http://feedads.g.doubleclick.net/~a/1zERg3wDsqUC8nAWgZf6a3axh5g/0/da"><img src="http://feedads.g.doubleclick.net/~a/1zERg3wDsqUC8nAWgZf6a3axh5g/0/di" border="0" ismap="true"></img></a><br/> <a href="http://feedads.g.doubleclick.net/~a/1zERg3wDsqUC8nAWgZf6a3axh5g/1/da"><img src="http://feedads.g.doubleclick.net/~a/1zERg3wDsqUC8nAWgZf6a3axh5g/1/di" border="0" ismap="true"></img></a></p><div class="feedflare"> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=UViJzkteNJc:8R9F3oPU4ss:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=UViJzkteNJc:8R9F3oPU4ss:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=UViJzkteNJc:8R9F3oPU4ss:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=UViJzkteNJc:8R9F3oPU4ss:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=UViJzkteNJc:8R9F3oPU4ss:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=UViJzkteNJc:8R9F3oPU4ss:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=UViJzkteNJc:8R9F3oPU4ss:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=qj6IDK7rITs" border="0"></img></a> </div><img src="http://feeds.feedburner.com/~r/osxdaily/~4/UViJzkteNJc" height="1" width="1"/> View the full article
Recommended Posts