Skip to content

Conversation

@alexmercerind
Copy link
Contributor

@alexmercerind alexmercerind commented Apr 1, 2022

Description

Now device_info_plus fetches a lot more information on Windows compared to before.
This has many use-cases like identifying Windows version, getting username, install date, build number or product ID (for software license handling) etc.

Reference Images

[sensitive data is hidden]

Windows 10

device_info_plus_10

Windows 11

device_info_plus_11

{
  'computerName': computerName,
  'numberOfCores': numberOfCores,
  'systemMemoryInMegabytes': systemMemoryInMegabytes,
  'userName': userName,
  'majorVersion': majorVersion,
  'minorVersion': minorVersion,
  'buildNumber': buildNumber,
  'platformId': platformId,
  'csdVersion': csdVersion,
  'servicePackMajor': servicePackMajor,
  'servicePackMinor': servicePackMinor,
  'suitMask': suitMask,
  'productType': productType,
  'reserved': reserved,
  'buildLab': buildLab,
  'buildLabEx': buildLabEx,
  'digitalProductId': digitalProductId,
  'displayVersion': displayVersion,
  'editionId': editionId,
  'installDate': installDate,
  'productId': productId,
  'productName': productName,
  'registeredOwner': registeredOwner,
  'releaseId': releaseId,
  'deviceId': deviceId,
}

Related Issues

Closes #177

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated the version in pubspec.yaml and CHANGELOG.md.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@alexmercerind
Copy link
Contributor Author

cc @mhadaily.

Thanks a lot!

@miquelbeltran miquelbeltran self-assigned this Apr 6, 2022
@miquelbeltran
Copy link
Member

Very cool, thanks! I will test this before approving and merging when I got time.

Meanwhile, is there any way you could add a test or two? so then codecov won't complain.

@alexmercerind alexmercerind marked this pull request as draft April 9, 2022 03:10
@alexmercerind
Copy link
Contributor Author

alexmercerind commented Apr 9, 2022

Thanks for the follow up @miquelbeltran!

I improved the tests for Windows, but it seems we're currently using ubuntu-latest (even on Windows). And DLLs required for the native calls cannot be located on Linux (or am I missing something?).

EDIT: Other plugins don't seem to have tests for *_windows packages.

windows:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: "Checkout repository"
uses: actions/checkout@v2
- name: "Install Flutter"
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: "Install Tools"
run: ./.github/workflows/scripts/install-tools.sh
- name: "Build Example"
run: ./.github/workflows/scripts/build-examples.sh windows ./lib/main.dart

Any solution that seems good to you?
Thanks.

@miquelbeltran
Copy link
Member

Hi @alexmercerind

I saw that the test_and_coverage job is failing in the device_info_plus_windows project. Can you take a look?

I haven't looked into it, but I guess you need to have a way to mock the calls to the missing dll in the tests

@Fraa-124
Copy link

Please merge this! this is a must for managing devices!!

@jaxnz
Copy link

jaxnz commented Aug 8, 2022

Please merge this! this is a must for managing devices!!

Agreed - what do we need to do to get this over the line?

@miquelbeltran
Copy link
Member

I resolved the merge conflicts, once CI finishes I will merge and release.

@miquelbeltran miquelbeltran merged commit 055da82 into fluttercommunity:main Aug 8, 2022
@miquelbeltran
Copy link
Member

merged and published

miquelbeltran added a commit that referenced this pull request Aug 10, 2022
@miquelbeltran
Copy link
Member

This PR had to be reverted because the changes were not put in a major version, a new PR will come with the changes reapplied.

miquelbeltran added a commit that referenced this pull request Aug 10, 2022
* Revert "[device_info_plus] Added more information for Windows (#814)"

This reverts commit 055da82.

* Issue #1000 - revert recent changes
alexmercerind added a commit to alexmercerind/plus_plugins that referenced this pull request Oct 4, 2022
miquelbeltran pushed a commit that referenced this pull request Oct 5, 2022
* [device_info_plus_platform_interface] add more attributes to WindowsDeviceInfo

* [device_info_plus_platform_interface] bump version to 4.0.0

* [device_info_plus_windows] feat: add more info (#177)

* [device_info_plus_windows] bump version to 5.0.0 & depend on device_info_plus_platform_interface 4.0.0

* [device_info_plus_windows] update tests

* [device_info_plus] bump version to 5.0.0 & re-introduce #814

* [device_info_plus] test WindowsDeviceInfo values in integration test

* [device_info_plus] integration test: registeredOwner can be null on Windows
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[device_info_plus]<windows> add more information return like MacAddress , windowsVersion , ...

4 participants