We don't have a ruby example written. But you can call libraries from Ruby, thus TurboActivate will work. Just use the C++ example to write the Ruby integration code needed to call the TurboActivate library.
We are evaluating LimeLm for licensing. Before I get into trying out some code using the free account, wanted to check if you have samples in Ruby to use the TurboActivate API, specifically, IsGenuine, IsActivated from ruby scripts.
Here is the scenario. I will be using the activation part using InnoSeup and I saw a web page with instructions. The inno setup installs a set of ruby files and need to check if the product is activated and is genuine thru ruby.
We don't have a ruby example written. But you can call libraries from Ruby, thus TurboActivate will work. Just use the C++ example to write the Ruby integration code needed to call the TurboActivate library.
For folks wanting to use Ruby 64 bit on Windows, here is the code sample to get things going. My environment is Windows 7 64 bit, Ruby 2.0 64 bit. The important piece of code is the string encoding to UTF-16LE (little endian) which converts the UTF-8 string to Windows wchar format. Fiddle is the recommended way in Ruby 2.X as dl is deprecated.
require "fiddle"def check_license #encode UTF8 string as little endian to match windows wchar format. If we do not do encode IsActivated always returns 7 guid = '112111233.1122' #your product guid wchar_guid = guid.encode('UTF-16LE') #convert to wide char format dll_path = "TurboActivate-x64.dll" ret_code = File.exists?(dll_path) license_ret_code = nil if ret_code ta_dll = Fiddle.dlopen(dll_path) isActivated = Fiddle::Function.new( ta_dll['IsActivated'], [Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT, ) license_ret_code = isActivated.call(wchar_guid) ret_code = (license_ret_code == 0) #activated properly end ret_code end
Sorry, the forum messed up the code formatting:
require "fiddle"def check_license #encode UTF8 string as little endian to match windows wchar format. #If we do not do encode IsActivated always returns 7 guid = '112111233.1122' #your product guid wchar_guid = guid.encode('UTF-16LE') #convert to wide char format dll_path = "TurboActivate-x64.dll" ret_code = File.exists?(dll_path) license_ret_code = nil if ret_code ta_dll = Fiddle.dlopen(dll_path) isActivated = Fiddle::Function.new( ta_dll['IsActivated'], [Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT, ) license_ret_code = isActivated.call(wchar_guid) ret_code = (license_ret_code == 0) #activated properly end ret_codeend