Solved

Creating Installation ID

Posted on 2011-02-17
55
983 Views
Last Modified: 2012-05-11
I have created an Excel Addin which will have a "Register Me" button.

I want the button to generate installation ID based of certain hardware serial numbers which the user will have to provide for the Activation code.

Which Hardware(s) should I be looking at?

Is there a better way of doing this?

Sid

I need to do this from VBA Excel. Should work from Excel 2003-2010.
0
Comment
Question by:SiddharthRout
  • 25
  • 14
  • 7
  • +2
55 Comments
 
LVL 41

Accepted Solution

by:
dlmille earned 350 total points
Comment Utility
Generally, I have to enter my hard drive's serial number to get a license download when I have a crash.

You might try that.

Dave
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
Dave, I thought of Hard Drive but I want to use 3-4 different hardwares to create my installation ID.

I have never done it before so I don't know where to start.

I am also worried if the hardware crashes or the user changes it then the user will not be able to install it in the future with the same activation key.

Sid
0
 
LVL 41

Assisted Solution

by:dlmille
dlmille earned 350 total points
Comment Utility
The way my vendors do it, they have my name and serial number, then send activation key for that serial number.  If the hardw are crashes, then they send another activation key.  You almost have to have the capability to create a new activation key and send it when the user claims hardware replacement.  It is inevitable, unless you warrant no recourse if hardware fails and that's tough for the user to swallow.

Another way to do this (aka PC DOC Pro) is to issue a serial number and have the software register itself on your website.  The serial number is generally time sensitive.  If hardware crashes then user claims accordingly, and is allowed a new serial number (I went thru this myself, in the past).

Dave
0
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
Sid - here's a link to a discussion on this very subject.  Perhaps some insights here?

Suggested approach hardware key and online activation approach:

http://stackoverflow.com/questions/1871905/question-regarding-product-activation-scheme

Dave
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
The last link looks promising. Let me go through it

Thanks Dave.

Sid
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
Ok I got this code from Google.

Can some of you run this and tell me the results that you are getting? So that I can understand what results to expect?

I got

CPU No: BFEBFBFF000006FB
Bios No: 28209476-7000628

But one of my friend only got

CPU No: BFEBFBFF00000F64 ???
Bios No:

Is it possible that Bios No can be blank?

Sid

Option Explicit

Private m_mainWmi As Object
Private m_deviceLists As Collection

Sub Sample()
    Dim CPU As String
    CPU = GetWmiDeviceSingleValue("Win32_Processor", "ProcessorID")
 
    Dim BIOS As String
    BIOS = GetWmiDeviceSingleValue("Win32_BIOS", "SerialNumber")
    
    Debug.Print CPU
    Debug.Print BIOS
End Sub

Private Function GetMainWMIObject() As Object
  On Error GoTo eh
  If m_mainWmi Is Nothing Then
    Set m_mainWmi = GetObject("WinMgmts:")
  End If
  Set GetMainWMIObject = m_mainWmi
  Exit Function
eh:
  Set GetMainWMIObject = Nothing
End Function

Public Function WmiIsAvailable() As Boolean
  WmiIsAvailable = CBool(Not GetMainWMIObject Is Nothing)
End Function

Public Function GetWmiDeviceSingleValue(ByVal WmiClass As String, ByVal WmiProperty As String) As String
  On Error GoTo done
  Dim result As String
 
  Dim wmiclassObjList As Object
  Set wmiclassObjList = GetWmiDeviceList(WmiClass)
  Dim wmiclassObj As Object
  For Each wmiclassObj In wmiclassObjList
    result = CallByName(wmiclassObj, WmiProperty, VbGet)
    Exit For
  Next

done:
  GetWmiDeviceSingleValue = Trim(result)
End Function

Public Function GetWmiDeviceList(ByVal WmiClass As String) As Object
  If m_deviceLists Is Nothing Then
    Set m_deviceLists = New Collection
  End If
 
  On Error GoTo fetchNew
 
  Set GetWmiDeviceList = m_deviceLists.Item(WmiClass)
  Exit Function
 
