-1

I am working on a Flutter application that needs to read metadata from files on a Windows OS. Specifically, I am interested in reading the File Version of EXE files.

This only gives me basic information. How can I read more detailed metadata, especially the File Version?

I have also looked into using platform channels to execute native code, but I am not sure how to proceed with that approach as I am a newbie in Dart and Flutter.

Is there a package or method that allows me to read all metadata, including the File Version, of files on a Windows OS in a Flutter application?

Thank you for your help!

I have tried using the dart:io library to read basic file attributes like file size and last modified date, but it doesn't provide a way to read extended metadata like File Version.

  • What is the _"file-version"_?? – πάντα ῥεῖ Aug 29 '23 at 10:17
  • Since you tagged C++ [How do I programmatically get the version of a DLL or EXE file?](https://stackoverflow.com/questions/940707/how-do-i-programmatically-get-the-version-of-a-dll-or-exe-file) – Retired Ninja Aug 29 '23 at 10:23
  • The usual DLL or EXE version is a *resource* built into the file itself (unlike the file size, which is part of the file-system). There are functions to load and read resources from files, and that can extract the version resource into a set of structures. There's plenty of online documentation and tutorials on how work with resources in Windows applications, but I don't know how well they translate to Dart. – Some programmer dude Aug 29 '23 at 10:29
  • 1
    Use `package:win32`. It has `GetFileInformationByHandle` available - see https://github.com/dart-windows/win32/blob/main/lib/src/win32/kernel32.g.dart and https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfileinformationbyhandle – Richard Heap Aug 29 '23 at 12:40

0 Answers0