I'm about to sell my Ruby app on Windows, and I want to protect my software from being stolen or copied. I won't publish it, so it needs to be machine related.
I need my code to obtain the MAC address of any pc at startup, and compare it with a file stored in my server. I tried to build a unique serial code from the MAC address, but the 'macaddr' gem returns an error on some computers. This code will fail on some computers:
require 'macaddr'
mac = Mac.addr
puts mac
# >> NoMethodError: undefined method 'pfamily' for nil:NilClass
How can I get some unique system ids and build a serial code from them? Is there another way to get a unique hardware ID from a computer in Ruby?