From: harry on
Dear Experts,


I am, trying to build a smart application updater for my Windows CE
5.0 device running on LXE MX7.
I manage to implement if there's a new update the application will
download the update to the device with the webservice.

Once the download have been completed I am having this problem when
trying to launch CAB files with this procedure :

// When cab download is finished, launch it. This will cause
// wceload.exe to initiate installation process
private void AllDone(object sender, System.EventArgs e)
{



Cursor.Current = Cursors.Default;

string docname = GetCurrentDirectory() + @"\download.cab";
SetSecurityFlag(1);

try
{
ToolHelp.Process[] process =
ToolHelp.Process.GetProcesses();
ArrayList strProc = new ArrayList();

foreach (object obj in process)
{
if (obj.ToString() == "TestApp.exe")
{
strProc.Add(obj.ToString());
}

if (strProc.Count > 0)
{
ToolHelp.Process proc = (ToolHelp.Process)obj;
proc.Kill();
GC.Collect();
}
}

Process updater = Process.Start("\\windows\
\wceload.exe", "/silent /noui \"Program Files\\updater\\download.cab
\"");
updater.WaitForExit(60000);

SetSecurityFlag(0);


}
catch(Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}

}

the download.cab is going to install TestApp.exe on my device, when it
tries to run I got this error :

The fle "\System\TestApp\TestApp.exe" Is In Use or Is in ROM. If the
file is not in ROM, please close tha application using the file

as you see in the above code, I have implement a method for detecting
whether the process TestApp.Exe is running, and kill if it run.

the error remains about 45 seconds, after 45 seconds I can install the
CAB. and launch the TestApp.exe and see the assembly is updated with
the new version

Please advice

Best Regards,
Harry Nurman



From: Peter Foot [MVP] on
If it takes 45 seconds for your application to close down then perhaps you
have some background threads which are still running - waiting on a system
handle perhaps? Without knowing what your app does I can't provide any more
detail than that but hopefully that gives you an area to concentrate on.

Peter


"harry" <ryman305(a)yahoo.com> wrote in message
news:5ddfdd9a-e93d-45fc-89b5-13753225fd92(a)t34g2000prm.googlegroups.com...
> Dear Experts,
>
>
> I am, trying to build a smart application updater for my Windows CE
> 5.0 device running on LXE MX7.
> I manage to implement if there's a new update the application will
> download the update to the device with the webservice.
>
> Once the download have been completed I am having this problem when
> trying to launch CAB files with this procedure :
>
> // When cab download is finished, launch it. This will cause
> // wceload.exe to initiate installation process
> private void AllDone(object sender, System.EventArgs e)
> {
>
>
>
> Cursor.Current = Cursors.Default;
>
> string docname = GetCurrentDirectory() + @"\download.cab";
> SetSecurityFlag(1);
>
> try
> {
> ToolHelp.Process[] process =
> ToolHelp.Process.GetProcesses();
> ArrayList strProc = new ArrayList();
>
> foreach (object obj in process)
> {
> if (obj.ToString() == "TestApp.exe")
> {
> strProc.Add(obj.ToString());
> }
>
> if (strProc.Count > 0)
> {
> ToolHelp.Process proc = (ToolHelp.Process)obj;
> proc.Kill();
> GC.Collect();
> }
> }
>
> Process updater = Process.Start("\\windows\
> \wceload.exe", "/silent /noui \"Program Files\\updater\\download.cab
> \"");
> updater.WaitForExit(60000);
>
> SetSecurityFlag(0);
>
>
> }
> catch(Exception ex)
> {
> MessageBox.Show(ex.Message.ToString());
> }
>
> }
>
> the download.cab is going to install TestApp.exe on my device, when it
> tries to run I got this error :
>
> The fle "\System\TestApp\TestApp.exe" Is In Use or Is in ROM. If the
> file is not in ROM, please close tha application using the file
>
> as you see in the above code, I have implement a method for detecting
> whether the process TestApp.Exe is running, and kill if it run.
>
> the error remains about 45 seconds, after 45 seconds I can install the
> CAB. and launch the TestApp.exe and see the assembly is updated with
> the new version
>
> Please advice
>
> Best Regards,
> Harry Nurman
>
>
>
 | 
Pages: 1
Prev: Grid Columns
Next: Language message