How to get CPU serial number using HISE?
-
You can fetch the MachineGuid that Windows creates on install using powershell. Here's how you do it in HISE:
const BackgroundTask = {}; BackgroundTask.getMachineGuid = Engine.createBackgroundTask("GetMachineGUID"); inline function getMachineGuid() { local command = "reg"; local args = [ "query", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography", "/v", "MachineGuid" ]; local logFunction = function(thread, isFinished, data) { if (!isFinished) { var id = data.substring(data.indexOf("REG_SZ")+6, data.length).trim(); Console.print(id); } }; BackgroundTask.getMachineGuid.runProcess(command, args, logFunction); } getMachineGuid();
A bit silly function naming since it won't return anything, but you get the gist.
-
@aaronventure I've created an app that displays the system ID with the Engine.getSystemID() function. I was looking for something that displayed the items in the system that were used to create the numbers.
Ultimately, it looks like there's a fix available from JUCE. Looking forward to the update -
@Christoph-Hart No rush. Just checking in for a friendly ETA.
-
@Christoph-Hart Would you want to give me a "this is how I would do it" outline and I could take a run at it? Just trying to manage the pitchforks.
-
@Christoph-Hart said in How to get CPU serial number using HISE?:
@Dan-Korneff welp it‘s time for a JUCE_EVEN_BETTER_MACHINE_IDS macro…
Where are we at about this
GENERATE_FOOL_PROOF_ID
? -
@ustk I think the method can just be swapped out with the new one.
I've been tinkering with implementation on this end. Lots of little hurdles backporting from juce 8. Got a huge stack trace to work out, but I've been too swamped to complete -
@Christoph-Hart Here's where I'm at:
I'm currently stuck at
Severity Code Description Project File Line Suppression State Details Error LNK2001 unresolved external symbol "public: __cdecl juce::juce::MemoryBlock::~MemoryBlock(void)" (??1MemoryBlock@juce@1@QEAA@XZ) HISE Standalone_App Z:\GitHub\HISE\projects\standalone\Builds\VisualStudio2022\include_juce_core.obj 1 Error LNK2001 unresolved external symbol "public: __cdecl juce::juce::MemoryBlock::MemoryBlock(void)" (??0MemoryBlock@juce@1@QEAA@XZ) HISE Standalone_App Z:\GitHub\HISE\projects\standalone\Builds\VisualStudio2022\include_juce_core.obj 1 Error LNK2001 unresolved external symbol "public: __cdecl juce::juce::MemoryBlock::MemoryBlock(unsigned __int64,bool)" (??0MemoryBlock@juce@1@QEAA@_K_N@Z) HISE Standalone_App Z:\GitHub\HISE\projects\standalone\Builds\VisualStudio2022\include_juce_core.obj 1 Error LNK2001 unresolved external symbol "public: __cdecl juce::juce::MemoryBlock::MemoryBlock(class juce::juce::MemoryBlock &&)" (??0MemoryBlock@juce@1@QEAA@$$QEAV011@@Z) HISE Standalone_App Z:\GitHub\HISE\projects\standalone\Builds\VisualStudio2022\include_juce_core.obj 1
Any chance you could take a look? (ignore the image file stuff..)
-
-
@ustk Got it sorted. Sending to beta for testing now.
-
@Christoph-Hart @ustk Confirmed working:
It requires 2 new files:
juce_Span.h
juce_EnumHelpers.hand edits to:
juce_core.h
juce_win32_SystemStats.cpp
juce_SystemStats.cpp
juce_OnlineUnlockStatus.cpp -
@Dan-Korneff Hey buddy, sorry to bother you, I don't know what's going on with GitLab, I can't see your code on GitLab, will you publish it on GitHub? Or is there another way for me to get it? I will be very grateful
-
@CatABC I set the repo back to private.
Here's a link to the files:
https://hub.korneffaudio.com/index.php/s/M6kgXeaZ9BstR7Q
This will replace the existing method with the new one. No need to keep the old one since it's flawed. -
@Dan-Korneff Thank you so much! I don't know how to thank you, you are my big brother, hahahaha
-
@Dan-Korneff I used your file, but the generated machine code is the same as the original one. I'm not sure if this is normal. Could you give me an answer?
-
@CatABC You have to enable this setting in projucer and rebuild HISE:
Now HISE will use the new code to gather system IDs.
Then you need to set JUCE_USE_BETTER_MACHINE_IDS=1 in your project so the exported plugin references the correct system ID.
-
@Dan-Korneff well,I understand!thanks bro!