3

I was under the impression that all ArcGIS package files could have their contents examined and potentially used by renaming them to *.zip and unzipping them.

This impression is supported for map package (*.mpk) files by @KHibma's answer to Opening MPK file without ArcGIS Desktop? and I thought I had used it succesfully on geoprocessing package (*.gpk) files in the past.

However, today I am unable to use a tool within a *.gpk which I think is because it was created using ArcGIS Desktop 10.5.x when I am using 10.2.1.01. When I rename this *.gpk as *.zip and try to examine it in Windows Explorer I get:

Compressed (zipped) Folders Error

Windows cannot open the folder

The Compressed (zipped) Folder ....zip is invalid.

enter image description here

Is it possible to unzip a geoprocessing package (*.gpk) file to see whether it may contain some useful ArcPy code when that *.gpk cannot be unpacked to provide a usable toolbox?

4

Try .7z instead of .zip. the .*pk uses 7zip encoding and not zip.

Source - open a .*pk file in notepad++ or something and you will see the first characters are 7z. That is a 7zip header. Read more about the 7z file encoding here: http://cpansearch.perl.org/src/BJOERN/Compress-Deflate7-1.0/7zip/DOC/7zFormat.txt

Zip file headers start with a PK. Read more about zip encoding here: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

Some of the information contained in this post requires additional references. Please edit to add citations to reliable sources that support the assertions made here. Unsourced material may be disputed or deleted.

  • You may well be right. Unfortunately, I'm in a locked down environment and installing 7-zip to test may be challenging. – PolyGeo Nov 2 '17 at 23:08
  • 1
    Use the version from portableapp.com. – Mark Bryant Nov 13 '17 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.