1

I'm trying to read attributes of an .exe file (specifically - product name and product version) in java but have a slight problem with that. From what i read it should be doable with Java.NIO but this code (suggested in all examples and in different questions here)

UserDefinedFileAttributeView userView = Files.getFileAttributeView(file, UserDefinedFileAttributeView.class);
List<String> attribList = userView.list();

returns empty list which means it can't find any attributes (as i understand it). I also tried to use Apache Tika's ExecutableParser to read metadata of a file but it didn't have those attributes either.

Can somebody please explain how to do such thing, in details?

NekoiNemo
  • 47
  • 6
  • http://stackoverflow.com/questions/6918022/get-version-info-for-exe – FrobberOfBits Dec 24 '14 at 14:20
  • @FrobberOfBits Doesn't seem to work for me. It always returns "4 4 0 0" no matter what file i call it upon. I suspect it may have something to do with me having to write getFieldOrder() by myself in VS_FIXEDFILEINFO. – NekoiNemo Dec 24 '14 at 15:25
  • Nevermind, i found the right order on MSDN and it works just perfect. Thank you very much. – NekoiNemo Dec 24 '14 at 15:32

0 Answers0