简体   繁体   English

使用 Java 列出 Mac 上安装的所有程序

[英]Listing all programs installed on Mac using Java

How can I list all the installed programs on Mac OS, date of installation and version using Java?如何使用 Java 列出 Mac OS 上所有已安装的程序、安装日期和版本?

For example, on Windows I use wmic get product name, version, InstallDate .例如,在 Windows 上,我使用wmic get product name, version, InstallDate

You can create a dump of all the applications registered with Launch Services using,您可以创建使用 Launch Services 注册的所有应用程序的转储,

    lsregister -dump

Execute this command through your java applications and read the dump file to get the app names.通过您的 Java 应用程序执行此命令并读取转储文件以获取应用程序名称。

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump

or或者

ls -hal /Applications/
grep -i CFBundleShortVersionString -A 1 /Applications/Mail.app/Contents/Info.plist 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM