enamrik
enamrik

Reputation: 2312

Install CAB file programmatically from within .NET CF

I wanted to know how to programmatically install a CAB file from my .NET CF application. I figured it would be as simple as starting a process with the name of a windows ce program and the CAB file path as a parameter. But I don't know what that program is or where it's located. Any ideas anyone? Thanks in advance.

Upvotes: 1

Views: 3499

Answers (2)

Trevor Balcom
Trevor Balcom

Reputation: 3888

The process is named WCELOAD.EXE. Here is the MSDN page for more information: http://msdn.microsoft.com/en-us/library/ms933760.aspx.

It gets more complicated if you have a requirement to support "Pocket PC" (the OS version 4.x before it was called Windows Mobile). Pocket PC does not support compressed CAB files and some of the WCELOAD.EXE command line parameters are not implemented.

I've found setting the CAB file to read-only is the best approach. If the user taps on the CAB file via File Explorer then the system will delete the CAB file after installation is complete. When you're calling WCELOAD programmatically, you can use /delete 0 to prevent this from happening.

Upvotes: 1

enamrik
enamrik

Reputation: 2312

I guess I asked this question to quickly, the answer was very easy to find. Because CAB files are recognized by the OS, I can simply do this:

Process process = new Process();
process.StartInfo.FileName = @"\Documents\MyApp.CAB";
process.Start();

I also found this here but I haven't tried it. Hope it helps someone else.

Upvotes: 5

Related Questions