fetchNew:
  Dim devList As Object
  Set devList = GetWmiDeviceListInternal(WmiClass)
  If Not devList Is Nothing Then
    Call m_deviceLists.Add(devList, WmiClass)
  End If
  Set GetWmiDeviceList = devList
End Function

Private Function GetWmiDeviceListInternal(ByVal WmiClass As String) As Object
  On Error GoTo eh
  Set GetWmiDeviceListInternal = GetMainWMIObject.Instancesof(WmiClass)
  Exit Function
eh:
  Set GetWmiDeviceListInternal = Nothing
End Function

Open in new window

0
 
LVL 41

Assisted Solution

by:dlmille
dlmille earned 350 total points
Comment Utility
I got
CPU:BFEBFBFF00010677
BIOS: 5HNYWG1

I think it is possible, but one way to know for sure is to have your fried boot up and hit DEL or whatever key the bios supports to go into the bios and look there, to see if the bios is displayed.

http://pcsupport.about.com/od/tipstricks/ht/biosverwin.htm can help him find bios number in the Windows registry.

Just google "what's my bios" to find freeware that will advise as well.

Dave
0
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
Sid - any progress here?
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
dlmille: I am still stuck.

I am waiting for more experts to run that and give me some results. I have got to submit this by tomorrow...

Guess I will request more experts to join me.

Sid
0
 
LVL 22

Assisted Solution

by:rspahitz
rspahitz earned 150 total points
Comment Utility
Sid, anything for you :)

I got:

178BFBFF00100Fxx
System Serial Number

Was it supposed to show BIOS number? Maybe because I'm running 64-bit?
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
rspahitz: Thanks. :)

>> Was it supposed to show BIOS number?

That's what I want to find out before implementing it in the code.

Sid
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
It may be an authority issue.  Can you get results when you are logged on with a non-admin account?
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
Hmm an interesting Angle. I cannot test it because My ID has full Admin Rights. I am on my laptop at the moment.

Sid
0
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
Its not about admin.  I just generated ok with standard user in Vista.

Dave
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
I am stuck. This is my Form. I need to generate the Installation ID from BIO and CPU number. If Required, I can prompt for Username and email as well. Any suggestions?

Sid

Untitled.jpg
0
 
LVL 22

Assisted Solution

by:rspahitz
rspahitz earned 150 total points
Comment Utility
Just some thoughts...

Obviously, one of the issues that companies such as Microsoft have struggled with is how to only allow authorized users to access their software.  It's not quite the same as having access to a car, where you can hand out 1000 keys but there's only 1 car available.  With software, you can hand out 1000 keys for one copy of the software, but the user can simply make 1000 copies of the software.

Looking at past options:
* Require a software key when the package is purchased.  Doesn't solve the problem unless you can keep the software from being copied.
* Require a key from the manufacturer.  Really, the same problem.
* Require a dongle (plug-in hardware) to, essentially, require two things, one of which is like the car issue.  This is very effective, but often annoys users and usually costs the distributor several hundred dollars for the license to the dongle.

Newer options:
* Have the software look for validation via the Internet (or maybe an IntRAnet.) This is also very effective but requires a connection to the verification mechanism.  For that reason, you need to have a delay period so the product can run for a bit while it tries to connect.  i.e. Maybe 10 minutes then stop unless validated.
* Create a cloud solution.  This solves many problems but also requires a live connection, and doesn't really even allow the software to run AT ALL without it.

As we move more toward mobile devices, the cloud solution is probably the way to go.  Meanwhile, I'd suggest the connect-and-validate approach if feasible.  Then you can validate on your website and monitor the account in a simpler way (like not allow the user to log on more than once, or maybe more than twice since you'll also need to have a connection to say that the user logged out, and sometimes the logout fails.)  This may also require someone on the phones to reset if the legitimate user cannot log in because the account is "in use" by the same user due to a reboot.

0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
rspahitz: Thanks for the inputs. I have already discussed online activation like you mentioned with my client but that doesn't seem an option right now. So I will have to go ahead with the above idea of creating an installation ID.

Sid
0
 
