Free Web space and hosting from cssoft.communityarchitect.com
Search the Web

#CSOFT#

SILENT  CAB INSTALLATION OVER WM5 AND WM6


How to use CabInstaller

As CabInstaller is build like an static library you only need to create a new smart device projects in vs, and add CabInstaller.dll as a reference. Then you can call the function CabInstaller.Installer.InstallSilentWM56(string Cabfile) with the full path of the cab file as a param.

It's possible to dissable the security policie of executing a file with a call of CabInstaller.Installer.DisableSecurity()  after executing this the device will not ask again. Although you can enable the security again just calling the function CabInstaller.Installer.EnableSecurity()

With CabInstaller is possible to know if a cab is installed on the device or not. for this we provide two functions bool CabInstaller.Cab.IsInstalled(string Name) wich ask the devie if the program called by Name is installed or not. To get the Installation name of a cab you can use String CabInstaller.Cab.GetName(string CabFile)  which return the  installation name of the cabFile. The parameter CabFile is the full path to the cabfile. Note that if you try to get the installation name of an obfuscated cab it might fail.

Note that if you try to install a cab file that is previously installed the old version of the cab is removed and then the new one is installed.




void main (string[] params)
{

//dissable security prompth
CabInstaller.Installer.DisableSecurity();
//check if test.cab is installed
CabInstaller.Cab.IsInstalled(CabInstaller.Cab.GetName("\\test.cab"));
//if not instaled then install it silently
CabInstaller.Installer.InstalSilentWM56("\\test.cab");

}