开发者

How to extract a windows cabinet file in python

开发者 https://www.devze.com 2023-01-02 23:12 出处:网络
Is it somehow possible to extract .c开发者_JAVA百科ab files in python?Not strictly answering what you asked, but if you are running on a windows platform you could spawn a process to do it for you.

Is it somehow possible to extract .c开发者_JAVA百科ab files in python?


Not strictly answering what you asked, but if you are running on a windows platform you could spawn a process to do it for you.

Taken from Wikipedia:

Microsoft Windows provides two command-line tools for creation and extraction of CAB files. They are MAKECAB.EXE (included within Windows packages such as 'ie501sp2.exe' and 'orktools.msi'; also available from the SDK, see below) and EXTRACT.EXE (included on the installation CD), respectively. Windows XP also provides the EXPAND.EXE command.


I had the same problem last week so I implemented this in python. Comments, additions and especially pull requests welcome: https://github.com/hughsie/python-cabarchive


Oddly, the msilib can only create or append to .CAB files, but not extract them. :(

However, the hachoir parser module can apparently read & edit Cabinets. (I have not used it, though, so I couldn't tell you how fitting it is or not!)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号