installation error message summarized
authorDongeup Ham <dongeup.ham@samsung.com>
Fri, 11 Jan 2013 05:37:36 +0000 (14:37 +0900)
committerDongeup Ham <dongeup.ham@samsung.com>
Fri, 11 Jan 2013 05:37:36 +0000 (14:37 +0900)
Change-Id: I0196b74eefae172f2d1222d4aeff9b55ba82d5e6
Signed-off-by: Dongeup Ham <dongeup.ham@samsung.com>
13 files changed:
inc/InstallerDefs.h
src/Context/InstallationContext.cpp
src/Manager/InstallerManager.cpp
src/Manager/InstallerManager.h
src/Step/DrmStep.cpp
src/Step/LicenseStep.cpp
src/Step/ManifestXmlStep.cpp
src/Step/PackageCheckStep.cpp [changed mode: 0644->0755]
src/Step/SignatureStep.cpp
src/Step/SystemCheckStep.cpp
src/Step/UninstallStep.cpp
src/Step/UnpackStep.cpp
src/backend/backend.cpp

index f8c2331..18b23e2 100755 (executable)
@@ -21,7 +21,7 @@
 #ifndef _INSTALLER_DEFS_H_
 #define _INSTALLER_DEFS_H_
 
-#define OSP_INSTALLER_VERSION "osp-installer version=20130109.1"
+#define OSP_INSTALLER_VERSION "osp-installer version = 20130111.1"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
@@ -165,29 +165,31 @@ enum RequesterType
 
 enum InstallerError
 {
-       INSTALLER_ERROR_NONE,
-       INSTALLER_ERROR_MEMORY,
-       INSTALLER_ERROR_INTERNAL_STATE,
-       INSTALLER_ERROR_DATABASE,
-       INSTALLER_ERROR_APP_COUNT_MAX,
-       INSTALLER_ERROR_OUT_OF_STORAGE,
-       INSTALLER_ERROR_INVALID_PACKAGE,
-       INSTALLER_ERROR_INVALID_MANIFEST,
-       INSTALLER_ERROR_INVALID_APPLICATION,
-       INSTALLER_ERROR_INVALID_SIGNATURE,
-       INSTALLER_ERROR_ICON_MAINMENU,
-       INSTALLER_ERROR_ICON_SETTING,
-       INSTALLER_ERROR_ICON_TICKER,
-       INSTALLER_ERROR_ICON_QUICKPANEL,
-       INSTALLER_ERROR_ICON_LAUNCHIMAGE,
-       INSTALLER_ERROR_PRIVILEGE,
-       INSTALLER_ERROR_USER_CANCEL,
-       INSTALLER_ERROR_CERT_CHAIN,
-       INSTALLER_ERROR_CERT_REVOKED,
-       INSTALLER_ERROR_CERT_ROOT,
-       INSTALLER_ERROR_DRM,
-       INSTALLER_ERROR_INTEGRITY_FAILED,
-       INSTALLER_ERROR_UNMOUNT_FAILED
+       INSTALLER_ERROR_NONE = 0,
+       INSTALLER_ERROR_PACKAGE_NOT_FOUND = 1,
+       INSTALLER_ERROR_PACKAGE_INVALID = 2,
+       INSTALLER_ERROR_PACKAGE_LOWER_VERSION = 3,
+       INSTALLER_ERROR_EXECUTABLE_NOT_FOUND = 4,
+       INSTALLER_ERROR_MANIFEST_NOT_FOUND = 11,
+       INSTALLER_ERROR_MANIFEST_INVALID = 12,
+       INSTALLER_ERROR_SIGNATURE_NOT_FOUND = 21,
+       INSTALLER_ERROR_SIGNATURE_INVALID = 22,
+       INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED = 23,
+       INSTALLER_ERROR_ROOT_CERTIFICATE_NOT_FOUND = 31,
+       INSTALLER_ERROR_CERTIFICATE_INVALID = 32,
+       INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED = 33,
+       INSTALLER_ERROR_CERTIFICATE_EXPIRED = 34,
+       INSTALLER_ERROR_PRIVILEGE_INVALID = 41,
+       INSTALLER_ERROR_MENU_ICON_NOT_FOUND = 51,
+       INSTALLER_ERROR_FATAL_ERROR = 61,
+       INSTALLER_ERROR_OUT_OF_STORAGE = 62,
+       INSTALLER_ERROR_OUT_OF_MEMORY = 63,
+
+       INSTALLER_ERROR_USER_CANCEL = 141,
+       INSTALLER_ERROR_UNMOUNT_FAILED = 142,
+       INSTALLER_ERROR_INTERNAL_STATE = 143,
+       INSTALLER_ERROR_DATABASE = 144,
+       INSTALLER_ERROR_DRM = 145,
 };
 
 enum InstallerOperation
