How to make only first hard-disk installed running
Hello Master,
Can someone here help me.
Story :
1 year ago I bought a software, and i installed to my C drive with success, it's working perfectly no any problem, then i
tried to make a copy that software using another hard-disk, through a cloning software i purchase, and surprised that
software when i running his asking for a serial number.
Here are the code i found on the google :
Code:
Private Declare Function GetVolumeInformation Lib _
"kernel32.dll" Alias "GetVolumeInformationA" _
(ByVal lpRootPathName As String, _
ByVal lpVolumeNameBuffer As String, _
ByVal nVolumeNameSize As Integer, _
lpVolumeSerialNumber As Long, _
lpMaximumComponentLenght As Long, _
lpFileSystemFlags As Long, _
ByVal lpFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) As Long
Public Function DriveSerialNumber(ByVal Drive _
As String) As Long
Dim x As Long
Dim y As Long
Dim sVolumeName As String, sDriveType As String
Dim sDrive As String
sDrive = Drive
sVolumeName = String$(255, Chr$(0))
sDriveType = String$(255, Chr$(0))
y = GetVolumeInformation(sDrive, sVolumeName, _
255, x, 0, 0, sDriveType, 255)
DriveSerialNumber = x
End Function
Private Sub Form_Load()
Label2 = DriveSerialNumber("C:\")
End Sub
Above code just read the serial number of hard-disk.
My scheme & plan :
1). First time running and installed to first hard-disk, the program stored the data information.
2). Once the program was installed on first hard-disk, then installed or running to another hard-disk, then give an
message or errors.
Re: How to make only first hard-disk installed running
Originally Posted by SamOscarBrown
Okay Bad...
What "message or errors" are you receiving?
I simply copied your code into a new project and it appears to work fine (at least I get some sort of number in Label2).
Hello Brown,
My code above is working fine, Label 2 will given an information your hard-disk, but it not my point.
My goal is, once you have that serial number into your first installation on C, then you tried to installed to another hard-disk then you get message or an error, that my question.
Re: How to make only first hard-disk installed running
I get it... he's trying to add the above code to his program so that when someone installs his program, they can only install it once it once to the first hard drive.... so if they then try to move it to a different drive, it won't work.
to the OP - once you get the info you want... you need to store it somewhere... in this case the best place to store it is probably the registry... then when the app starts you need to read it from the registry, and compare it to the values you just read... if they are the same, fine, if not, the tell the user and exit the program.
Re: How to make only first hard-disk installed running
Originally Posted by techgnome
I get it... he's trying to add the above code to his program so that when someone installs his program, they can only install it once it once to the first hard drive.... so if they then try to move it to a different drive, it won't work.
to the OP - once you get the info you want... you need to store it somewhere... in this case the best place to store it is probably the registry... then when the app starts you need to read it from the registry, and compare it to the values you just read... if they are the same, fine, if not, the tell the user and exit the program.
-tg
I read it the exact opposite. I think OP bought software that is device-locked in some fashion, tried to circumvent the device-lock mechanism by doing a drive clone, the drive-clone process wasn't enough for the software to be tricked, and now OP wants further assistance in circumventing this program's copy protection.
Edit - on second read, I think you are right. OP was giving the example of a program that they purchased that functions in the way they want their own software to function, and are looking for a way to implement that.
Re: How to make only first hard-disk installed running
Originally Posted by techgnome
I get it... he's trying to add the above code to his program so that when someone installs his program, they can only install it once it once to the first hard drive.... so if they then try to move it to a different drive, it won't work.
to the OP - once you get the info you want... you need to store it somewhere... in this case the best place to store it is probably the registry... then when the app starts you need to read it from the registry, and compare it to the values you just read... if they are the same, fine, if not, the tell the user and exit the program.
-tg
Hello Techgnome,
Most they make the program just stored on registry, etc....on registry they put in just days or times to open, then expired, i know this method, i have done with this, i just want to know how to use hard-disk serial number to stored.
Your explanation is what i thinking, the question is how to do it, could you please describes the flow or you give some samples here.
Re: How to make only first hard-disk installed running
It's the same concept... first time the app runs, you get the info from the hard drive and you store it in the registry, or some place secure... then on subsequent runs, you get the info again from the hard drive, and compare it to what you saved in the registry (or where ever you stored it the first time) ... if it doesn't match, you assume it's been moved or cloned.
Re: How to make only first hard-disk installed running
I'd argue against doing this in the first place. While I can see the obvious advantage, as it avoids a particular kind of piracy, it will harm a bunch of legitimate users, including myself. I believe it was Joel Spolsky who put me onto this (though it may have been some other blog), but I periodically clone my SSD drive such that, when the current one fails, I can remove it, swap in the other, and be up and running.
It hadn't really occurred to me, until this thread, that there may be some software locked down by the HD serial code, though I've certainly heard of that being done before. It would really only be a minor inconvenience for me, as long as the company was still in business, and most software doesn't do that (or at least most that I use doesn't do that), but it is an inconvenience that I hadn't thought about.
So, I almost built this system around a RAID array. How would your software work with that? Depending on the RAID level, the software would actually install onto multiple HD at the same time in the same system. It seems like, in the worst case scenario, the software would be on one drive, that failed, and the array switched to using a different system....and the software just ceases to work.
On the other hand, I don't have a better solution, since that's not something I deal with, but you've already experienced one of the problems that can arise from tying software to a particular drive. Dealing with a RAID based system would introduce a worse problem. Do you really want to go there?
Re: How to make only first hard-disk installed running
but why do you want to limit it to just 1 drive.
if the customer bought your product, why can't he install it where he desire, as long its in the same system.
if you don't want the product to be pirated, its better to choose some other protection.
if I pay for a product and I buy a new computer, what then? I need to buy it again?
protections need to be smart, not a hindrance for the customer.
theres other problems. how to know when to "register" the harddrive?
if we have the setup program, we could simply use that to make copies.
if you simply release an executable, you always need to make the first run, to attach the executable to the drive.
we could simply copy the un-used executable in each computer.
if you use an online-registration, how long will that last? if the site stop working, we would not be able to register again.
Re: How to make only first hard-disk installed running
I read the OP differently...
He purchased a program about a year ago on a single-use license. During the original installation, his license key was linked to his hardware configuration - maybe just the system disk drive, or maybe more complexly. ( like the old Windows XP license would allow some hardware variations before deciding it was a new machine).
He wants a new system disk and has cloned his original to the new and the software license has become invalid.
I think the code he has posted is his attempt to read the drive information and see what is different between the two drives and maybe (try to) alter the new drive information to match the one originally installed on.
If so and the company he originally bought the software from still trades, I would think he could just contact them and get a new 'license key' if he can satisfy them that its still just one PC he's using it on.
Re: How to make only first hard-disk installed running
Originally Posted by baka
but why do you want to limit it to just 1 drive.
if the customer bought your product, why can't he install it where he desire, as long its in the same system.
if you don't want the product to be pirated, its better to choose some other protection.
if I pay for a product and I buy a new computer, what then? I need to buy it again?
protections need to be smart, not a hindrance for the customer.
theres other problems. how to know when to "register" the harddrive?
if we have the setup program, we could simply use that to make copies.
if you simply release an executable, you always need to make the first run, to attach the executable to the drive.
we could simply copy the un-used executable in each computer.
if you use an online-registration, how long will that last? if the site stop working, we would not be able to register again.
theres a number of issues with protection locks.
Hello Baka,
My goal are :
1). I want to know, and tried to build same as company that software I bought.
2). I want try, it's working or not, 1 licence only 1 hard-disk.
3). I was done with another trick, using : how many times click, and by date
Code:
Sub TrialVersion()
Dim a As Date
Dim b As Date
Dim result As String
On Error GoTo errorhandler
hasil = GetStringValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MWinbadjuri", "Status")
If result = "Error" Or result = "" Then
CreateKey "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MWinbadjuri"
SetStringValue "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MWinbadjuri", "Status", "Z"
End If
If GetStringValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MWinbadjuri", "Status") = "z" Then
MsgBox "Sorry, your time to use this software has been finish", vbOKOnly + vbCritical, "Trial Expired"
End
End If
c = GetStringValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MWinbadjuri", "Akhir")
a = Format(Date, "MM/DD/YY")
If a < b Then
MsgBox "Sorry, your time to use this software has been finish", vbOKOnly + vbCritical, "Trial Expired"
SetStringValue "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MWinbadjuri", "Status", "z"
End
End If
Exit Sub
errorhandler:
End Sub
and also by message, mean is : when they want to installed it software, then they should be type his name and automaticly the computer and hard-disk serial number store the information then they need to give serial code to me, once receive it, i will encode that serial code and then sent it back to they to unlock the code or licence.
Re: How to make only first hard-disk installed running
Originally Posted by MikeSW17
I read the OP differently...
He purchased a program about a year ago on a single-use license. During the original installation, his license key was linked to his hardware configuration - maybe just the system disk drive, or maybe more complexly. ( like the old Windows XP license would allow some hardware variations before deciding it was a new machine).
He wants a new system disk and has cloned his original to the new and the software license has become invalid.
I think the code he has posted is his attempt to read the drive information and see what is different between the two drives and maybe (try to) alter the new drive information to match the one originally installed on.
If so and the company he originally bought the software from still trades, I would think he could just contact them and get a new 'license key' if he can satisfy them that its still just one PC he's using it on.
Hello MikeSW17,
Yes you are true.
The code i posted here, it's just the drive information, then i want to share to a master how could i do, could be you have done or have an idea and give some sample here.
The company doesn't give the licence key, because they say that was copy, the original licence only valid with first time installed copy, if you broke the hard-disk then need to purchase new licence, refer to this concept then i want to tried how to make same thing they concept.