Floppy question

I want to run a small application from a floppy (various reasons), I don't want this app to be copied to or run from anywhere else. Is there I way that when my app starts I can check to see if it is about to run from the floppy and if no stop the run if so how can it be done?. I presume I would have to do some checking in the dpr file.

looking at ya
xpher

ps Merry Xmas to all who care
LVL 1
xpherAsked:
Who is Participating?
 
intheConnect With a Mentor Commented:
hi xpher,
i also did this once and used the following :
 http://inthe.future.easyspace.com/delphi/floppy.html

just shows how to check the floppy serial number so what you do is hard code the serial number of the floppy into the program and the program can check the number on startup and if it not correct then close/terminate the program.
Regards Barry

also Merry Xmas :-)
0
 
edeyCommented:
or you could try using a combination of these apis:

UINT GetDriveType(

    LPCTSTR lpRootPathName       // address of root path
   );

BOOL GetDiskFreeSpace(

    LPCTSTR lpRootPathName,      // address of root path
    LPDWORD lpSectorsPerCluster,      // address of sectors per cluster
    LPDWORD lpBytesPerSector,      // address of bytes per sector
    LPDWORD lpNumberOfFreeClusters,      // address of number of free clusters  
    LPDWORD lpTotalNumberOfClusters       // address of total number of clusters  
   );


This would be able to tell you if the exe is on a removable drive without too much free space


GL
Mike
0
 
xpherAuthor Commented:
Thanks for the comments. Interesting visuals on the url inthe. The idea of the serial number I don't think will work because more than one copy of the app will be distributed. Although I must admit I haven't checked if I can dictate the serial number. The problem I have is that the app will be placed onto disks by someone who by his own admission is not computer savvy.

Will get back to you sometime this millenium

cheers
xpher
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
brainwareCommented:
Well you can just make a small tool to set the same SERIAL-Number on the Floppys, i once wrote an alike tool in DOS for a Company for both Floppys and Harddrives.
0
 
intheCommented:
i go with that brainware :-)
(ive got the code for it setting the serials also).
0
 
brainwareCommented:
Inthe: if you got somthing that can work under WinNT 4/5 plz send it to me will ya..or post here..

I think i only have it in my old ASM/Pascal collection and most of that causes NT Crashes..

brainware@cyberjunkie.dk
0
 
xpherAuthor Commented:
Barry any chance of that code? I will increase the points to 100 if you wish.
If you don't want to post it here I can give you my email address.

Regards
xpher
0
 
xpherAuthor Commented:
Barry ignore that last comment I've got the code from a previous question that you answered.

cheers
xpher
0
 
xpherAuthor Commented:
Barry the project downloaded from your site throws a compiler error at me.

In the function the line @SerialNumber, a, b, nil, MAX_PATH); I get [Error] Unit1.pas(35): Types of actual and formal var parameters must be identical

cheers
xpher
0
 
intheCommented:
hi xpher,

change the following line in the vars:

a, b : Integer;

  to

a, b : Cardinal;


that code was for d3 ..i just tried it in d4 and got same error but its ok after changing to cardinal.
cheers
0
 
xpherAuthor Commented:
Appreciated

All the best
xpher
0
All Courses

From novice to tech pro — start learning today.