varshvin
August 12th, 2001, 06:50 AM
sir,
i have developed a software. now i want to write it on the CD.
but my problem is to make the cd licensed.i.e
i what i want to do is when i want to run the program i should have a cd within the cdrom drive. and if the cd is not there then program should not run.
what should i do to get success in this situation.
please help me
thankx
Cakkie
August 13th, 2001, 01:15 AM
Well, you must need something to identify your cdrom, and you need to make sure you write away from where the setup is done.
The first thing can be done using some file that needs to be there, lets say key.dat. Then we need to know where to look for it (let's say we write that to a file on hard disk. This has to be done from the setup, or, just before the setup.
First things first, we write away the file containing the location
ffile = freefile
open "c:\cdlocation.dat" for output as #ffile
print #ffile, app.path
close #ffile
I used c:\cdlocation.dat, you should probably store the information somewhere else, like the registry, but this is just an example. The thing you can do here (otherwise this would mean you having to write your own setup program) is to create a setup using the package and deployment wizard, rename the setup.exe to sup.exe (or something). Then you create your little install (code above), and add a line to call the sup.exe (real setup). Then compile to setup.exe. This way, users will most likely run your program instead of the real setup. The code to call the real program:
Shell App.Path & "setup.exe"
Now we check for the file when the program is run
open "c:\cdlocation.dat" for input as #ffile
line input #ffile, strCDPath
close #ffile
if Dir(strCDPath & "key.dat") = "" then
MsgBox Żou must insert the CD before starting the program"
End
end if
This will show a message when the CD isn't in the drive, and will exit the program.
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook