0

I am using Hard disk ID for my software to check if the authentic user is using the software. For IDE type hard disk i get the id using the procedure GetIdeSerialNumber.

but in case of SATA drives it gives the id as blank.

Then in case of SATA drives i am using volume id as unique id.

but volume id will change when system is formatted

Now I want to know which hard drive i am using ,and how to get the hard disk id of SATA drive in delphi 7 ?

EDIT: the software according to client specifications needs to be locked to the hardware, the ID's concerned are

  1. MAC address
  2. HD id (SATA or IDE)
  3. Controller ID (this is motor to drive the hardware of which the software is delvped, the ID is unique)

The client has accpted the if system is changed the the authentication layer will fail, but we have been given the go ahead for the software locking to hardware..

so i wanted to know how to get the SATA ID

PresleyDias
  • 3,657
  • 6
  • 36
  • 62
  • 7
    Augh. Please don't tie software installation to a particular hard drive. The software could be installed on RAID volume. How will you handle that? – Kyle Jones Jan 12 '12 at 06:38
  • 3
    Or when the drive fails and has to be replaced, and then everything restored from a backup? – Ken White Jan 12 '12 at 14:46
  • 2
    possible duplicate of [in Delphi7, How can I retrieve hard disk unique serial number?](http://stackoverflow.com/questions/5202270/in-delphi7-how-can-i-retrieve-hard-disk-unique-serial-number) – RRUZ Jan 12 '12 at 15:37
  • @all, the client has been notified that it will create problems if hte HD us changed or some different PC is used, but they want the Software to be locked to the system,On which the software was installed. – PresleyDias Jan 13 '12 at 06:30
  • As an aside, make sure you use multiple identifiers. The hard disk serial in itself is not enough, it is often not unique. I have seen serial number being '0000...0000' . – Jan Doggen Jan 13 '12 at 13:47

1 Answers1

3

WMI is your best bet for retrieving the hard drive serial number, though older versions of Windows (95 and 98) aren't supported.

I recommend that you use the volume serial number. It's hardware agnostic. It will be tied to that installation of Windows instead of the physical hard drive. This makes a lot of sense and should be good enough.

Note that the user will have to reactivate if they reinstall Windows or some other restore situations, so you need to allow some leeway. That's the trickiest part to implement. Of course, that's the reason to use multiple IDs. You allow one or more to change, just not all of them, without requiring reactivation.

Marcus Adams
  • 53,009
  • 9
  • 91
  • 143