We ran into a problem when we shifted our device to Dell Axim x51 [spec:
OS Name: Microsoft Windows CE; OS Version: 5.1 Build 70; Processor:
StrongARM] from the iPAQ PocketPC 2003 [spec: OS Name: Microsoft
Windows CE; OS Version: 4.20 Build 1081; Processor StrongARM].

The problem is with wceload. Nothing has changed in the code when we
shifted from PPC2003 to PPC51. The parameters to wceload remains *
/noaskdest /noui "my.cab"*

After searching through the net, I realized that the behaviour of
wceload has changed from PPC2003 to PPC51.

From this link -
http://blog.opennetcf.org/afeinman/default,date,2005-04-20.aspx the OP
talks about the switch /noaskdest and its peculiar behaviour. Keeping
in tune with this fact, the parameters to wceload now became * /noui
"my.cab"*. Now WaitForSingleObject does not return anything. The
applications justs exits at this point. Though after some amount of
time, the cab gets extracted.

From yet another link -
http://support.microsoft.com/default.aspx?scid=kb;en-us;297962 I used
the boilerplate code provided there. Even for this approach, the setup
application exits just before *if (WAIT_OBJECT_0 ==
WaitForSingleObject(hEvent, INFINITE))*.

I am out of options now.

I want to know whether the analysis of wceload (on Axim 51) not able to
perform well with WaitForSingleObject is right ? Am I doing something
wrong ?

Can anyone tell me
1. What has changed in wceload
2. How to overcome the above problem.

Any other approach is welcome as well.

BTW, I have to say these cab files are not signed. Does that make any
difference ?

Thanks,
Vino.

Re: wceload breaks on Axim51 by Peter

Peter
Thu Sep 14 13:54:41 CDT 2006

wceload in WM5 no longer uses the/noaskdest /noui switches but you can use
/silent instead for the same behaviour. If the cab isn't signed and your
device is set to prompt the user will still need to accept the security
prompt. However I don't think these changes explain the behaviour with
waitforsingleobject, which is due to another change in WM5. You could work
around this by using a custom cesetup.dll in your cab so that you can signal
when installation is complete e.g. trigger a named event.

Peter

--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com

"vino" <vino.2e2ttz@no-spam-here.com> wrote in message
news:vino.2e2ttz@no-spam-here.com...
>
> We ran into a problem when we shifted our device to Dell Axim x51 [spec:
> OS Name: Microsoft Windows CE; OS Version: 5.1 Build 70; Processor:
> StrongARM] from the iPAQ PocketPC 2003 [spec: OS Name: Microsoft
> Windows CE; OS Version: 4.20 Build 1081; Processor StrongARM].
>
> The problem is with wceload. Nothing has changed in the code when we
> shifted from PPC2003 to PPC51. The parameters to wceload remains *
> /noaskdest /noui "my.cab"*
>
> After searching through the net, I realized that the behaviour of
> wceload has changed from PPC2003 to PPC51.
>
> From this link -
> http://blog.opennetcf.org/afeinman/default,date,2005-04-20.aspx the OP
> talks about the switch /noaskdest and its peculiar behaviour. Keeping
> in tune with this fact, the parameters to wceload now became * /noui
> "my.cab"*. Now WaitForSingleObject does not return anything. The
> applications justs exits at this point. Though after some amount of
> time, the cab gets extracted.
>
> From yet another link -
> http://support.microsoft.com/default.aspx?scid=kb;en-us;297962 I used
> the boilerplate code provided there. Even for this approach, the setup
> application exits just before *if (WAIT_OBJECT_0 ==
> WaitForSingleObject(hEvent, INFINITE))*.
>
> I am out of options now.
>
> I want to know whether the analysis of wceload (on Axim 51) not able to
> perform well with WaitForSingleObject is right ? Am I doing something
> wrong ?
>
> Can anyone tell me
> 1. What has changed in wceload
> 2. How to overcome the above problem.
>
> Any other approach is welcome as well.
>
> BTW, I have to say these cab files are not signed. Does that make any
> difference ?
>
> Thanks,
> Vino.
>
>



Re: wceload breaks on Axim51 by vino

vino
Fri Sep 15 00:07:54 CDT 2006


Peter,
Many thanks for the info /silent flag.

You also mentioned *However I don't think these changes explain the
behaviour with waitforsingleobject, which is due to another change in
WM5.*

This is what I understood. The behaviour of WaitForSingleObject has
changed in WM5. Can you let me know what/how exactly has changed ? The
reason I am asking is because, we still need to support PPC2003 as
well. I just want to make sure that our application is backward
compatible.

Thanks again,
Vino

'Peter Foot [MVP Wrote:
> ']wceload in WM5 no longer uses the/noaskdest /noui switches but you can
> use
> /silent instead for the same behaviour. If the cab isn't signed and
> your
> device is set to prompt the user will still need to accept the
> security
> prompt. However I don't think these changes explain the behaviour with
> waitforsingleobject, which is due to another change in WM5. You could
> work
> around this by using a custom cesetup.dll in your cab so that you can
> signal
> when installation is complete e.g. trigger a named event.
>
> Peter
>
> --
> Peter Foot
> Device Application Development MVP
> www.peterfoot.net | www.inthehand.com
>
> "vino" <vino.2e2ttz@-BLCKSPM-no-spam-here.com> wrote in message
> news:vino.2e2ttz@-BLCKSPM-no-spam-here.com...
> >
> > We ran into a problem when we shifted our device to Dell Axim x51
> [spec:
> > OS Name: Microsoft Windows CE; OS Version: 5.1 Build 70; Processor:
> > StrongARM] from the iPAQ PocketPC 2003 [spec: OS Name: Microsoft
> > Windows CE; OS Version: 4.20 Build 1081; Processor StrongARM].
> >
> > The problem is with wceload. Nothing has changed in the code when we
> > shifted from PPC2003 to PPC51. The parameters to wceload remains *
> > /noaskdest /noui "my.cab"*
> >
> > After searching through the net, I realized that the behaviour of
> > wceload has changed from PPC2003 to PPC51.
> >
> > From this link -
> > http://blog.opennetcf.org/afeinman/default,date,2005-04-20.aspx the
> OP
> > talks about the switch /noaskdest and its peculiar behaviour.
> Keeping
> > in tune with this fact, the parameters to wceload now became * /noui
> > "my.cab"*. Now WaitForSingleObject does not return anything. The
> > applications justs exits at this point. Though after some amount of
> > time, the cab gets extracted.
> >
> > From yet another link -
> > http://support.microsoft.com/default.aspx?scid=kb;en-us;297962 I
> used
> > the boilerplate code provided there. Even for this approach, the
> setup
> > application exits just before *if (WAIT_OBJECT_0 ==
> > WaitForSingleObject(hEvent, INFINITE))*.
> >
> > I am out of options now.
> >
> > I want to know whether the analysis of wceload (on Axim 51) not able
> to
> > perform well with WaitForSingleObject is right ? Am I doing
> something
> > wrong ?
> >
> > Can anyone tell me
> > 1. What has changed in wceload
> > 2. How to overcome the above problem.
> >
> > Any other approach is welcome as well.
> >
> > BTW, I have to say these cab files are not signed. Does that make
> any
> > difference ?
> >
> > Thanks,
> > Vino.
> >
> >



