I. Required header files:
# Include <swinstapi. h>
# Include <swinstdefs. h>
Ii. Required lib Library:
Swinstcli. Lib
3. Required capabilities:
Trustedui
4. Install the application:
_ Partition (ktemppath, "C: // siltest. sisx ");
Caosync * waiter = caosync: newl ();
Cleanupstack: pushl (waiter );
Ioptions. iupgrade = swiui: epolicynotallowed;
Ioptions. iocsp = swiui: epolicynotallowed;
Ioptions. iDrive = 'C ';
Ioptions. iuntrusted = swiui: epolicynotallowed;
Ioptions. icapabilities = swiui: epolicynotallowed;
Ioptionspckg = ioptions;
Tbufc <200> fname (ktemppath );
// Silent insatllation
Ilauncher. silentinstall (Waiter-> istatus, fname, ioptionspckg );
Waiter-> execute ();
Cleanupstack: popanddestroy (waiter );
5. Uninstall the application:
Const tuid kmyappuid = {0x12345678 };
// Silent insatllation
Swiui: tuninstalloptions options;
Swiui: tuninstalloptionspckg optionspckg;
Options. ikillapp = swiui: epolicyallowed;
Options. ibreakdependency = swiui: epolicyallowed;
Optionspckg = options;
Ilauncher. silentuninstall (kmyappuid, optionspckg, swiui: ksisxmimetype );
Vi. References:
S60_3rd_SDK_MR_API_Plug-In_Pack_v5_43
:
Http://www.forum.nokia.com/info/sw.nokia.com/id/53439e01-f605-4491-96f4-62d003bd4c0c/S60_3rd_SDK_MR_API_Plug-In_Pack1.zip.html
Silentinst.zip
Http://wiki.forum.nokia.com/images/2/2f/SilentInst.zip
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/brew2003/archive/2008/12/23/3587982.aspx
A simple synchronization method is used to uninstall a function.
//************************************** ***********
// Author: JEME
//************************************** ***********
Tbool deleteapplication (const tuint32 auid)
{
Tbool Re = etrue;
Tuid uid;
UID. iuid = auid;
Swiui: rswinstsilentlauncher;
Tint err = launcher. Connect ();
If (Err! = Kerrnone)
{
Re = efalse;
Return re;
}
Cleanupclosepushl (launcher );
Swiui: tuninstalloptions options;
Options. ibreakdependency = swiui: epolicyallowed;
Options. ikillapp = swiui: epolicyallowed;
Swiui: tuninstalloptionspckg optpckg (options );
Trequeststatus status = krequestpending;
Launcher. silentuninstall (status, uid, optpckg, swiui: ksisxmimetype ());
If (status! = Krequestpending)
{
Re = efalse;
}
While (status = krequestpending)
{
User: After (5000); // or you can do other things.
}
If (status! = Kerrnone)
{
Re = efalse;
}
Launcher. cancelasyncrequest (swiui: erequestsilentuninstall );
Cleanupstack: popanddestroy (& launcher );
Return re;
}