build_info_windows

The Linux implementation of build_info.

Usage

This package is endorsed, which means you can simply use build_info normally. This package will be automatically included in your app when you do, so you do not need to add it to your pubspec.yaml.

However, if you import this package to use any of its APIs directly, you should add it to your pubspec.yaml as usual.

About implementation of Windows version

The Windows version of build_info works as follows.

  1. Call the BuildInfo.fromPlatform method from Flutter.
  2. Get the IMAGE_NT_HEADERS64 structure and use the TimeDateStamp value of the IMAGE_FILE_HEADER structure as the build date and time.
  3. The earlier date and time of the creation date and time of the executable file or the creation date and time of the directory where the executable file exists is used as the installation date and time.

If each date and time cannot be obtained, it will be null.

TimeDateStamp of the IMAGE_FILE_HEADER structure used for build date and time is of DWORD type, so it will overflow after 2106/02/07 06:28:15 UTC, so if a timestamp before 2024/01/01 00:00:00 UTC is received, 0x100000000 will be added.(Date format yyyy/mm/dd)

int64_t _tmp = inh.FileHeader.TimeDateStamp;
if (_tmp < 1704067200/* 2024-01-01 00:00:00 UTC */) {
    _tmp += 0x100000000;
}

Libraries

build_info_windows