Re: wceload breaks on Axim51 by Peter

Peter
Fri Sep 15 03:45:10 CDT 2006

I think the difference is that wceload kicks off a new process to perform
the install and hence the handle used for the initially launched process
closes almost immediately.

Peter

--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com

"vino" <vino.2e5u5z@no-spam-here.com> wrote in message
news:vino.2e5u5z@no-spam-here.com...
>
> Peter,
> Many thanks for the info /silent flag.
>
> You also mentioned *However I don't think these changes explain the
> behaviour with waitforsingleobject, which is due to another change in
> WM5.*
>
> This is what I understood. The behaviour of WaitForSingleObject has
> changed in WM5. Can you let me know what/how exactly has changed ? The
> reason I am asking is because, we still need to support PPC2003 as
> well. I just want to make sure that our application is backward
> compatible.
>
> Thanks again,
> Vino
>
> 'Peter Foot [MVP Wrote:
>> ']wceload in WM5 no longer uses the/noaskdest /noui switches but you can
>> use
>> /silent instead for the same behaviour. If the cab isn't signed and
>> your
>> device is set to prompt the user will still need to accept the
>> security
>> prompt. However I don't think these changes explain the behaviour with
>> waitforsingleobject, which is due to another change in WM5. You could
>> work
>> around this by using a custom cesetup.dll in your cab so that you can
>> signal
>> when installation is complete e.g. trigger a named event.
>>
>> Peter
>>
>> --
>> Peter Foot
>> Device Application Development MVP
>> www.peterfoot.net | www.inthehand.com
>>
>> "vino" <vino.2e2ttz@-BLCKSPM-no-spam-here.com> wrote in message
>> news:vino.2e2ttz@-BLCKSPM-no-spam-here.com...
>> >
>> > We ran into a problem when we shifted our device to Dell Axim x51
>> [spec:
>> > OS Name: Microsoft Windows CE; OS Version: 5.1 Build 70; Processor:
>> > StrongARM] from the iPAQ PocketPC 2003 [spec: OS Name: Microsoft
>> > Windows CE; OS Version: 4.20 Build 1081; Processor StrongARM].
>> >
>> > The problem is with wceload. Nothing has changed in the code when we
>> > shifted from PPC2003 to PPC51. The parameters to wceload remains *
>> > /noaskdest /noui "my.cab"*
>> >
>> > After searching through the net, I realized that the behaviour of
>> > wceload has changed from PPC2003 to PPC51.
>> >
>> > From this link -
>> > http://blog.opennetcf.org/afeinman/default,date,2005-04-20.aspx the
>> OP
>> > talks about the switch /noaskdest and its peculiar behaviour.
>> Keeping
>> > in tune with this fact, the parameters to wceload now became * /noui
>> > "my.cab"*. Now WaitForSingleObject does not return anything. The
>> > applications justs exits at this point. Though after some amount of
>> > time, the cab gets extracted.
>> >
>> > From yet another link -
>> > http://support.microsoft.com/default.aspx?scid=kb;en-us;297962 I
>> used
>> > the boilerplate code provided there. Even for this approach, the
>> setup
>> > application exits just before *if (WAIT_OBJECT_0 ==
>> > WaitForSingleObject(hEvent, INFINITE))*.
>> >
>> > I am out of options now.
>> >
>> > I want to know whether the analysis of wceload (on Axim 51) not able
>> to
>> > perform well with WaitForSingleObject is right ? Am I doing
>> something
>> > wrong ?
>> >
>> > Can anyone tell me
>> > 1. What has changed in wceload
>> > 2. How to overcome the above problem.
>> >
>> > Any other approach is welcome as well.
>> >
>> > BTW, I have to say these cab files are not signed. Does that make
>> any
>> > difference ?
>> >
>> > Thanks,
>> > Vino.
>> >
>> >
>
>



Re: wceload breaks on Axim51 by vino

vino
Fri Sep 15 06:44:20 CDT 2006


Peter,

Thanks again for the update.

So, if the wceload kicks off a new process, then the workaround of
custom cesetup.dll will not work. Right ? Because I dont have the
required handle to wait upon.

Is there any way I can get the new wceload process that was launched ?
If so, I think I can pick up its handle and then wait upon it.

Vino.

