Problem to use wceload

G

Guest

Hi,

I'm using the wwceload program to install automatically some cab files, but
I have an error message which is the following :

Ni .cab files to install : please specify a .cab file or double tap a .cab
file to install the application.

The code is the following (I'm using the OpenNETCF package) :
----------------------------------------------------
static void runWce(string file)
{
ProcessStartInfo psi=new ProcessStartInfo();
psi.FileName="wceload";
psi.Arguments=@"\FlashFX Disk\tmp\" + file;
Process p=Process.Start(psi);
p.WaitForExit();
int exitcode;
try
{
exitcode=p.ExitCode;
}
catch
{
exitcode=0;
}
if (exitcode != 0) MessageBox.Show("Error");
}
----------------------------------------------------
However, I verified that the cab files were in the directory "FlashFX
Disk\tmp" and that is ok. I don't understand why the cab files don't install
themselves.

Thanks in advance for any information.
 
P

Paul G. Tobey [eMVP]

Spaces are probably the problem. You want the parameter to be "\FlashFX
Disk\tmp\filename.cab" (literally, including the quotes). Since you are not
passing the quotes, wceload is treating the stuff up to the first space as
the parameter and \FlashFX isn't a cab file.

Paul T.
 
G

Guest

OK. What can I do to replace the space character ?
I must use that directory in fact and not another...

Thanks,
 
C

Chris Tacke [MVP]

The space is the name is the problem. Embed quotes in the command line.
Single quotes might work as well.

psi.Arguments = string.Format("\"\\FlashFX Disk\\tmp\\{0}\"", file);

or

psi.Arguments = string.Format(@"'\FlashFX Disk\tmp\{0}'", file);

-Chris
 
G

Guest

OK, the following code runs :
psi.Arguments = string.Format("\"\\FlashFX Disk\\tmp\\{0}\"", file);

But how can I do to pass arguments to the "wceload" program ?
For example, I want to run wceload with the following code :
"wceload /noaskdest /noui /delete 0"

I tried to do that but that doesn't run :
....
psi.FileName = "wceload";
psi.Verb = "/noaskdest /noui /delete 0";
psi.Arguments = string.Format("\"\\FlashFX Disk\\Kimberly\\{0}\"", file);
Process p = Process.Start(psi);
....

If you see where the problem is ?
Thanks in advance.
 
P

Paul G. Tobey [eMVP]

Put the arguments in, oddly enough, the Arguments property, after the
filename. Think about how you'd run it from a command line with the
arguments you want:

wceload.exe "\FlashFX Disk\Kimberly\mycab.cab" /noaskdest /noui /delete 0

or whatever. Now make the Arguments property equal that!

Paul T.
 
G

Guest

Thanks for the information, I tried to write the following code :
-------------------------------------------------------------------
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "wceload";
psi.Arguments = string.Format("\"\\FlashFX Disk\\Kimberly\\{0}\"", file + "
/noaskdest /noui /delete 0");
Process p = Process.Start(psi);
p.WaitForExit();
 
P

Paul G. Tobey [eMVP]

"Doesn't run" is useless information. It looks to me like you don't know
how to use the Format method. I don't use it much, but it seems like you'd
want to define the string once, with the {0} in it, along with the /noui,
etc. options. Something more like:

psi.Arguments = string.Format("\"\\FlashFX Disk\\Kimberly\\{0}\" /noaskdest
/noui /delete 0", file );

Paul T.
 
G

Guest

OK, thanks, but it seems that the command isn't executed : /noaskdest
/noui /delete 0.

I'm asking "noaskdest" and the cab file doesn't install itself : I must
agree to install it in the folder proposed, so I must press the ok button for
each cab file...
Do you see where I'm wrong ?

In fact that program which is charged to install some cab files needs also
OpenNETCF. But in fact, when I run it, OpenNETCF isn't installed. What should
I do ? Write the same program in another language ? Or can I use in C#
another functions than OpenNETCF ?

Thanks in advance.
 
P

Paul G. Tobey [eMVP]

If you run the wceload program from your own command line or a shortcut with
the parameters set correctly, does /noaskdest work? If not, then you're
still not forming your command line right. I can't tell you why. Use the
debugger!

The rest of your question seems to be about a totally different topic.
You're saying that your program that launches these wceload instances needs
OpenNETCF SDF? Not a good design choice. What are you doing with it that
it requires OpenNETCF SDF? I can't randomly come up with an answer as to
what you should do unless I know why you're using SDF.

Paul T.
 
P

Paul G. Tobey [eMVP]

So, you're saying that /noaskdest does *not* work from the command line or a
shortcut. There's nothing that you can do to make it work, then. You might
check the archives of this newsgroup via groups.google.com and see if there
are undocumented switches that might give you what you want.

Paul T.
 

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