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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

intheCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.