I have a pkg file created by Install Maker for Mac. I want to replace one file in pkg. But I must do this under Linux system, because this is a part of download process. When user starts to download file server must replace one file in pkg. I have a solution how unpack pkg and replace a file but I dont know how pack again to pkg. http://emresaglam.com/blog/1035 http://ilostmynotes.blogspot.com/2012/06/mac-os-x-pkg-bom-files-package.html
相关问题
- Xcode debugger displays incorrect values for varia
- Is there a way to report errors in Apple documenta
- Advice for supporting both Mac and Windows Desktop
- Avoid cmake to add the flags -search_paths_first a
- installing packages for python 3
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
- Automator: How do I use the Choose from List actio
- ImportError: No module named twisted.persisted.sty
- How can I vertically align my status bar item text
- git command-line on Mac OS error “dyld: Symbol not
Packages are just .xar archives with a different extension and a specified file hierarchy. Unfortunately, part of that file hierarchy is a cpio.gz archive of the actual installables, and usually that's what you want to edit. And there's also a Bom file that includes information on the files inside that cpio archive, and a PackageInfo file that includes summary information.
If you really do just need to edit one of the info files, that's simple:
But if you need to edit the installable files:
I believe you can get mkbom (and lsbom) for most linux distros. (If you can get ditto, that makes things even easier, but I'm not sure if that's nearly as ubiquitously available.)
In addition to what @abarnert said, I today had to find out that the default
cpio
utility on Mountain Lion uses a different archive format per default (not sure which), even with the man page stating it would use the old cpio/odc format. So, if anyone stumbles upon thecpio read error: bad file format
message while trying to install his/her manipulated packages, be sure to include the format in the re-pack step:You might want to look into my fork of
pbzx
here: https://github.com/NiklasRosenstein/pbzxIt allows you to stream pbzx files that are not wrapped in a XAR archive. I've experienced this with recent XCode Command-Line Tools Disk Images (eg. 10.12 XCode 8).
Inspired by the answer from abarnert, I made a bash script that will unpack a package named
MyPackage.pkg
into a subfolder namedMyPackage_pkg
and then open the folder in Finder. Remove the last line if you don't want the Finder step.Usage:
@shrx I've succeeded to unpack the BSD.pkg (part of the Yosemite installer) by using "pbzx" command.
pbzx <pkg> | cpio -idmu
The "pbzx" command can be downloaded from the following link: