All Forums
 Microsoft Windows CE
 CE Sample Applications and Utilities
 eVC - ADSAutorun.exe
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 01 Apr 2003 :  15:13:09  Show Profile  Email Poster
ADSAutorun

ADSAutorun is a utility to allow a user to automatically run an application when an ATA card is inserted into an ADS device. The following are the rules for ADSAutorun's operation:

  1. ADSAutorun must be run once to register for card notifications. If you use it as ADSLOAD.EXE, it will automatically run on boot. This is the recommended usage.
  2. When an ATA card is inserted, ADSAutorun searches the card for the following file: "\Storage Card{n}\autorun.exe". This allows autorun to work in either slot on boards with multiples.
  3. If the file exists, it is copies to the local filesystem at the following location: "\temp\autorun{n}.exe" where n is the slot it was copied from.
  4. The file is run with a command line of "/INSERT" this allows the application to react appropriately.
  5. On card removal the local temp version on autorun.exe is run, this time with a command line of "/REMOVE". This allows the application to do any necessary cleanup. If no action is desired, you still *must* handle this case because the application is still called. ADSAutorun *blocks* at this point!
  6. Once the app completes, ADSAutorun deletes the temporary file.

Key APIs Used

CeRunAppAtEvent
RegCreateKeyEx
RegQueyValueEx
RegSetValueEx
CopyFile
CreateProcess

Lines of Code: 98


Source Download

Rev 1 - April 1, 03 (19k zip).


thompsonco

4 Posts

Posted - 03 Feb 2004 :  15:48:56  Show Profile  Email Poster
This looks like exactly what I want to do. However the instructions are a bit cryptic. From what I can make out, the application file that you want to run must be included as Autorun2.exe? Having an example would really help clarify this. Basically I want to copy my application files from a CF in my ATA PCMCIA slot into flash and run it.

Rick Thompson
Go to Top of Page

ctacke

877 Posts

Posted - 03 Feb 2004 :  15:59:25  Show Profile  Email Poster
Sorry that the directions aren't clear. Here's an example:

  1. Compile ADSAutorun.exe
  2. Rename ADSAutorun.exe to "ADSLOAD.EXE" and burn it to flash
    Now whenever your device starts, ADSAutorun will automatically launch, which in turn will look for notifications that a card has been inserted.
  3. Rename your app to "Autorun.exe"
  4. Copy the new Autorun.exe app (your app) to the root folder of an ATA storage card
  5. Insert the card into your device
    At this point ADSAutorun.exe (now running as ADSLOAD.EXE) will detect the card insertion. It then will look in the card's root folder for autorun.exe (your app). When it finds it, it will copy it to the device's \Temp directory and run it from there.



Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000