完装程序起动后,就可以判断是安装/卸载
//头文件
#include <e32property.h>
TBool isUnInstall()
{
enum TInstOp
{
EInstOpNone = 0x00000000,
EInstOpInstall = 0x00000001,
EInstOpUninstall = 0x00000002,
EInstOpRestore = 0x00000004
};
enum TInstOpStatus
{
EInstOpStatusNone = 0x00000000,
EInstOpStatusSuccess = 0x00000100,
EInstOpStatusAborted = 0x00000200
};
TInt instStatus = -1;
User::LeaveIfError(RProperty::Get(KUidSystemCategory,
KSAUidSoftwareInstallKeyValue, instStatus));
if (instStatus == EInstOpUninstall)
{
return ETrue;
}
return EFalse;
}
转自 http://blog.sina.com.cn/s/blog_5ccfd2d50100hcit.html