WEB开发网
开发学院手机开发Symbian 开发 symbian 静默安装的实现 阅读

symbian 静默安装的实现

 2010-04-03 17:05:00 来源:WEB开发网   
核心提示:一、头文件和库:1. include: #include < SWInstApi.h >#include < SWInstDefs.h >2. lib: SWInstCli.lib3.SDK-plugin: 需要从网上下载SDK的扩展包http://www.forum.nokia.com/inf

一、头文件和库:

1. include: #include < SWInstApi.h >

#include < SWInstDefs.h >

2. lib: SWInstCli.lib

3.SDK-plugin: 需要从网上下载SDK的扩展包

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

二、需要用到的能力

Capability requirements: TrustedUI

下面上代码

.h

// Silent Installer

SwiUI::RSWInstSilentLauncher iLauncher;

//Install Option

SwiUI::TInstallOptions iOptions;

//Installation Option pkg

SwiUI::TInstallOptionsPckg iOptionsPckg;

void CTestListBox::SilenceInstall()

{

CAOSync* waiter = CAOSync::NewL();//自定义的活动对象,用于同步使用。

CleanupStack::pushL( waiter );

iOptions.iUpgrade = SwiUI::EPolicyAllowed;

iOptions.iOCSP = SwiUI::EPolicyAllowed;

iOptions.iDrive = 'C';

iOptions.iUntrusted = SwiUI::EPolicyAllowed;

iOptions.iCapabilities = SwiUI::EPolicyAllowed;

iOptionsPckg = iOptions;

TBufC< 50 > FName(KTempPath);//需要安装的SIS文件路径

//Silent insatllation

iLauncher.Connect();

iLauncher.SilentInstall(waiter->iStatus,FName,iOptionsPckg);

waiter->Execute();

CleanupStack::popAndDestroy( waiter );

}

可以实现symbian上不提示安装

Tags:symbian 静默

编辑录入:coldstar [复制链接] [打 印]
赞助商链接