Monday, September 26, 2005

CF : Installing a cab file programmatically and quietly (no user interaction)

The trick is using wceload.exe with the /no­askdest and /noui parameters.

Again thanks to

private bool installCabFile ()
ProcessInfo pi = new ProcessInfo();
if (CreateProcess ("\\Windows\\wceload.exe","/no­askdest /noui " + downloadFileName, pi))
return false;

catch (Exception e)
Cursor.Current = Cursors.Default;
MessageBox.Show ("Problem installing Cab file " + e.ToString());
return true;

return false;

// CreateProcess PInvoke API
[DllImport("CoreDll.DLL", SetLastError=true)]
private extern static int CreateProcess ( String imageName, String cmdLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, Int32 boolInheritHandles, Int32 dwCreationFlags, IntPtr lpEnvironment, IntPtr lpszCurrentDir, byte [] si, ProcessInfo pi );

// GetLastError PInvoke API
private extern static Int32

public Int32 GetPInvokeError()
return GetLastError();

private extern static Int32
WaitForSingleObject ( IntPtr Handle, Int32 Wait);

public bool CreateProcess (String ExeName, String CmdLine, ProcessInfo pi)
unchecked {INFINITE = (int)0xFFFFFFFF;}
bool result = false;
if (pi == null) pi = new ProcessInfo ();
byte [] si = new byte [128];
result = CreateProcess (ExeName, CmdLine, IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, si, pi) != 0;
WaitForSingleObject (pi.hProcess,INFINITE);
return result;

public sealed class ProcessInfo
public IntPtr hProcess = IntPtr.Zero;
public IntPtr hThread = IntPtr.Zero; public int dwProcessID = 0;
public int dwThreadID = 0;


(Compact Framework)


alex said...

I'ts possible to install unsigned cabs in silent mode over WM5 and WM6 with the utility made by cssoft. You can download the demo version from

i'll hope it helps.

Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!