'Peter Foot [MVP Wrote:
> ']I think the difference is that wceload kicks off a new process to
> perform
> the install and hence the handle used for the initially launched
> process
> closes almost immediately.
>
> Peter
>
> --
> Peter Foot
> Device Application Development MVP
> www.peterfoot.net | www.inthehand.com
>
> "vino" <vino.2e5u5z@-BLCKSPM-no-spam-here.com> wrote in message
> news:vino.2e5u5z@-BLCKSPM-no-spam-here.com...
> >
> > Peter,
> > Many thanks for the info /silent flag.
> >
> > You also mentioned *However I don't think these changes explain the
> > behaviour with waitforsingleobject, which is due to another change
> in
> > WM5.*
> >
> > This is what I understood. The behaviour of WaitForSingleObject has
> > changed in WM5. Can you let me know what/how exactly has changed ?
> The
> > reason I am asking is because, we still need to support PPC2003 as
> > well. I just want to make sure that our application is backward
> > compatible.
> >
> > Thanks again,
> > Vino
> >
> > 'Peter Foot [MVP Wrote:
> >> ']wceload in WM5 no longer uses the/noaskdest /noui switches but you
> can
> >> use
> >> /silent instead for the same behaviour. If the cab isn't signed and
> >> your
> >> device is set to prompt the user will still need to accept the
> >> security
> >> prompt. However I don't think these changes explain the behaviour
> with
> >> waitforsingleobject, which is due to another change in WM5. You
> could
> >> work
> >> around this by using a custom cesetup.dll in your cab so that you
> can
> >> signal
> >> when installation is complete e.g. trigger a named event.
> >>
> >> Peter
> >>
> >> --
> >> Peter Foot
> >> Device Application Development MVP
> >> www.peterfoot.net | www.inthehand.com
> >>
> >> "vino" <vino.2e2ttz@-BLCKSPM--BLCKSPM-no-spam-here.com> wrote in
> message
> >> news:vino.2e2ttz@-BLCKSPM--BLCKSPM-no-spam-here.com...
> >> >
> >> > We ran into a problem when we shifted our device to Dell Axim x51
> >> [spec:
> >> > OS Name: Microsoft Windows CE; OS Version: 5.1 Build 70;
> Processor:
> >> > StrongARM] from the iPAQ PocketPC 2003 [spec: OS Name: Microsoft
> >> > Windows CE; OS Version: 4.20 Build 1081; Processor StrongARM].
> >> >
> >> > The problem is with wceload. Nothing has changed in the code when
> we
> >> > shifted from PPC2003 to PPC51. The parameters to wceload remains
> *
> >> > /noaskdest /noui "my.cab"*
> >> >
> >> > After searching through the net, I realized that the behaviour of
> >> > wceload has changed from PPC2003 to PPC51.
> >> >
> >> > From this link -
> >> > http://blog.opennetcf.org/afeinman/default,date,2005-04-20.aspx
> the
> >> OP
> >> > talks about the switch /noaskdest and its peculiar behaviour.
> >> Keeping
> >> > in tune with this fact, the parameters to wceload now became *
> /noui
> >> > "my.cab"*. Now WaitForSingleObject does not return anything. The
> >> > applications justs exits at this point. Though after some amount
> of
> >> > time, the cab gets extracted.
> >> >
> >> > From yet another link -
> >> > http://support.microsoft.com/default.aspx?scid=kb;en-us;297962 I
> >> used
> >> > the boilerplate code provided there. Even for this approach, the
> >> setup
> >> > application exits just before *if (WAIT_OBJECT_0 ==
> >> > WaitForSingleObject(hEvent, INFINITE))*.
> >> >
> >> > I am out of options now.
> >> >
> >> > I want to know whether the analysis of wceload (on Axim 51) not
> able
> >> to
> >> > perform well with WaitForSingleObject is right ? Am I doing
> >> something
> >> > wrong ?
> >> >
> >> > Can anyone tell me
> >> > 1. What has changed in wceload
> >> > 2. How to overcome the above problem.
> >> >
> >> > Any other approach is welcome as well.
> >> >
> >> > BTW, I have to say these cab files are not signed. Does that make
> >> any
> >> > difference ?
> >> >
> >> > Thanks,
> >> > Vino.
> >> >
> >> >
> >
> >



Re: wceload breaks on Axim51 by r_z_aret

r_z_aret
Fri Sep 15 16:07:26 CDT 2006

On Fri, 15 Sep 2006 07:44:20 -0400, vino
<vino.2e6con@no-spam-here.com> wrote:

>
>Peter,
>
>Thanks again for the update.
>
>So, if the wceload kicks off a new process, then the workaround of
>custom cesetup.dll will not work. Right ? Because I dont have the
>required handle to wait upon.
>
>Is there any way I can get the new wceload process that was launched ?
>If so, I think I can pick up its handle and then wait upon it.


Ugly hacks, but:

1) I believe the "WCELOAD" is the class name for the window that is
visible while WCELOAD runs (found by using GetForegroundWindow and
GetClassName). So I use
FindWindow( _T( "WCELOAD" ), NULL )
in a loop to check whether the window is open. But first I wait 2
seconds, using Sleep( 2000 ), to give it a chance

2) After the popping out of the previous loop, I pop up a messagebox
and ask the user to dismiss it when the CAB file is done. This was
necessary on older hardware, but seems no longer needed.


>
>Vino.
>
>'Peter Foot [MVP Wrote:
>> ']I think the difference is that wceload kicks off a new process to
>> perform
>> the install and hence the handle used for the initially launched
>> process
>> closes almost immediately.
>>
>> Peter
>>
>> --
>> Peter Foot
>> Device Application Development MVP
>> www.peterfoot.net | www.inthehand.com
>>
>> "vino" <vino.2e5u5z@-BLCKSPM-no-spam-here.com> wrote in message
>> news:vino.2e5u5z@-BLCKSPM-no-spam-here.com...
>> >
>> > Peter,
>> > Many thanks for the info /silent flag.
>> >
>> > You also mentioned *However I don't think these changes explain the
>> > behaviour with waitforsingleobject, which is due to another change
>> in
>> > WM5.*
>> >
>> > This is what I understood. The behaviour of WaitForSingleObject has
>> > changed in WM5. Can you let me know what/how exactly has changed ?
>> The
>> > reason I am asking is because, we still need to support PPC2003 as
>> > well. I just want to make sure that our application is backward
>> > compatible.
>> >
>> > Thanks again,
>> > Vino
>> >
>> > 'Peter Foot [MVP Wrote:
>> >> ']wceload in WM5 no longer uses the/noaskdest /noui switches but you
>> can
>> >> use
>> >> /silent instead for the same behaviour. If the cab isn't signed and
>> >> your
>> >> device is set to prompt the user will still need to accept the
>> >> security
>> >> prompt. However I don't think these changes explain the behaviour
>> with
>> >> waitforsingleobject, which is due to another change in WM5. You
>> could
>> >> work
>> >> around this by using a custom cesetup.dll in your cab so that you
>> can
>> >> signal
>> >> when installation is complete e.g. trigger a named event.
>> >>
>> >> Peter
>> >>
>> >> --
>> >> Peter Foot
>> >> Device Application Development MVP
>> >> www.peterfoot.net | www.inthehand.com
>> >>
>> >> "vino" <vino.2e2ttz@-BLCKSPM--BLCKSPM-no-spam-here.com> wrote in
>> message
>> >> news:vino.2e2ttz@-BLCKSPM--BLCKSPM-no-spam-here.com...
>> >> >
>> >> > We ran into a problem when we shifted our device to Dell Axim x51
>> >> [spec:
>> >> > OS Name: Microsoft Windows CE; OS Version: 5.1 Build 70;
>> Processor:
>> >> > StrongARM] from the iPAQ PocketPC 2003 [spec: OS Name: Microsoft
>> >> > Windows CE; OS Version: 4.20 Build 1081; Processor StrongARM].
>> >> >
>> >> > The problem is with wceload. Nothing has changed in the code when
>> we
>> >> > shifted from PPC2003 to PPC51. The parameters to wceload remains
>> *
>> >> > /noaskdest /noui "my.cab"*
>> >> >
>> >> > After searching through the net, I realized that the behaviour of
>> >> > wceload has changed from PPC2003 to PPC51.
>> >> >
>> >> > From this link -
>> >> > http://blog.opennetcf.org/afeinman/default,date,2005-04-20.aspx
>> the
>> >> OP
>> >> > talks about the switch /noaskdest and its peculiar behaviour.
>> >> Keeping
>> >> > in tune with this fact, the parameters to wceload now became *
>> /noui
>> >> > "my.cab"*. Now WaitForSingleObject does not return anything. The
>> >> > applications justs exits at this point. Though after some amount
>> of
>> >> > time, the cab gets extracted.
>> >> >
>> >> > From yet another link -
>> >> > http://support.microsoft.com/default.aspx?scid=kb;en-us;297962 I
>> >> used
>> >> > the boilerplate code provided there. Even for this approach, the
>> >> setup
>> >> > application exits just before *if (WAIT_OBJECT_0 ==
>> >> > WaitForSingleObject(hEvent, INFINITE))*.
>> >> >
>> >> > I am out of options now.
>> >> >
>> >> > I want to know whether the analysis of wceload (on Axim 51) not
>> able
>> >> to
>> >> > perform well with WaitForSingleObject is right ? Am I doing
>> >> something
>> >> > wrong ?
>> >> >
>> >> > Can anyone tell me
>> >> > 1. What has changed in wceload
>> >> > 2. How to overcome the above problem.
>> >> >
>> >> > Any other approach is welcome as well.
>> >> >
>> >> > BTW, I have to say these cab files are not signed. Does that make
>> >> any
>> >> > difference ?
>> >> >
>> >> > Thanks,
>> >> > Vino.
>> >> >
>> >> >
>> >
>> >
>

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com

