Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Helpers.GetMachineCode(v=2) on Windows #69

Closed
asceenl opened this issue Apr 8, 2024 · 8 comments
Closed

Problem with Helpers.GetMachineCode(v=2) on Windows #69

asceenl opened this issue Apr 8, 2024 · 8 comments

Comments

@asceenl
Copy link

asceenl commented Apr 8, 2024

When we run. We get a machine code of None on Windows.

If we run the associated command that is executed in Powershell:

Powershell > Get-CimInstance -Class Win32_ComputerSystemProduct

Get-CimInstance : Invalid Class

So no output is sent to stdout, and "" goes to None in the callers. Do you know the reason for this and a way to solve? This is rather urgent. It is our first client we would like to get running with our software.

Thanks in advance for your answer.

@artemlos
Copy link
Contributor

artemlos commented Apr 10, 2024

@asceenl

It sounds like a likely issue to this could be due to WMI repository being corrupt.

Would it be possible to execute the following command on their site:

winmgmt /verifyrepository

What does that command return?

Thanks!

@asceenl
Copy link
Author

asceenl commented Apr 11, 2024

Dear Artemlos,

This is the output:

image

@asceenl
Copy link
Author

asceenl commented Apr 11, 2024

Should I run it in Administrator mode?

@hugocarnide
Copy link

hugocarnide commented Aug 13, 2024

I have the similar issue with a customer.
I will request to run the verify command to help that investigation

As per reading the library, I figure out a case not available to be used.
The comparison made here https://github.com/Cryptolens/cryptolens-python/blob/master/licensing/methods.py#L1438
It do not permit to compare a None value to a string 'None' if we want to setup that value in the licence.

@artemlos
Copy link
Contributor

@hugocarnide Thank you! Please let me know how it goes.

I would like to ask, with regards to https://github.com/Cryptolens/cryptolens-python/blob/master/licensing/methods.py#L1438, is the issue that if current_mid===None (presumably because the machine code was not computed correctly), you would like that to return false if the one of the machines has ( act_machine.Mid) has the value None or empty string?

@hugocarnide
Copy link

hugocarnide commented Aug 14, 2024

Thanks @artemlos for reading my question.

The feature could be a failover to have another way to compute the machine code.
https://github.com/keygen-sh/py-machineid/blob/master/machineid/__init__.py#L86

For this case, I would like to be able to register None as deviceId and having the method comparing that and letting continue. It is an exceptional case until we figure out what is happening.

artemlos added a commit that referenced this issue Aug 15, 2024
@artemlos
Copy link
Contributor

artemlos commented Aug 15, 2024

A new release is now available which fallbacks on the machineGUID obtained from the registry on Windows. Please note that a user may be able to change this if they have sufficient permissions.

@hugocarnide if possible, could you please let me know if it works now for your client?
@asceenl I would suggest to test the updated version of GetMachineCode method which will fallback on MachineGUID in case the WMI is broken for some reason on the client's machine. Please keep in mind that a user may be able to change machineGUID and that it can reset if they reinstall the operating system.

@artemlos
Copy link
Contributor

@hugocarnide Thank you for the link in your previous message by the way. It was very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants