【问题标题】:nodejs get file comment out of properties on msi filenodejs从msi文件的属性中获取文件注释
【发布时间】:2021-09-28 12:36:39
【问题描述】:

我想用nodejs读出一个.msi文件的注释。

我找到了this question,但答案没有打印出文件的注释。

有没有办法读出 .msi 文件的注释?如果这也适用于linux,那就太好了。


编辑: 我found another question 从 jpeg 图像中读取这些元数据。但该模块不适用于 .msi 文件...

我也是found one,它从.mp3 文件中读取元数据


编辑:

我为什么要从文件中取出评论?因为.msi 文件没有version 属性,所以版本写在注释中。或者是否存在其他方法来获取安装程序中的软件版本? (我的意思是,安装后在windows中卸载时会显示版本号apps and features)

【问题讨论】:

标签: node.js file metadata


【解决方案1】:

经过几个小时的搜索,我终于找到了答案here on this question。


使用的包:exiftool-vendored

const exiftool = require('exiftool-vendored').exiftool;

exiftool
  .read(__dirname + '\\Setup.msi')
  .then(tags =>
    console.log(tags.Comments))
  .catch(err => console.error('Something terrible happened: ', err));

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-11
    • 2012-07-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多