• symbian 静默安装与静默删除(转)


    这几天做主题管理用到了这个问题,现在贴出来

    首先必须使用非公开的API


    下面是安装,可以同步,也可以异步,下面这个是同步,异步的话还要自己写一个AO。

            // Silent Installer
    SwiUI::RSWInstSilentLauncher iLauncher; 
    //Install Option
    SwiUI::TInstallOptions iOptions;
    //Installation Option pkg
    SwiUI::TInstallOptionsPckg iOptionsPckg; 

    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,8*/FName,iOptionsPckg);

    iLauncher.Close();  
    GetSinkInfo();
    CAknInformationNote* informationNote;
    informationNote = new ( ELeave ) CAknInformationNote;
    informationNote->ExecuteLD( _L("SilentInstall ok!!"));

    下面是卸载
    SwiUI::RSWInstLauncher iLauncher;
    CleanupClosePushL(iLauncher);
    User::LeaveIfError(iLauncher.Connect()); 

    SwiUI::TUninstallOptions iUninstallOptions;        
    iUninstallOptions.iKillApp = SwiUI::EPolicyAllowed;
    iUninstallOptions.iBreakDependency = SwiUI::EPolicyAllowed;

    SwiUI::TUninstallOptionsPckg iUninstallOptionsPckg(iUninstallOptions); 
           
    iLauncher.SilentUninstall(TUid::Uid(0xA00000EB),iUninstallOptionsPckg,SwiUI::KSisxMimeType);
    CleanupStack::PopAndDestroy( &iLauncher );
    iEikonEnv->InfoMsg( _L("SilentUninstall ok") );

    同样卸载也可以 同步或异步
  • 相关阅读:
    linux系统如何发送邮件
    zabbix监测图形界面显示方框乱码解决方法
    Eclipse C++的配置问题launch failed binary not found
    Cpu表现出正弦曲线
    让cpu跑到100%的bat文件
    进程僵死
    华为一些笔试题~~~~零散总结
    数据库~~~投影与除操作
    C++连接Mysql数据库操作
    微软面试题目及答案
  • 原文地址:https://www.cnblogs.com/yaoliang11/p/1848053.html
Copyright © 2020-2023  润新知