Launching external app

  • Thread starter Thread starter Vitaly Zayko
  • Start date Start date
V

Vitaly Zayko

Hi all!
How to launch an external exe-file on PocketPC from C# application? For
example if I need to open help file I need to run peghelp.exe
Thanks!
Vitaly
 
I also need to open an external application (a CAB-file to be more
precise) - I looked at the SDF but couldn't find the Process class - could
you tell me where it is ?

Does the new app2 that I start from app1 reside on the same thread as app1 ?
I would like to close app1 as soon as app2 is started..

thanks,
jez
 
jez said:
I also need to open an external application (a CAB-file to be more
precise) - I looked at the SDF but couldn't find the Process class - could
you tell me where it is ?

Yup - it's in the OpenNETCF.Diagnostics namespace.
Does the new app2 that I start from app1 reside on the same thread as app1 ?
I would like to close app1 as soon as app2 is started..

Processes never share threads. Just close your app after you've started
the other one.

I don't know exactly what it'll do when you try to start a CAB as a
process, however. If you want it to be installed, you should start
\Windows\wceload.exe with the cab filename as the parameter.
 
I don't know exactly what it'll do when you try to start a CAB as a
process, however.

It will fail as CABs are not directly executable.
If you want it to be installed, you should start
\Windows\wceload.exe with the cab filename as the parameter.

Yep. passing the /noui and/or the /noaskdest parameter is also useful.

-Chris
 
thanks for that! I'll have a look at it now/tomorrow and will let you know
how it is (or is not..) going. I did find the following thread useful (for
those interested in CAB file installations with ShellExecute) :
 
Chris Tacke said:
Yep. passing the /noui and/or the /noaskdest parameter is also useful.

Ooh... didn't know about those parameters. They could be rather handy.
Not sure about /noaskdest though - when installing using wceload, I
don't get asked about a destination anyway. It all just happens unless
a file needs to be overwritten, or the app is already installed.

Are those definitely parameters to wceload and not to CeAppMgr on the
desktop? I'd be *extremely* happy if the latter is the case :)
 
Jon Skeet said:
Ooh... didn't know about those parameters. They could be rather handy.
Not sure about /noaskdest though - when installing using wceload, I
don't get asked about a destination anyway. It all just happens unless
a file needs to be overwritten, or the app is already installed.

Are those definitely parameters to wceload and not to CeAppMgr on the
desktop? I'd be *extremely* happy if the latter is the case :)

I'm about 90% certain they are - I'd have to go back and check. The pain in
the ass is that none of these are documented.
 
ok well.. can't get that CAB file installed. On my PPC (Symbol PPT8846) I
couldn't find wceload.exe (in the windows folder), I think it uses
wceldcmd.exe instead.

I did a "use OpenNETCF.Diagnostics;" and in a method I used the following :
Process.Start("wceldcmd.exe", "'\\My Documents\\myProject_PPC.ARM.cab'");

When I execute the method nothing happens.. no error or anything. I also
tried using the /noui as recommended by Chris.

Any tips/hints ?
 
jez said:
ok well.. can't get that CAB file installed. On my PPC (Symbol PPT8846) I
couldn't find wceload.exe (in the windows folder), I think it uses
wceldcmd.exe instead.

Not sure - it's not visible on my box either, but it's definitely
there. I think it may be hidden.
I did a "use OpenNETCF.Diagnostics;" and in a method I used the following :
Process.Start("wceldcmd.exe", "'\\My Documents\\myProject_PPC.ARM.cab'");

When I execute the method nothing happens.. no error or anything. I also
tried using the /noui as recommended by Chris.

Any tips/hints ?

You need to specify the full path name to the executable, so

@"\Windows\wceload.exe" or @"\Windows\wceldcmd.exe"

According to a google search, wceldcmd is a non-GUI version of wceload.
 
Still doesn't work. This is the latest code :

string _cabFile = @"\My Documents\myProject_PPC.ARM.cab";
Process.Start(@"\Windows\wceldcmd.exe", _cabFile);

Am I using Process.Start() correctly ? Maybe that is the problem ?
 
jez said:
Still doesn't work. This is the latest code :

string _cabFile = @"\My Documents\myProject_PPC.ARM.cab";
Process.Start(@"\Windows\wceldcmd.exe", _cabFile);

Am I using Process.Start() correctly ? Maybe that is the problem ?

You should put your parameter in quotes, as it will currently be parsed
as

\My
Documents\myProject_PPC.ARM.cab

If you change your first line to

string _cabFile = "\"\\My Documents\\myProject_PPC.ARM.cab\"";

then it might work. I'd still try wceload.exe though.
 
Well.. looks like it works!
The funny thing is that I don't actually get asked if I want to (re)install
the application - it simply installs it. I don't even get to see the
progress bar or anything. I guess it has its advantages as well!

thanks for that!
 
Back
Top