如果我尝试提取某个文件:
lessmsi x windows%20sdk%20desktop%20libs%20x64-x86_en-us.msi
我收到此消息:
Error: System.Exception: The file
"C:\sdk\58314d0646d7e1a25e97c902166c3155.cab" does not exist.
公平地说,但是 LessMsi 或其他工具有没有办法列出所有需要的文件?
答案1
这似乎可以做到:
lessmsi l -t Component sunday.msi | sed '
/dirCatalogRepositoryDirectory/!d
s/sca//
s/,.*//
'
答案2
以下是使用 Python 实现此目的的另一种方法:
import msilib
path = 'Windows SDK for Windows Store Apps Headers-x86_en-us.msi'
db = msilib.OpenDatabase(path, msilib.MSIDBOPEN_DIRECT)
view = db.OpenView('SELECT * FROM Media')
view.Execute(None)
while True:
rec = view.Fetch()
if rec is None:
break
cabinet = rec.GetString(4)
print(cabinet)