技术与热点应用 您所在的位置:电子展览网 > 行业资讯 > 技术与热点应用 > 手机设计与制造

symbian 静默安装的实现




关键词:

  一、头文件和库:

  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上不提示安装

分享到:
收藏 打印
相关新闻
  • 没有相关信息!