PDA

View Full Version : APMS 'File Location' Checking...


ltatkinson
11-26-2002, 06:40 AM
For security / copying reasons, I would like my APMS project to check where it's running from ( for example, a CD-ROM drive ), so that if it's not running from that location the end-user will be treated to a rude message.

Does anyone know how to do this ???

Many thanks in advance !!!

eric_darling
11-26-2002, 07:47 AM
I am sure there's a way to do this (I don't know), but I'm curious as to why you'd want to? Most people who would steal by copying would make a copy to the same media type - not to the hard drive. Therefore, they wouldn't get a rude message anyway.

Derek
11-26-2002, 07:59 AM
There isn't a 'DriveType' in AMS, so as soon as I read this I figured you would give us a dll to work with, Worm.
Thanks so much /ubbthreads/images/icons/smile.gif

[lol ... even tho you moved it down the list below this post!]

Worm
11-26-2002, 07:59 AM
This sample will distinguish between a removable disk, fixed disk, network/remote disk, cd-rom disk, or RAM disk.

It uses the GetDriveTypeA function from the Kernel32.dll

Best of luck

14560-DriveType.zip (http://www.indigorose.com/ubbthreads/uploads/14560-DriveType.zip)

Worm
11-26-2002, 08:05 AM
I noticed that I left some of my debug code in the script. If you downloaded the original, the %DRIVE% variable was set to a drive letter, not pulled from the %SrcDrv%.

I hoped I'd deleted it before anyone had a chance to read it.

You're mighty Quick!!

Derek
11-26-2002, 08:09 AM
"You're mighty Quick!!"

Quicker than the eye ... I got a copy of the fist attachment too!
Does it make a difference to the results?

Worm
11-26-2002, 08:17 AM
Yes and no, in the first one I had the variable %Drive% set to "N:\" so it was always going to check to see what type of drive the N: drive was. In the one that's posted, it will check the drive that the AMS4 app is ran from.

Corey
11-26-2002, 02:28 PM
Worm for president.

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Worm
12-01-2002, 05:58 AM
I guess I would be a typical president. Using the wrong tools most of the time.

I've been using AMS much more recently and found that there is an Action built right into AMS that does the same thing.

In the actions, Under System, choose Drive Information, change the property to Type and you'll get the same results.

Too easy I guess.

Corey
12-01-2002, 06:08 AM
Oh I see, oops, I could have told you that... /ubbthreads/images/icons/smile.gif I misunderstood the question, good ol' Worm... I must start reading these things more closely. /ubbthreads/images/icons/smile.gif

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)