index bfa88b2..fa4a891 100755 (executable)
@@ -106,10 +106,10 @@ InstallerError
 InstallationContext::Construct(void)
 {
        __pPackageInfoImpl = new (std::nothrow) _PackageInfoImpl();
-       TryReturn(__pPackageInfoImpl, INSTALLER_ERROR_MEMORY, "[osp-installer] __pPackageInfoImpl is null.");
+       TryReturn(__pPackageInfoImpl, INSTALLER_ERROR_OUT_OF_MEMORY, "[osp-installer] __pPackageInfoImpl is null.");
 
        __pAppDataList = new (std::nothrow) ArrayListT<AppData*>;
-       TryReturn(__pAppDataList, INSTALLER_ERROR_MEMORY, "[osp-installer] __pAppDataList is null");
+       TryReturn(__pAppDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "[osp-installer] __pAppDataList is null");
 
        return INSTALLER_ERROR_NONE;
 }
index 1f19b3c..1cab98a 100755 (executable)
@@ -83,7 +83,7 @@ InstallerManager::Construct(const String& path, InstallerOperation operation, Re
        result r = E_SUCCESS;
 
        __pContext = new InstallationContext();
-       TryReturn(__pContext, INSTALLER_ERROR_MEMORY, "[osp-installer] __pContext is null.");
+       TryReturn(__pContext, INSTALLER_ERROR_OUT_OF_MEMORY, "[osp-installer] __pContext is null.");
 
        error = __pContext->Construct();
        TryReturn(error == INSTALLER_ERROR_NONE, INSTALLER_ERROR_INTERNAL_STATE, "[osp-installer] __pContext->Construct() failed.");
@@ -93,7 +93,7 @@ InstallerManager::Construct(const String& path, InstallerOperation operation, Re
        {
                FileAttributes attr;
                r = File::GetAttributes(path, attr);
-               TryReturn(!IsFailed(r), INSTALLER_ERROR_INVALID_PACKAGE, "[osp-installer] File::GetAttributes() failed");
+               TryReturn(!IsFailed(r), INSTALLER_ERROR_PACKAGE_NOT_FOUND, "[osp-installer] File::GetAttributes() failed");
 
                if (attr.IsDirectory())
                {
@@ -271,7 +271,6 @@ InstallerManager::Activate(void)
                        if (error != INSTALLER_ERROR_NONE)
                        {
                                __pContext->SetError(error);
-                               fprintf(stderr, "Activate:: Error = [%d]\n", error);
                                Error();
                                return error;
                        }
@@ -357,11 +356,6 @@ CATCH:
                InstallerUtil::Remove(DIR_OSP_APPLICATIONS_TEMP);
        }
 
-       if (errorType != INSTALLER_ERROR_NONE)
-       {
-               fprintf(stderr, " ErrorType [%d]\n", errorType);
-       }
-
        SetErrorType(errorType);
        return errorType;
 }
@@ -442,8 +436,8 @@ InstallerManager::RequestRecursiveDirectory(const Tizen::Base::String& path, int
                fprintf(stderr, "------------------------------------------\n");
                AppLogTag(OSP_INSTALLER, "------------------------------------------");
 
-               fprintf(stderr, " # directory = [%ls]\n", entryDir.GetPointer());
-               AppLogTag(OSP_INSTALLER, " # directory = [%ls]", entryDir.GetPointer());
+               fprintf(stderr, " # Directory = [%ls]\n", entryDir.GetPointer());
+               AppLogTag(OSP_INSTALLER, " # Directory = [%ls]", entryDir.GetPointer());
 
                errorType = Request(entryDir, INSTALLER_OPERATION_INSTALL, REQUESTER_TYPE_PRELOADED);
                if (errorType == 0)
@@ -506,8 +500,8 @@ InstallerManager::RequestByCommand(int argc, char **argv)
                {
                        fprintf(stderr, "------------------------------------------\n");
                        AppLogTag(OSP_INSTALLER, "------------------------------------------");
-                       fprintf(stderr, " # directory = [%s]\n", buf);
-                       AppLogTag(OSP_INSTALLER, " # directory = [%s]", buf);
+                       fprintf(stderr, " # Directory = [%s]\n", buf);
+                       AppLogTag(OSP_INSTALLER, " # Directory = [%s]", buf);
 
                        errorType = Request(buf, INSTALLER_OPERATION_INSTALL, REQUESTER_TYPE_NORMAL, hybridService);
                        if (errorType != 0)
@@ -523,8 +517,8 @@ InstallerManager::RequestByCommand(int argc, char **argv)
                {
                        fprintf(stderr, "------------------------------------------\n");
                        AppLogTag(OSP_INSTALLER, "------------------------------------------");
-                       fprintf(stderr, " # directory = [%s]\n", buf);
-                       AppLogTag(OSP_INSTALLER, " # directory = [%s]", buf);
+                       fprintf(stderr, " # Directory = [%s]\n", buf);
+                       AppLogTag(OSP_INSTALLER, " # Directory = [%s]", buf);
 
                        errorType = Request(buf, INSTALLER_OPERATION_UNINSTALL, REQUESTER_TYPE_NORMAL, hybridService);
                        PrintResult();
@@ -691,10 +685,10 @@ InstallerManager::ReqeustByTest(void)
        char readBuf[512] = {0};
 
        r = File::GetAttributes(L"/opt/apps/cmtamb4mtv/data/configuration", attr);
-       TryCatch(!IsFailed(r), errorType = INSTALLER_ERROR_INVALID_PACKAGE, "[osp-installer] file not found");
+       TryCatch(!IsFailed(r), errorType = INSTALLER_ERROR_PACKAGE_NOT_FOUND, "[osp-installer] file not found");
 
        r = file.Construct(L"/opt/apps/cmtamb4mtv/data/configuration", L"r");
-       TryCatch(!IsFailed(r), errorType = INSTALLER_ERROR_INVALID_PACKAGE, "[osp-installer] file.Construct failed");
+       TryCatch(!IsFailed(r), errorType = INSTALLER_ERROR_PACKAGE_NOT_FOUND, "[osp-installer] file.Construct failed");
 
        if (file.Read(readBuf, sizeof(readBuf)-1) > 1)
        {
@@ -786,7 +780,7 @@ InstallerManager::PrintPackageInfo(const char* appId)
 void
 InstallerManager::PrintResult(void)
 {
-       String appId = GetId();
+       String packageId = GetId();
        int errorType = GetErrorType();
        InstallerOperation operation = GetInstallerOperation();
 
@@ -795,15 +789,109 @@ InstallerManager::PrintResult(void)
        AppLogTag(OSP_INSTALLER, "==========================================");
        AppLogTag(OSP_INSTALLER, "%s Result", (operation == INSTALLER_OPERATION_INSTALL)?"Installation":"Uninstallation");
        AppLogTag(OSP_INSTALLER, " # %s", OSP_INSTALLER_VERSION);
-       AppLogTag(OSP_INSTALLER, " # AppId     = [%ls], errorType = [%d]", appId.GetPointer(), errorType);
-       AppLogTag(OSP_INSTALLER, " # result    = [%s]", (errorType == 0)?"Success":"Failure");
-       AppLogTag(OSP_INSTALLER, " # operation time = [%d](start=%d, end=%d)", (int)(__endTick-__startTick), (int)__startTick, (int)__endTick);
+       AppLogTag(OSP_INSTALLER, " # PackageId = [%ls]", packageId.IsEmpty() ? L"Unknown" : packageId.GetPointer());
+       AppLogTag(OSP_INSTALLER, " # Result    = [%s]", (errorType == 0)?"Success":"Failure");
+       AppLogTag(OSP_INSTALLER, " # Time      = [%d]ms (start=%d, end=%d)", (int)(__endTick-__startTick), (int)__startTick, (int)__endTick);
        AppLogTag(OSP_INSTALLER, "==========================================");
 
-       fprintf(stderr, " # AppId     = [%ls], errorType = [%d]\n", appId.GetPointer(), errorType);
-       fprintf(stderr, " # operation = [%s]\n", (operation == INSTALLER_OPERATION_INSTALL)?"Installation":"Uninstallation");
-       fprintf(stderr, " # result    = [%s]\n", (errorType == 0)?"Success":"Failure");
-       fprintf(stderr, " # operation time = [%d] ms(start=%d, end=%d)\n", (int)(__endTick-__startTick), (int)__startTick, (int)__endTick);
+       fprintf(stderr, " # PackageId = [%ls]\n", packageId.IsEmpty() ? L"Unknown" : packageId.GetPointer());
+       fprintf(stderr, " # Operation = [%s]\n", (operation == INSTALLER_OPERATION_INSTALL)?"Installation":"Uninstallation");
+       fprintf(stderr, " # Result    = [%s]\n", (errorType == 0)?"Success":"Failure");
+       fprintf(stderr, " # Time      = [%d]ms (start=%d, end=%d)\n", (int)(__endTick-__startTick), (int)__startTick, (int)__endTick);
+
+       PrintError(errorType);
+}
+
+void
+InstallerManager::PrintError(int errorType)
+{
+       const char* pError = null;
+
+       switch (errorType)
+       {
+       case INSTALLER_ERROR_NONE:
+               pError = "Success";
+               break;
+
+       case INSTALLER_ERROR_PACKAGE_NOT_FOUND:
+               pError = "[PACKAGE_NOT_FOUND] Thrown when package file is not found.";
+               break;
+
+       case INSTALLER_ERROR_PACKAGE_INVALID:
+               pError = "[PACKAGE_INVALID] Thrown when package file is not valid due to file operation or directory hierarchy.";
+               break;
+
+       case INSTALLER_ERROR_PACKAGE_LOWER_VERSION:
+               pError = "[PACKAGE_LOWER_VERSION] Thrown when the lower version package is tried to install.";
+               break;
+
+       case INSTALLER_ERROR_EXECUTABLE_NOT_FOUND:
+               pError = "[EXECUTABLE_NOT_FOUND] Thrown when executable file is not found in the package.";
+               break;
+
+       case INSTALLER_ERROR_MANIFEST_NOT_FOUND:
+               pError = "[MANIFEST_NOT_FOUND] Thrown when manifest.xml is not found in the package.";
+               break;
+
+       case INSTALLER_ERROR_MANIFEST_INVALID:
+               pError = "[MANIFEST_INVALID] Thrown when manifest.xml is not valid due to schema or parsing failure.";
+               break;
+
+       case INSTALLER_ERROR_SIGNATURE_NOT_FOUND:
+               pError = "[SIGNATURE_NOT_FOUND] Thrown when the signature files are not found in the package.";
+               break;
+
+       case INSTALLER_ERROR_SIGNATURE_INVALID:
+               pError = "[SIGNATURE_INVALID] Thrown when the signature files are not valid due to schema or parsing failure.";
+               break;
+
+       case INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED:
+               pError = "[SIGNATURE_VERIFICATION_FAILED] Thrown when the signature verification has failed due to be modified illegally.";
+               break;
+
+       case INSTALLER_ERROR_ROOT_CERTIFICATE_NOT_FOUND:
+               pError = "[ROOT_CERTIFICATE_NOT_FOUND] Thrown when the root certificate is not found.";
+               break;
+
+       case INSTALLER_ERROR_CERTIFICATE_INVALID:
+               pError = "[CERTIFICATE_INVALID] Thrown when the certificate verification has failed.";
+               break;
+
+       case INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED:
+               pError = "[CERTIFICATE_CHAIN_VERIFICATION_FAILED] Thrown when the certificate chain verification has failed.";
+               break;
+
+       case INSTALLER_ERROR_CERTIFICATE_EXPIRED:
+               pError = "[CERTIFICATE_EXPIRED] Thrown when the used certificates have expired.";
+               break;
+
+       case INSTALLER_ERROR_PRIVILEGE_INVALID:
+               pError = "[PRIVILEGE_INVALID] Thrown when unsupported privilege strings are detected.";
+               break;
+
+       case INSTALLER_ERROR_MENU_ICON_NOT_FOUND:
+               pError = "[MENU_ICON_NOT_FOUND] Thrown when an icon for menu is not found. This icon is mandatory.";
+               break;
+
+       case INSTALLER_ERROR_FATAL_ERROR:
+               pError = "[FATAL_ERROR] Thrown when an icon for menu is not found. This icon is mandatory.";
+               break;
+
+       case INSTALLER_ERROR_OUT_OF_STORAGE:
+               pError = "[OUT_OF_STORAGE] Thrown when the storage is full.";
+               break;
+
+       case INSTALLER_ERROR_OUT_OF_MEMORY:
+               pError = "[OUT_OF_MEMORY] Thrown when the memory is not sufficient to perform the requested installation or uninstallation.";
+               break;
+
+       default:
+               pError = "fatal error";
+               break;
+       }
+
+       AppLogTag(OSP_INSTALLER, " # Error     = %s(%d)", pError, errorType);
+       fprintf(stderr, " # Error     = %s(%d)\n", pError, errorType);
 }
 
 const PackageId&
index 798944b..93300fc 100755 (executable)
@@ -54,6 +54,7 @@ public:
 
        void PrintPackageInfo(const char* appId);
        void PrintResult(void);
+       void PrintError(int errorType);
 
        const Tizen::App::PackageId& GetId(void) const;
        void SetId(const Tizen::App::PackageId& appId);
index e3631df..9be5f1b 100755 (executable)
@@ -82,7 +82,6 @@ DrmStep::Run(InstallationContext* pContext)
 
                if (error != INSTALLER_ERROR_NONE)
                {
-                       fprintf(stderr, "DrmStep::Run - ErrorType [%d]\n", error);
                        break;
                }
 
index 05192b8..6d76c99 100755 (executable)
@@ -62,7 +62,6 @@ LicenseStep::Run(InstallationContext* pContext)
 
                if (error != INSTALLER_ERROR_NONE)
                {
-                       fprintf(stderr, "LicenseStep::Run - ErrorType [%d]\n", error);
                        break;
                }
 
index 69cf1ae..d8acf41 100755 (executable)
@@ -74,7 +74,6 @@ ManifestXmlStep::Run(InstallationContext* pContext)
 
                if (error != INSTALLER_ERROR_NONE)
                {
-                       fprintf(stderr, "ManifestXmlStep::Run - ErrorType [%d]\n", error);
                        break;
                }
 
@@ -115,10 +114,10 @@ ManifestXmlStep::OnStateManifestXml(void)
                fprintf(stderr, "OnStateManifestXml - File::GetAttributes is failed. [%ls]\n", __pContext->GetManifestXmlPath().GetPointer());
                AppLogTag(OSP_INSTALLER, "OnStateManifestXml - File::GetAttributes is failed. [%ls]\n", __pContext->GetManifestXmlPath().GetPointer());
        }
-       TryReturn(!IsFailed(r), INSTALLER_ERROR_INVALID_PACKAGE, "[osp-installer] File::GetAttributes() failed");
+       TryReturn(!IsFailed(r), INSTALLER_ERROR_MANIFEST_NOT_FOUND, "[osp-installer] File::GetAttributes() failed");
 
        std::unique_ptr<char[]> pFilepath(_StringConverter::CopyToCharArrayN(manifestXmlPath));
-       TryReturn(pFilepath, INSTALLER_ERROR_INVALID_PACKAGE, "[osp-installer] pFilepath is null");
+       TryReturn(pFilepath, INSTALLER_ERROR_OUT_OF_MEMORY, "[osp-installer] pFilepath is null");
 
        AppLogTag(OSP_INSTALLER, "manifest file=[%ls]", manifestXmlPath.GetPointer());
 
@@ -129,10 +128,10 @@ ManifestXmlStep::OnStateManifestXml(void)
        {
                fprintf(stderr, "OnStateManifestXml - manifestHandler.Parse is failed. [%s]\n", pFilepath.get());
        }
-       TryReturn(ret == true, INSTALLER_ERROR_INVALID_MANIFEST, "[osp-installer] manifestHandler.Parse() failed");
+       TryReturn(ret == true, INSTALLER_ERROR_MANIFEST_INVALID, "[osp-installer] manifestHandler.Parse() failed");
 
        pPackageInfoImpl = __pContext->GetPackageInfoImpl();
-       TryReturn(pPackageInfoImpl, error = INSTALLER_ERROR_INVALID_MANIFEST, "[osp-installer] pPackageInfoImpl is null");
+       TryReturn(pPackageInfoImpl, error = INSTALLER_ERROR_INTERNAL_STATE, "[osp-installer] pPackageInfoImpl is null");
        __pContext->SetId(pPackageInfoImpl->GetId());
 
        GoNextState();
old mode 100644 (file)
new mode 100755 (executable)
index 1c79748..5c5813a
@@ -70,7 +70,6 @@ PackageCheckStep::Run(InstallationContext* pContext)
 
                if (error != INSTALLER_ERROR_NONE)
                {
-                       fprintf(stderr, "PackageCheckStep::Run - ErrorType [%d]\n", error);
                        break;
                }
 
index 54c50f4..e99a836 100755 (executable)
@@ -91,8 +91,6 @@ SignatureStep::Run(InstallationContext* pContext)
 
                if (error != INSTALLER_ERROR_NONE)
                {
-                       AppLogTag(OSP_INSTALLER, "SignatureStep::Run - ErrorType [%d]\n", error);
-                       //fprintf(stderr, "SignatureStep::Run - ErrorType [%d]\n", error);
                        break;
                }
 
@@ -121,13 +119,13 @@ SignatureStep::OnStateSignerCert(void)
        bool ret = true;
 
        __pSignatureManager = new (std::nothrow) SignatureManager();
-       TryCatch(__pSignatureManager, error = INSTALLER_ERROR_MEMORY, "[osp-installer] __pSignatureManager is null.");
+       TryCatch(__pSignatureManager, error = INSTALLER_ERROR_OUT_OF_MEMORY, "[osp-installer] __pSignatureManager is null.");
 
        ret = __pSignatureManager->Construct(__pContext);
        TryCatch(ret == true, error = INSTALLER_ERROR_INTERNAL_STATE, "[osp-installer] Construct() failed");
 
        ret = __pSignatureManager->SetSignature();
-       TryCatch(ret == true, error = INSTALLER_ERROR_INVALID_SIGNATURE, "[osp-installer] SetSignature() failed");
+       TryCatch(ret == true, error = INSTALLER_ERROR_SIGNATURE_INVALID, "[osp-installer] SetSignature() failed");
 
 CATCH:
        GoNextState();
@@ -141,10 +139,10 @@ SignatureStep::OnStateCertChain(void)
        bool ret = true;
 
        ret = __pSignatureManager->AddCert();
-       TryCatch(ret == true, error = INSTALLER_ERROR_INVALID_SIGNATURE, "[osp-installer] AddCert(DEVELOPER_ROOT_CERTIFICATE) failed");
+       TryCatch(ret == true, error = INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED, "[osp-installer] AddCert(DEVELOPER_ROOT_CERTIFICATE) failed");
 
        ret = __pSignatureManager->VerifyChain();
-       TryCatch(ret == true, error = INSTALLER_ERROR_INVALID_SIGNATURE, "[osp-installer] VerifyChain() failed");
+       TryCatch(ret == true, error = INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED, "[osp-installer] VerifyChain() failed");
 
 CATCH:
        GoNextState();
@@ -172,7 +170,7 @@ SignatureStep::OnStateRootCert(void)
        {
                fprintf(stderr, "PrivilegeHandler::GenerateCipherPrivilege is failded. [%ls][%ls][%ls]\n", appId.GetPointer(), privileges.GetPointer(), hmacPrivileges.GetPointer());
        }
-       TryCatch(!IsFailed(r), error = INSTALLER_ERROR_PRIVILEGE, "[osp-installer] privMgr.GeneratePrivilegeString() failed");
+       TryCatch(!IsFailed(r), error = INSTALLER_ERROR_PRIVILEGE_INVALID, "[osp-installer] privMgr.GeneratePrivilegeString() failed");
 
        pPackageInfoImpl->SetPrivilegesValue(privileges, hmacPrivileges);
        pPackageInfoImpl->SetCertType(apiVisibility);
index d4efb86..fb9c9be 100755 (executable)
@@ -73,7 +73,6 @@ SystemCheckStep::Run(InstallationContext* pContext)
 
                if (error != INSTALLER_ERROR_NONE)
                {
-                       fprintf(stderr, "SystemCheckStep::Run - ErrorType [%d]\n", error);
                        break;
                }
 
index 7dd1f9d..80c0004 100755 (executable)
@@ -97,7 +97,6 @@ UninstallStep::Run(InstallationContext* pContext)
 
                if (error != INSTALLER_ERROR_NONE)
                {
-                       fprintf(stderr, "UninstallStep::Run - ErrorType [%d]\n", error);
                        break;
                }
 
index 5cc4375..91b0128 100755 (executable)
@@ -112,7 +112,6 @@ UnpackStep::Run(InstallationContext* pContext)
 
                if (error != INSTALLER_ERROR_NONE)
                {
-                       fprintf(stderr, "UnpackStep::Run - ErrorType [%d]\n", error);
                        break;
                }
 
index e8bfefb..98a20b6 100755 (executable)
@@ -173,6 +173,23 @@ CATCH:
 }
 
 bool
+__osp_installer_send_error(int errorType)
+{
+       char errorMsg[11] = {0};
+       int error = 0;
+
+       if (errorType >= INSTALLER_ERROR_USER_CANCEL)
+       {
+               error = INSTALLER_ERROR_FATAL_ERROR;
+       }
+
+       snprintf(errorMsg, sizeof(errorMsg) - 1, "%d", error);
+       pkgmgr_installer_send_signal(_pi, "tpk", "", "error", errorMsg);
+
+       return true;
+}
+
+bool
 __osp_installer_report_result(const String& appId, int errorType)
 {
        int ret = 0;
@@ -212,6 +229,7 @@ __osp_installer_report_result(const String& appId, int errorType)
        {
                snprintf(resultBuf, sizeof(resultBuf), "0000000000");
                pValue = "fail";
+               __osp_installer_send_error(errorType);
        }
 
        ret = pkgmgr_installer_send_signal(_pi, pPkgType, resultBuf, pKey, pValue);