LVL 41

Assisted Solution

by:dlmille
dlmille earned 350 total points
Comment Utility
Suggest you include "LICENSED TO: type display as the package loads.  Purchasers won't want it to get around that they allowed their software to be duplicated.

Dave
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
Well then, depending on the cost of the software, the dongle option might be good since it replaces all the hardware issues with a single known piece of hardware.  Other than that, you're just guessing: video card id + hard drive id + network card id + power supply id + Windows id + keyboard id + mouse id + ... - 1 or 2 of those, maybe weighted (video card=3x, hard drive=2x, network card =4x, winid=2x, etc)
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
Good suggestion. I would use that after successful registration.

Sid
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
rspahitz: I have thought that as well.

I need to use 5 piece of information to create 5 parts of the Installation ID.

Probably this?

1) BIOS Number (DOUBTFUL at the moment)
2) CPU Number
3) First Name
4) Last Name
5) Email Address

Once I get the above details I could encrypt then using either MD5 or other encryption and then generate the ID?

Sid
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
Those sounds reasonable, but I'm not sure how reliable it is to get the O/S information.  You may have to set minimum requirements like WinXP with SP 3 or something.  But I'm curious about this solution so I can consider using something similar in the future.
0
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
See http:/Q_34931150.html .  I believe you can get the O/S information from the registry.

Dave
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
But I am not using the O/S Info? BIOS and CPU are not part of the O/S Info.

Sid
0
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
That info is also in the registry...  I was responding to rspahitz's comment.

Dave
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 41

Expert Comment

by:dlmille
Comment Utility
see the link...

Dave
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
thanks dl...but I get question not found for that link
0
 
LVL 30

Assisted Solution

by:SiddharthRout
SiddharthRout earned 0 total points
Comment Utility
Ok. I have finally gone ahead with

1) First Name
2) Last name
3) Email Address
4) CPU ID
5) Hard Disk Number

It's all working out nicely and is ready for "The Launch" :)

Thanks everyone for the feedback.

Sid
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
This is how I am intending to close the thread. Please let me know if it is OK.

Accepted
SiddharthRout: ID: 34939524 (0 Points)

Assisted
dlmille: ID: 34921315 (100 Points)
dlmille: ID: 34923578 (100 Points)
dlmille: ID: 34934418 (100 Points)
dlmille: ID: 34931150 (50 Points)
rspahitz: ID: 34933191 (50 Points)
rspahitz: ID: 34934354 (100 Points)

Sid
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
@Sid

I don't have a problem with the points distribution.

I do have a suggestion for you.  Send a license file instead of providing information over the phone.  The encrypted license file should include customer and company name as well as the license data.  That way, if someone manages to spoof the system, their copy of the application will still have many references to the licensed user.
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
aikimark: Thanks :) I won't say that I have built the most robust system but until and unless they hack the Add-In to see the way I am encrypting the code and the way I am handling the registry, I feel (and I could be wrong) that the Add-In cannot be pirated.

I can send the Add-In by email to you if you want to test it?

Sid
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
Forgot to mention that it is an Excel 2007 Add-In.

Sid
0
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
I'm happy to test...

Dave
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
Sure Dave. Please send me a test email. My email is mentioned in my profile.

Sid
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
@Sid

What sales/distribution volume do you expect for this add-in?  I would almost suggest you consider a customized Add-in for each user that will only run on their PC.  That would obviate the need for any registry entries.

If you go this route, your freely distributed Demo Add-in would include nag screens and limited capacity/functionality.  When they pay you for the software, you would send them the customized Add-in, based on their profile data.  They would remove the Demo version and add their customize version of the Add-in.

Thank you for the offer, but I'm not in a position to test your Add-in with Excel 2007 at this time.
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
aikimark: First things first :) May I ask your name. I find it funny addressing you by EE handle.

This Add-in is directed towards the Audience which heavily are into E-Commerce. From my client's claims, He is expecting some 1500 copies to be sold.

The addin is a NAGWARE. It will have all it's features activated. However it will show you a NAG Screen on every little option that you click.