Re: wceload breaks on Axim51 by vino

vino
Sat Sep 16 05:54:58 CDT 2006


Robert,

Your hack would seem fine if the wceload window came up. Remember, I am
using the /silent flag for wceload. So I dont think there would not be
an associated UI class.

I tried the following.

1. CreateProcess --> Now I have a valid dwProcessId.
2. OpenProcess (dwProcessId, SYNCHRONIZE) --> I have a valid HANDLE
3. WaitForSingleObject on the handle I received.

Everything is fine will I reach WaitForSingleObject. When it enters
WaitForSingleObject, my application just exits. Yes the cab gets
installed. But it does no good to me because, I have further
applications to startup after cab extraction is done.

Anyway help is highly appreciated.

Vino

r_z_aret@-BLCKSPM-pen_fact.com Wrote:
> On Fri, 15 Sep 2006 07:44:20 -0400, vino
> <vino.2e6con@-BLCKSPM-no-spam-here.com> wrote:
>
> >
> >Peter,
> >
> >Thanks again for the update.
> >
> >So, if the wceload kicks off a new process, then the workaround of
> >custom cesetup.dll will not work. Right ? Because I dont have the
> >required handle to wait upon.
> >
> >Is there any way I can get the new wceload process that was launched
> ?
> >If so, I think I can pick up its handle and then wait upon it.
>
>
> Ugly hacks, but:
>
> 1) I believe the "WCELOAD" is the class name for the window that is
> visible while WCELOAD runs (found by using GetForegroundWindow and
> GetClassName). So I use
> FindWindow( _T( "WCELOAD" ), NULL )
> in a loop to check whether the window is open. But first I wait 2
> seconds, using Sleep( 2000 ), to give it a chance
>
> 2) After the popping out of the previous loop, I pop up a messagebox
> and ask the user to dismiss it when the CAB file is done. This was
> necessary on older hardware, but seems no longer needed.
>
>
> >
> >Vino.
> >
> >'Peter Foot [MVP Wrote:
> >> ']I think the difference is that wceload kicks off a new process to
> >> perform
> >> the install and hence the handle used for the initially launched
> >> process
> >> closes almost immediately.
> >>
> >> Peter
> >>
> >> --
> >> Peter Foot
> >> Device Application Development MVP
> >> www.peterfoot.net | www.inthehand.com
> >>
> >> "vino" <vino.2e5u5z@-BLCKSPM--BLCKSPM-no-spam-here.com> wrote in
> message
> >> news:vino.2e5u5z@-BLCKSPM--BLCKSPM-no-spam-here.com...
> >> >
> >> > Peter,
> >> > Many thanks for the info /silent flag.
> >> >
> >> > You also mentioned *However I don't think these changes explain
> the
> >> > behaviour with waitforsingleobject, which is due to another
> change
> >> in
> >> > WM5.*
> >> >
> >> > This is what I understood. The behaviour of WaitForSingleObject
> has
> >> > changed in WM5. Can you let me know what/how exactly has changed
> ?
> >> The
> >> > reason I am asking is because, we still need to support PPC2003
> as
> >> > well. I just want to make sure that our application is backward
> >> > compatible.
> >> >
> >> > Thanks again,
> >> > Vino
> >> >
> >> > 'Peter Foot [MVP Wrote:
> >> >> ']wceload in WM5 no longer uses the/noaskdest /noui switches but
> you
> >> can
> >> >> use
> >> >> /silent instead for the same behaviour. If the cab isn't signed
> and
> >> >> your
> >> >> device is set to prompt the user will still need to accept the
> >> >> security
> >> >> prompt. However I don't think these changes explain the
> behaviour
> >> with
> >> >> waitforsingleobject, which is due to another change in WM5. You
> >> could
> >> >> work
> >> >> around this by using a custom cesetup.dll in your cab so that
> you
> >> can
> >> >> signal
> >> >> when installation is complete e.g. trigger a named event.
> >> >>
> >> >> Peter
> >> >>
> >> >> --
> >> >> Peter Foot
> >> >> Device Application Development MVP
> >> >> www.peterfoot.net | www.inthehand.com
> >> >>
> >> >> "vino" <vino.2e2ttz@-BLCKSPM--BLCKSPM--BLCKSPM-no-spam-here.com>
> wrote in
> >> message
> >> >> news:vino.2e2ttz@-BLCKSPM--BLCKSPM--BLCKSPM-no-spam-here.com...
> >> >> >
> >> >> > We ran into a problem when we shifted our device to Dell Axim
> x51
> >> >> [spec:
> >> >> > OS Name: Microsoft Windows CE; OS Version: 5.1 Build 70;
> >> Processor:
> >> >> > StrongARM] from the iPAQ PocketPC 2003 [spec: OS Name:
> Microsoft
> >> >> > Windows CE; OS Version: 4.20 Build 1081; Processor StrongARM].
> >> >> >
> >> >> > The problem is with wceload. Nothing has changed in the code
> when
> >> we
> >> >> > shifted from PPC2003 to PPC51. The parameters to wceload
> remains
> >> *
> >> >> > /noaskdest /noui "my.cab"*
> >> >> >
> >> >> > After searching through the net, I realized that the behaviour
> of
> >> >> > wceload has changed from PPC2003 to PPC51.
> >> >> >
> >> >> > From this link -
> >> >> >
> http://blog.opennetcf.org/afeinman/default,date,2005-04-20.aspx
> >> the
> >> >> OP
> >> >> > talks about the switch /noaskdest and its peculiar behaviour.
> >> >> Keeping
> >> >> > in tune with this fact, the parameters to wceload now became *
> >> /noui
> >> >> > "my.cab"*. Now WaitForSingleObject does not return anything.
> The
> >> >> > applications justs exits at this point. Though after some
> amount
> >> of
> >> >> > time, the cab gets extracted.
> >> >> >
> >> >> > From yet another link -
> >> >> > http://support.microsoft.com/default.aspx?scid=kb;en-us;297962
> I
> >> >> used
> >> >> > the boilerplate code provided there. Even for this approach,
> the
> >> >> setup
> >> >> > application exits just before *if (WAIT_OBJECT_0 ==
> >> >> > WaitForSingleObject(hEvent, INFINITE))*.
> >> >> >
> >> >> > I am out of options now.
> >> >> >
> >> >> > I want to know whether the analysis of wceload (on Axim 51)
> not
> >> able
> >> >> to
> >> >> > perform well with WaitForSingleObject is right ? Am I doing
> >> >> something
> >> >> > wrong ?
> >> >> >
> >> >> > Can anyone tell me
> >> >> > 1. What has changed in wceload
> >> >> > 2. How to overcome the above problem.
> >> >> >
> >> >> > Any other approach is welcome as well.
> >> >> >
> >> >> > BTW, I have to say these cab files are not signed. Does that
> make
> >> >> any
> >> >> > difference ?
> >> >> >
> >> >> > Thanks,
> >> >> > Vino.
> >> >> >
> >> >> >
> >> >
> >> >
> >
>
> -----------------------------------------
> To reply to me, remove the underscores (_) from my email address (and
> please indicate which newsgroup and message).
>
> Robert E. Zaret, eMVP
> PenFact, Inc.
> 20 Park Plaza, Suite 478
> Boston, MA 02116
> www.penfact.com



