autorun a *.cab from SD


A

Alex Feinman [MVP]

1) You need to check the args[0] for "uninstall" and do nothing in that
case. The autrorun app is invoked both on insert and remove with different
parameters
2) The names assigned to the storage card differ between devices and OS
versions. A correct way to detect the path is to use
FindFirstFlashCard/FindNextFlashCard. The OS will look in the newly inserted
card's 2577 directory
3) You can't unless the unmanaaged app will invoke your managed app
 
Ad

Advertisements

O

Ofer B.

Hi all,

I wrote this autorun console application that install a cab from a SD card
when I insert the card to the device
I use only 2003 devices so I can write it in manage code.

I put the cabs and the autorun.exe in "2557" directory.

This is the code for the autorun console application than install my
application, the SQL CE cab, and the CF cab.

============================================================================
============
/// <summary>
/// Summary description for autorun.
/// </summary>

class autorun
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
try
{
File.Copy("\\Storage Card\\2577\\LorealSalesForce_PPC.ARMV4.CAB",
"\\Temp\\SalesForce_PPC.ARMV4.CAB", true);
ProcessHandler.CreateProcess("\\Windows\\wceload.exe",
"\\Temp\\SalesForce_PPC.ARMV4.CAB");

File.Copy("\\Storage Card\\2577\\sqlce.wce4.armv4.CAB",
"\\Temp\\sqlce.wce4.armv4.CAB", true);
ProcessHandler.CreateProcess("\\Windows\\wceload.exe",
"\\Temp\\sqlce.wce4.armv4.CAB");

File.Copy("\\Storage Card\\2577\\netcf.all.wce4.ARMV4.cab",
"\\Temp\\netcf.all.wce4.ARMV4.cab", true);
ProcessHandler.CreateProcess("\\Windows\\wceload.exe",
"\\Temp\\netcf.all.wce4.ARMV4.cab");
}
catch(Exception ex)
{
throw ex;

}
}
}

============================================================================
============

It works, but I have some problems
1.. When I take the SD card out from the device I get a
"FileNotFoundExeption" ???
2.. It works fine on QTEK 2020 but it is not working on my IPAQ 2215. The
SD directory name in IPAQ 2215 is "SD Card" and there is another directory
called "iPAQ File Store", the internal memory card of the device. The device
is looking for the "autorun.exe" in this directory and not in the SD card.
How can I tell the device that I want to use the "SD Card" directory for the
"autorun.exe"???
3.. If I already have a "autorun.exe" (un manage") on the SD card, How can
I add my "autorun.exe"???
Thanks,
Ofer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top