Sid
0
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
While I can't read the help, I do LOVE the nagware.  Seems to be working!
0
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
Reminds me of VBSEdit from Adersoft - just google to find it.  I use this and you get it on every move - and it does a countdown - each one takes one more second..

See this:
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
I know what you are refering to :)

I thought of that as well but then I thought that would be an overkill... lolzzz
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
I am surprised why you are not able to open the help file...

Sid
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
@Sid

You can use aiki or Mark (my name).  There are a few other Marks that are frequently in the same thread, depending on the zone, so the aiki and aikimark are more unique references.

While you've got the time, you might want to explore the automated creation of an Add-in.  It might make for a good question (if not already asked) and would certainly make for a good article (hint hint).
0
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
I would love to understand that.  I just bolted my first two addins to bulletproof and would have loved to have had an article versus shotgunning it as I was... lol

Dave
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
@Aiki: I will stick to aiki :)
@All: I am waiting for rspahitz's comments and then I will close this thread.

Sid
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
@Sid

Since CallByName() has some overhead, you might want to simplify the WMI calls, and simplifying the VB code in the process.  It won't make much difference for the Demo version, it might be noticed for the production version.
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
Sure Aiki. Let me have a look at it.

Sid
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
@Sid

If you do delve into the custom Add-in realm, please use the Ask a Related Question link.
0
 
LVL 50

Expert Comment

by:Dave Brett
Comment Utility
Sid,

Having briefly considered commercialising my Mappit! addin I'd advise thinking it
protect the code - a critical item not mentioned yet.

1) If using xla then obfuscate the addin source code by changing all variable names to similar looking names. The best I have seen uses combos of 1 and l, damn impossibe to look at 1llll1l1l1l v 1lll11l1l11 etc. Remove comments, indentation, add in some bogus code
2) Better still, make the addin a DLL
3) On the grey side but you can use CDO to automatically email you user info on registration (bypassing Outlook)

activation

1) I like the online activation method. Else you should try tracking how easy it is to trace the changes your addin makes to the registry using the program that followed up to REGMON  - write to several places so that the users can't get a 30 day rest just by deleting the MYAPP key
2) Hard Drives are one of the more frequently replaced pc components. I wouldn't use that for ongoing license checks as it may piss off the customers that suddenly the app dies on the machine they had purchased it for

Cheers

Dave
 
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
Also be aware of user rights when you are manipulating the registry.  Some sections require elevated rights (admin or power user).

Maybe it is time to start an Add-in centric question.
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
Back from a long day :)
Sid, the distribution of points seems fair to me.  Thanks!
Definitely a fun thinking discussion.
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
0
 
LVL 30

Author Comment

by:SiddharthRout
Comment Utility
Sure aiki

Sid
0
 
LVL 30

Author Closing Comment

by:SiddharthRout
Comment Utility
Brettdj:

a) Dave, I have already protected the code
b) I like your idea of re naming the variables and removing the comments + adding bogus code. (I WILL DO THIS)
c) I cannot convert it as a dll as I have used VBA + Custom UI to make the Add-In and not VSTO unless here is another way to do it?
d) The Add-In is not limited to 30 days :) The Add-In is fully functional but is "Nagware" as I mentioned in ID: 34939785 so even if they delete the registry key, I am ok with it. I have used an awesome approach (unfortunately I cannot discuss that here) and that is why it is almost impossible to hack it until and unless you crack the VBA password.

aiki:

o register the Add-In, you need to have Administrative rights as mentioned in the Add-In so that is not my worries at the moment.

Gosh this discussion is getting so interesting. Wish I can have more points on this discussion. What I will do is close this question and then open a new one asking on making the Add-In more robust so that I can assign points to Dave(Brettdj) and Aiki for their valuable suggestions as my main query has [u]already[/u] been answered.

Dave(Brettdj) and Aiki: Could you please repost your suggestions in the next thread so that I can do full justice to them.

Sid
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Help with Journey Roadmap Graphic 11 47
Checkbox fires off a Statement 7 20
Slight Modification to Macro 2 14
Macro 3 13
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now