Re: wceload breaks on Axim51 by Dario

Dario
Mon Sep 18 03:55:31 CDT 2006

Hi,

I have the same needs !!
I have programmed an autostart program that installs some cabs silently.
I need it to be used on a PocketPC2003 and on a WindowsMobile 5.

I have more than one cab to be in stalled, and I need a special order of
installation, so I need to block the execution of the program untill the cab
installation has ended.

I am using CreateProcess:
CreateProcess( L"\\windows\\wceload.exe", L" /noui \\Storage Card\\*.cab",
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL))

Any suggestion?



Dario



Re: wceload breaks on Axim51 by Bill

Bill
Thu Sep 21 21:30:50 CDT 2006

Use the PROCESS_INFORMATION parameter (the last parameter in the call to
CreateProcess and do a WaitForSingleObject on hProcess. Be sure to call
Closeandle for both the hThread and hProcess fields.


--
Bill Stelzel (MSFT)

This posting is provided "AS IS" with no warranties, and confers no rights.
"Dario Salvi" <dsalvi@lst.tfo.upm.es> wrote in message
news:450e5ec5@news.upm.es...
> Hi,
>
> I have the same needs !!
> I have programmed an autostart program that installs some cabs silently.
> I need it to be used on a PocketPC2003 and on a WindowsMobile 5.
>
> I have more than one cab to be in stalled, and I need a special order of
> installation, so I need to block the execution of the program untill the
> cab installation has ended.
>
> I am using CreateProcess:
> CreateProcess( L"\\windows\\wceload.exe", L" /noui \\Storage Card\\*.cab",
> NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
>
> Any suggestion?
>
>
>
> Dario
>


Re: wceload breaks on Axim51 - don't go to Sleep() by JamesFielding

JamesFielding
Sun Oct 22 10:10:03 CDT 2006


> in a loop to check whether the window is open. But first I wait 2
> seconds, using Sleep( 2000 ), to give it a chance

Nooooooooo !!!!

Okay, fellow eVC++ users... never, ever, eeeever use the Sleep()
function to just "do nothing" for a short period of time.

In theory, it's fine. In reality, Sleep() will often pump up the CPU
useage to 100%, and leave it there until your time period has
expired. That .cab file that you're trying to install has just
ground to a halt for 2 seconds. You'll then check if it's finished
(it won't have), then you'll grind it to a half for another 2 seconds..
and so on.

Below is the short function we use, as a replacement for
Sleep(), and this doesn't fall into the same trap.

void SafeSleep(long period)
{
// The Sleep() function tends to hog 100% of the CPU.
// Use this function instead.
//
// Entry: period contains the pause period in 1/1000th's of a second.
//
MSG msg;
BOOL bMessageWaiting;
long timeRemaining = period;
long startTime = GetTickCount();

do
{
// Sleep until timeout or event occurs
MsgWaitForMultipleObjects(0, 0, 0, timeRemaining, QS_ALLINPUT);
timeRemaining = period - (GetTickCount() - startTime);
if (timeRemaining <= 0)
return;

do
{
bMessageWaiting = PeekMessage(&msg, (HWND) NULL, 0, 0, PM_REMOVE);
if (bMessageWaiting)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
while (bMessageWaiting);
}
while(1);
}



James
www.PocketPCinstaller.com




"r_z_aret@pen_fact.com" wrote:

> On Fri, 15 Sep 2006 07:44:20 -0400, vino
> <vino.2e6con@no-spam-here.com> wrote:
>
> >
> >Peter,
> >
> >Thanks again for the update.
> >
> >So, if the wceload kicks off a new process, then the workaround of
> >custom cesetup.dll will not work. Right ? Because I dont have the
> >required handle to wait upon.
> >
> >Is there any way I can get the new wceload process that was launched ?
> >If so, I think I can pick up its handle and then wait upon it.
>
>
> Ugly hacks, but:
>
> 1) I believe the "WCELOAD" is the class name for the window that is
> visible while WCELOAD runs (found by using GetForegroundWindow and
> GetClassName). So I use
> FindWindow( _T( "WCELOAD" ), NULL )
> in a loop to check whether the window is open. But first I wait 2
> seconds, using Sleep( 2000 ), to give it a chance
>
> 2) After the popping out of the previous loop, I pop up a messagebox
> and ask the user to dismiss it when the CAB file is done. This was
> necessary on older hardware, but seems no longer needed.
>
>
> >
> >Vino.
> >
> >'Peter Foot [MVP Wrote:
> >> ']I think the difference is that wceload kicks off a new process to
> >> perform
> >> the install and hence the handle used for the initially launched
> >> process
> >> closes almost immediately.
> >>
> >> Peter
> >>
> >> --
> >> Peter Foot
> >> Device Application Development MVP
> >> www.peterfoot.net | www.inthehand.com
> >>
> >> "vino" <vino.2e5u5z@-BLCKSPM-no-spam-here.com> wrote in message
> >> news:vino.2e5u5z@-BLCKSPM-no-spam-here.com...
> >> >
> >> > Peter,
> >> > Many thanks for the info /silent flag.
> >> >
> >> > You also mentioned *However I don't think these changes explain the
> >> > behaviour with waitforsingleobject, which is due to another change
> >> in
> >> > WM5.*
> >> >
> >> > This is what I understood. The behaviour of WaitForSingleObject has
> >> > changed in WM5. Can you let me know what/how exactly has changed ?
> >> The
> >> > reason I am asking is because, we still need to support PPC2003 as
> >> > well. I just want to make sure that our application is backward
> >> > compatible.
> >> >
> >> > Thanks again,
> >> > Vino
> >> >
> >> > 'Peter Foot [MVP Wrote:
> >> >> ']wceload in WM5 no longer uses the/noaskdest /noui switches but you
> >> can
> >> >> use
> >> >> /silent instead for the same behaviour. If the cab isn't signed and
> >> >> your
> >> >> device is set to prompt the user will still need to accept the
> >> >> security
> >> >> prompt. However I don't think these changes explain the behaviour
> >> with
> >> >> waitforsingleobject, which is due to another change in WM5. You
> >> could
> >> >> work
> >> >> around this by using a custom cesetup.dll in your cab so that you
> >> can
> >> >> signal
> >> >> when installation is complete e.g. trigger a named event.
> >> >>
> >> >> Peter
> >> >>
> >> >> --
> >> >> Peter Foot
> >> >> Device Application Development MVP
> >> >> www.peterfoot.net | www.inthehand.com
> >> >>
> >> >> "vino" <vino.2e2ttz@-BLCKSPM--BLCKSPM-no-spam-here.com> wrote in
> >> message
> >> >> news:vino.2e2ttz@-BLCKSPM--BLCKSPM-no-spam-here.com...
> >> >> >
> >> >> > We ran into a problem when we shifted our device to Dell Axim x51
> >> >> [spec:
> >> >> > OS Name: Microsoft Windows CE; OS Version: 5.1 Build 70;
> >> Processor:
> >> >> > StrongARM] from the iPAQ PocketPC 2003 [spec: OS Name: Microsoft
> >> >> > Windows CE; OS Version: 4.20 Build 1081; Processor StrongARM].
> >> >> >
> >> >> > The problem is with wceload. Nothing has changed in the code when
> >> we
> >> >> > shifted from PPC2003 to PPC51. The parameters to wceload remains
> >> *
> >> >> > /noaskdest /noui "my.cab"*
> >> >> >
> >> >> > After searching through the net, I realized that the behaviour of
> >> >> > wceload has changed from PPC2003 to PPC51.
> >> >> >
> >> >> > From this link -
> >> >> > http://blog.opennetcf.org/afeinman/default,date,2005-04-20.aspx
> >> the
> >> >> OP
> >> >> > talks about the switch /noaskdest and its peculiar behaviour.
> >> >> Keeping
> >> >> > in tune with this fact, the parameters to wceload now became *
> >> /noui
> >> >> > "my.cab"*. Now WaitForSingleObject does not return anything. The
> >> >> > applications justs exits at this point. Though after some amount
> >> of
> >> >> > time, the cab gets extracted.
> >> >> >
> >> >> > From yet another link -
> >> >> > http://support.microsoft.com/default.aspx?scid=kb;en-us;297962 I
> >> >> used
> >> >> > the boilerplate code provided there. Even for this approach, the
> >> >> setup
> >> >> > application exits just before *if (WAIT_OBJECT_0 ==
> >> >> > WaitForSingleObject(hEvent, INFINITE))*.
> >> >> >
> >> >> > I am out of options now.
> >> >> >
> >> >> > I want to know whether the analysis of wceload (on Axim 51) not
> >> able
> >> >> to
> >> >> > perform well with WaitForSingleObject is right ? Am I doing
> >> >> something
> >> >> > wrong ?
> >> >> >
> >> >> > Can anyone tell me
> >> >> > 1. What has changed in wceload
> >> >> > 2. How to overcome the above problem.
> >> >> >
> >> >> > Any other approach is welcome as well.
> >> >> >
> >> >> > BTW, I have to say these cab files are not signed. Does that make
> >> >> any
> >> >> > difference ?
> >> >> >
> >> >> > Thanks,
> >> >> > Vino.
> >> >> >
> >> >> >
> >> >
> >> >
> >
>
> -----------------------------------------
> To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
>
> Robert E. Zaret, eMVP
> PenFact, Inc.
> 20 Park Plaza, Suite 478
> Boston, MA 02116
> www.penfact.com
>

Re: wceload breaks on Axim51 by JamesFielding

JamesFielding
Sun Oct 22 10:25:02 CDT 2006


This is a really interesting thread for us, as we've also hit all the
problems you've been seeing, whilst developing our "PocketPC
Installer" app.

The bottom line is this (here goes our trade secrets...):

For nearly all .cab files, you can kick off wceload.exe on a
PPC2002/WM2003/5 device, and wait for wceload.exe to
finish using something like this:


LPTSTR CABfilename = _T("\\Example.ARMv4.CAB");
PROCESS_INFORMATION pi = {0};
BOOL bSuccess = (CreateProcess(_T("\\windows\\wceload.exe"), CABfilename,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, &pi) != 0);
if (bSuccess)
{
if (pi.hProcess != NULL)
{
// Wait for the .cab file to finish installing..
WaitForSingleObject(pi.hProcess,INFINITE);
}
}


Lovely.
But... for a small number of .cab files, this won't work. Some
.cab files will start installing (the "Installing MyCompany Someapp"
will appear on the PDA's screen) then hang there. The status bar
doesn't show any progress at all, and you have to go into
System\Memory to shut down this process.

Remove that WaitForSingleObject() command, or replace
INFINITE with a number, and it'll install fine.

Unfortunately, wceload.exe documentation is scarce, and MS
generally tends to avoid mentioning features that have been
changed/removed, such as where the /noaskdest parameter
has mysteriously disappeared to, on WM5 devices...

The safest way to run wceload.exe and wait for it to finish
is to write a small function to go through the list of processes
running on your device, and when you find a wceload.exe one,
wait a second or two (DON'T use the Sleep() function - it
doesn't work correctly), then check for that process again.


What should be a very simple process often ends up taking
many hours to get around.


By the way, one glaringly obvious question:
Why, when I take a Microsoft .Net CF library .cab file from
Microsoft Visual Studio 2003, and install it on a PDA running
a Microsoft OS, does the device complain that it doesn't trust
/ identify the manufacturer...?

Shouldn't the default library .cab files that come with
VS2003 be signed already...? We get a lot of complaints
from users wanting to install the Microsoft .Net CF, SQL
and SQLCE .cab files silently, but they can't, as they aren't
signed. It's a little ironic, if you ask me...


James
http://www.PocketPCinstaller.com


"Bill Stelzel [MSFT]" wrote:

> Use the PROCESS_INFORMATION parameter (the last parameter in the call to
> CreateProcess and do a WaitForSingleObject on hProcess. Be sure to call
> Closeandle for both the hThread and hProcess fields.
>
>
> --
> Bill Stelzel (MSFT)
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Dario Salvi" <dsalvi@lst.tfo.upm.es> wrote in message
> news:450e5ec5@news.upm.es...
> > Hi,
> >
> > I have the same needs !!
> > I have programmed an autostart program that installs some cabs silently.
> > I need it to be used on a PocketPC2003 and on a WindowsMobile 5.
> >
> > I have more than one cab to be in stalled, and I need a special order of
> > installation, so I need to block the execution of the program untill the
> > cab installation has ended.
> >
> > I am using CreateProcess:
> > CreateProcess( L"\\windows\\wceload.exe", L" /noui \\Storage Card\\*.cab",
> > NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
> >
> > Any suggestion?
> >
> >
> >
> > Dario
> >
>

Re: wceload breaks on Axim51 - don't go to Sleep() by ctacke/>

ctacke/>
Sun Oct 22 16:18:14 CDT 2006

Sleep() will pump up CPU usage to 100%? Not possible. It doesn't guaratee
the behavior you're after, but the way Sleep is implemented in the kernel,
it's not possible for it to rob all thread quantum from the scheduler
(unless the OEM screwed something up, but then you'd see a *lot* of other
problems anyway).


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--




"JamesFielding" <JamesFielding@discussions.microsoft.com> wrote in message
news:226B7B3E-052B-4CF7-B4A3-AD31AEA06166@microsoft.com...
>
>> in a loop to check whether the window is open. But first I wait 2
>> seconds, using Sleep( 2000 ), to give it a chance
>
> Nooooooooo !!!!
>
> Okay, fellow eVC++ users... never, ever, eeeever use the Sleep()
> function to just "do nothing" for a short period of time.
>
> In theory, it's fine. In reality, Sleep() will often pump up the CPU
> useage to 100%, and leave it there until your time period has
> expired. That .cab file that you're trying to install has just
> ground to a halt for 2 seconds. You'll then check if it's finished
> (it won't have), then you'll grind it to a half for another 2 seconds..
> and so on.
>
> Below is the short function we use, as a replacement for
> Sleep(), and this doesn't fall into the same trap.
>
> void SafeSleep(long period)
> {
> // The Sleep() function tends to hog 100% of the CPU.
> // Use this function instead.
> //
> // Entry: period contains the pause period in 1/1000th's of a second.
> //
> MSG msg;
> BOOL bMessageWaiting;
> long timeRemaining = period;
> long startTime = GetTickCount();
>
> do
> {
> // Sleep until timeout or event occurs
> MsgWaitForMultipleObjects(0, 0, 0, timeRemaining, QS_ALLINPUT);
> timeRemaining = period - (GetTickCount() - startTime);
> if (timeRemaining <= 0)
> return;
>
> do
> {
> bMessageWaiting = PeekMessage(&msg, (HWND) NULL, 0, 0, PM_REMOVE);
> if (bMessageWaiting)
> {
> TranslateMessage(&msg);
> DispatchMessage(&msg);
> }
> }
> while (bMessageWaiting);
> }
> while(1);
> }
>
>
>
> James
> www.PocketPCinstaller.com
>
>
>
>
> "r_z_aret@pen_fact.com" wrote:
>
>> On Fri, 15 Sep 2006 07:44:20 -0400, vino
>> <vino.2e6con@no-spam-here.com> wrote:
>>
>> >
>> >Peter,
>> >
>> >Thanks again for the update.
>> >
>> >So, if the wceload kicks off a new process, then the workaround of
>> >custom cesetup.dll will not work. Right ? Because I dont have the
>> >required handle to wait upon.
>> >
>> >Is there any way I can get the new wceload process that was launched ?
>> >If so, I think I can pick up its handle and then wait upon it.
>>
>>
>> Ugly hacks, but:
>>
>> 1) I believe the "WCELOAD" is the class name for the window that is
>> visible while WCELOAD runs (found by using GetForegroundWindow and
>> GetClassName). So I use
>> FindWindow( _T( "WCELOAD" ), NULL )
>> in a loop to check whether the window is open. But first I wait 2
>> seconds, using Sleep( 2000 ), to give it a chance
>>
>> 2) After the popping out of the previous loop, I pop up a messagebox
>> and ask the user to dismiss it when the CAB file is done. This was
>> necessary on older hardware, but seems no longer needed.
>>
>>
>> >
>> >Vino.
>> >
>> >'Peter Foot [MVP Wrote:
>> >> ']I think the difference is that wceload kicks off a new process to
>> >> perform
>> >> the install and hence the handle used for the initially launched
>> >> process
>> >> closes almost immediately.
>> >>
>> >> Peter
>> >>
>> >> --
>> >> Peter Foot
>> >> Device Application Development MVP
>> >> www.peterfoot.net | www.inthehand.com
>> >>
>> >> "vino" <vino.2e5u5z@-BLCKSPM-no-spam-here.com> wrote in message
>> >> news:vino.2e5u5z@-BLCKSPM-no-spam-here.com...
>> >> >
>> >> > Peter,
>> >> > Many thanks for the info /silent flag.
>> >> >
>> >> > You also mentioned *However I don't think these changes explain the
>> >> > behaviour with waitforsingleobject, which is due to another change
>> >> in
>> >> > WM5.*
>> >> >
>> >> > This is what I understood. The behaviour of WaitForSingleObject has
>> >> > changed in WM5. Can you let me know what/how exactly has changed ?
>> >> The
>> >> > reason I am asking is because, we still need to support PPC2003 as
>> >> > well. I just want to make sure that our application is backward
>> >> > compatible.
>> >> >
>> >> > Thanks again,
>> >> > Vino
>> >> >
>> >> > 'Peter Foot [MVP Wrote:
>> >> >> ']wceload in WM5 no longer uses the/noaskdest /noui switches but
>> >> >> you
>> >> can
>> >> >> use
>> >> >> /silent instead for the same behaviour. If the cab isn't signed and
>> >> >> your
>> >> >> device is set to prompt the user will still need to accept the
>> >> >> security
>> >> >> prompt. However I don't think these changes explain the behaviour
>> >> with
>> >> >> waitforsingleobject, which is due to another change in WM5. You
>> >> could
>> >> >> work
>> >> >> around this by using a custom cesetup.dll in your cab so that you
>> >> can
>> >> >> signal
>> >> >> when installation is complete e.g. trigger a named event.
>> >> >>
>> >> >> Peter
>> >> >>
>> >> >> --
>> >> >> Peter Foot
>> >> >> Device Application Development MVP
>> >> >> www.peterfoot.net | www.inthehand.com
>> >> >>
>> >> >> "vino" <vino.2e2ttz@-BLCKSPM--BLCKSPM-no-spam-here.com> wrote in
>> >> message
>> >> >> news:vino.2e2ttz@-BLCKSPM--BLCKSPM-no-spam-here.com...
>> >> >> >
>> >> >> > We ran into a problem when we shifted our device to Dell Axim x51
>> >> >> [spec:
>> >> >> > OS Name: Microsoft Windows CE; OS Version: 5.1 Build 70;
>> >> Processor:
>> >> >> > StrongARM] from the iPAQ PocketPC 2003 [spec: OS Name: Microsoft
>> >> >> > Windows CE; OS Version: 4.20 Build 1081; Processor StrongARM].
>> >> >> >
>> >> >> > The problem is with wceload. Nothing has changed in the code when
>> >> we
>> >> >> > shifted from PPC2003 to PPC51. The parameters to wceload remains
>> >> *
>> >> >> > /noaskdest /noui "my.cab"*
>> >> >> >
>> >> >> > After searching through the net, I realized that the behaviour of
>> >> >> > wceload has changed from PPC2003 to PPC51.
>> >> >> >
>> >> >> > From this link -
>> >> >> > http://blog.opennetcf.org/afeinman/default,date,2005-04-20.aspx
>> >> the
>> >> >> OP
>> >> >> > talks about the switch /noaskdest and its peculiar behaviour.
>> >> >> Keeping
>> >> >> > in tune with this fact, the parameters to wceload now became *
>> >> /noui
>> >> >> > "my.cab"*. Now WaitForSingleObject does not return anything. The
>> >> >> > applications justs exits at this point. Though after some amount
>> >> of
>> >> >> > time, the cab gets extracted.
>> >> >> >
>> >> >> > From yet another link -
>> >> >> > http://support.microsoft.com/default.aspx?scid=kb;en-us;297962 I
>> >> >> used
>> >> >> > the boilerplate code provided there. Even for this approach, the
>> >> >> setup
>> >> >> > application exits just before *if (WAIT_OBJECT_0 ==
>> >> >> > WaitForSingleObject(hEvent, INFINITE))*.
>> >> >> >
>> >> >> > I am out of options now.
>> >> >> >
>> >> >> > I want to know whether the analysis of wceload (on Axim 51) not
>> >> able
>> >> >> to
>> >> >> > perform well with WaitForSingleObject is right ? Am I doing
>> >> >> something
>> >> >> > wrong ?
>> >> >> >
>> >> >> > Can anyone tell me
>> >> >> > 1. What has changed in wceload
>> >> >> > 2. How to overcome the above problem.
>> >> >> >
>> >> >> > Any other approach is welcome as well.
>> >> >> >
>> >> >> > BTW, I have to say these cab files are not signed. Does that make
>> >> >> any
>> >> >> > difference ?
>> >> >> >
>> >> >> > Thanks,
>> >> >> > Vino.
>> >> >> >
>> >> >> >
>> >> >
>> >> >
>> >
>>
>> -----------------------------------------
>> To reply to me, remove the underscores (_) from my email address (and
>> please indicate which newsgroup and message).
>>
>> Robert E. Zaret, eMVP
>> PenFact, Inc.
>> 20 Park Plaza, Suite 478
>> Boston, MA 02116
>> www.penfact.com
>>



Re: wceload breaks on Axim51 by JamesFielding

JamesFielding
Tue Oct 24 04:16:02 CDT 2006


One further complication that's come to light.

So... you've started running wceload.exe on your device, and want
to know when it's finished.

With *some* .cab files, running the following command will
make the device hang completely:

if (pi.hProcess)
WaitForSingleObject(pi.hProcess,INFINITE);

Changing the INFINITE to a number gets around this, but this
kinda assumes that your .cab file WILL have finished installing
within X seconds.

So, the alternative, you can write a function to repeatedly go through
the list of running processes, until "wceload.exe" *isn't* found in the
list.


The complication...?


You'll need to use the toolhelp.lib functions, and
CloseToolhelp32Snapshot(hand);
is *not* reliable on WM5 devices.

It's a known bug, documented on some of the newsgroups, but
there doesn't seem to be a workaround for it. Basically, this
function will work 99.9% of the time, then, for no reason, it'll throw
an exception.

For example, I can use wceload.exe to start installing
"NETCFv2.wm.armv4i.cab" on my WM5 device, and 99 times
it'll work a treat. On the 100'th time, with the same code,
and same .cab file... paff.. my application's just thrown an
exception.

My code deliberately goes through the list of processes..
does nothing for a second, then tries again... so i'm not
overloading the CPU or anything.

One newsgroup article suggests using TH32CS_SNAP_NOHEAPS
when running CreateToolhelp32Snapshot() as this'll return less
data... but this doesn't seem to exist on my environment.


Does anyone know a way around this problem ?


James


"JamesFielding" wrote:

>
> This is a really interesting thread for us, as we've also hit all the
> problems you've been seeing, whilst developing our "PocketPC
> Installer" app.
>
> The bottom line is this (here goes our trade secrets...):
>
> For nearly all .cab files, you can kick off wceload.exe on a
> PPC2002/WM2003/5 device, and wait for wceload.exe to
> finish using something like this:
>
>
> LPTSTR CABfilename = _T("\\Example.ARMv4.CAB");
> PROCESS_INFORMATION pi = {0};
> BOOL bSuccess = (CreateProcess(_T("\\windows\\wceload.exe"), CABfilename,
> NULL, NULL, NULL, NULL, NULL, NULL, NULL, &pi) != 0);
> if (bSuccess)
> {
> if (pi.hProcess != NULL)
> {
> // Wait for the .cab file to finish installing..
> WaitForSingleObject(pi.hProcess,INFINITE);
> }
> }
>
>
> Lovely.
> But... for a small number of .cab files, this won't work. Some
> .cab files will start installing (the "Installing MyCompany Someapp"
> will appear on the PDA's screen) then hang there. The status bar
> doesn't show any progress at all, and you have to go into
> System\Memory to shut down this process.
>
> Remove that WaitForSingleObject() command, or replace
> INFINITE with a number, and it'll install fine.
>
> Unfortunately, wceload.exe documentation is scarce, and MS
> generally tends to avoid mentioning features that have been
> changed/removed, such as where the /noaskdest parameter
> has mysteriously disappeared to, on WM5 devices...
>
> The safest way to run wceload.exe and wait for it to finish
> is to write a small function to go through the list of processes
> running on your device, and when you find a wceload.exe one,
> wait a second or two (DON'T use the Sleep() function - it
> doesn't work correctly), then check for that process again.
>