Symbian 系统上不提示安装(Silence install)的实现
2010-03-13 20:22:00 来源:WEB开发网今天学习了一下安装SIS文件不提示用户。呼呼有点意思。在这里总结一下供大家参考和学习。
以下函数即为安装对应SIS包的实现方法
silenceInstall()
{
CAOSync* waiter = CAOSync::NewL();//自定义的活动对象,用于同步使用。
SwiUI::RSWInstSilentLauncher iLauncher;
//Install Option
SwiUI::TInstallOptions iOptions;
//Installation Option pkg
SwiUI::TInstallOptionsPckg iOptionsPckg;
CleanupStack::PushL( waiter );
iOptions.iUpgrade = SwiUI::EPolicyNotAllowed;
iOptions.iOCSP = SwiUI::EPolicyNotAllowed;
iOptions.iDrive = 'C';//安装在C盘
iOptions.iUntrusted = SwiUI::EPolicyNotAllowed;
iOptions.iCapabilities = SwiUI::EPolicyNotAllowed;
iOptionsPckg = iOptions;
TBufC<50> FName(KTempPath);//需要安装的SIS文件路径
//Silent insatllation
iLauncher.Connect();
iLauncher.SilentInstall(waiter->iStatus,FName,iOptionsPckg);
waiter->Execute();
iLauncher.Close();
CleanupStack::PopAndDestroy( waiter );
}
CAOSync活动对象的得要的实现方法
void CAOSync::Execute()
{
SetActive();
iWait->Start();
}
void CAOSync::DoCancel()
{
iWait->AsyncStop();
}
void CAOSync::RunL()
{
iWait->AsyncStop();
}
以上代码在E71上测试通过
更多精彩
赞助商链接