SubMode, GetAppId() is changed to GetId()
authorDongeup Ham <dongeup.ham@samsung.com>
Mon, 7 Jan 2013 11:19:51 +0000 (20:19 +0900)
committerDongeup Ham <dongeup.ham@samsung.com>
Mon, 7 Jan 2013 11:19:51 +0000 (20:19 +0900)
Change-Id: Iee9707ee1b26cd9cf08af4a0672276e86422be50
Signed-off-by: Dongeup Ham <dongeup.ham@samsung.com>
17 files changed:
inc/InstallerDefs.h
src/Context/InstallationContext.cpp
src/Context/InstallationContext.h
src/Installer/Installer.cpp [changed mode: 0644->0755]
src/Manager/ConfigurationManager.cpp
src/Manager/InstallerManager.cpp
src/Manager/InstallerManager.h [changed mode: 0644->0755]
src/Manager/PermissionManager.cpp
src/Step/ManifestXmlStep.cpp [changed mode: 0644->0755]
src/Step/SignatureStep.cpp
src/Step/UninstallStep.cpp [changed mode: 0644->0755]
src/Step/UnpackStep.cpp
src/Util/InstallerUtil.cpp
src/Util/InstallerUtil.h
src/XmlHandler/ManifestGenerator.cpp
src/XmlHandler/ManifestHandler.cpp
src/backend/backend.cpp [changed mode: 0644->0755]

index 7a989b0..295e72c 100755 (executable)
@@ -21,7 +21,7 @@
 #ifndef _INSTALLER_DEFS_H_
 #define _INSTALLER_DEFS_H_
 
-#define OSP_INSTALLER_VERSION "osp-installer version=20130107.2"
+#define OSP_INSTALLER_VERSION "osp-installer version=20130107.3"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
index 4cb56ea..100bf34 100755 (executable)
@@ -35,6 +35,7 @@ using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Io;
 using namespace Tizen::Security::Cert;
+using namespace Tizen::App;
 using namespace Tizen::App::Package;
 
 InstallationContext::InstallationContext(void)
@@ -371,16 +372,16 @@ InstallationContext::GetInstallationStorage(void) const
        return __storage;
 }
 
-const String&
-InstallationContext::GetAppId(void) const
+const PackageId&
+InstallationContext::GetId(void) const
 {
-       return __appId;
+       return __packageId;
 }
 
 void
-InstallationContext::SetAppId(const String& appId)
+InstallationContext::SetId(const PackageId& packageId)
 {
-       __appId = appId;
+       __packageId = packageId;
 }
 
 const String&
index b1d77da..b3d29bf 100755 (executable)
@@ -25,6 +25,7 @@
 
 #include <app2ext_interface.h>
 
+#include <FAppTypes.h>
 #include <FAppPkg_PackageInfoImpl.h>
 #include <FSecCertX509CertificatePath.h>
 
@@ -106,8 +107,8 @@ public:
        const Tizen::Base::String& GetWorkingDir(void) const;
        void SetWorkingDir(const Tizen::Base::String& workingDir);
 
-       const Tizen::Base::String& GetAppId(void) const;
-       void SetAppId(const Tizen::Base::String& appId);
+       const Tizen::App::PackageId& GetId(void) const;
+       void SetId(const  Tizen::App::PackageId& packageId);
 
        const Tizen::Base::String& GetAppVersion(void) const;
        void SetAppVersion(const Tizen::Base::String& appVersion);
@@ -146,6 +147,7 @@ public:
        Tizen::Base::Collection::IListT<AppData *>* __pAppDataList;
 
        bool __isSubMode;
+       Tizen::Base::String __subModeAppName;
 
 private:
        InstallationContext(const InstallationContext& value);
@@ -172,7 +174,7 @@ private:
        Tizen::Base::String __temporaryDir;
        Tizen::Base::String __installDir;
        Tizen::Base::String __workingDir;
-       Tizen::Base::String __appId;
+       Tizen::Base::String __packageId;
        Tizen::Base::String __appVersion;
        Tizen::Base::String __appRootPath;
 
old mode 100644 (file)
new mode 100755 (executable)
index acd1150..b455cbe
@@ -118,12 +118,12 @@ Installer::OnRegister(void)
 
        if (operation == INSTALLER_OPERATION_INSTALL)
        {
-               pManagerImpl->UnregisterPackageInfo(pContext->GetAppId());
+               pManagerImpl->UnregisterPackageInfo(pContext->GetId());
                pManagerImpl->RegisterPackageInfo(*pContext->GetPackageInfoImpl());
        }
        else
        {
-               pManagerImpl->UnregisterPackageInfo(pContext->GetAppId());
+               pManagerImpl->UnregisterPackageInfo(pContext->GetId());
        }
        AppLogTag(OSP_INSTALLER, "Installer::OnRegister() - END");
        AppLogTag(OSP_INSTALLER, "------------------------------------------");
index 9f85304..aac4779 100755 (executable)
@@ -240,7 +240,7 @@ ConfigurationManager::CreateFile(InstallationContext* pContext)
                                }
 
                                String newPath = SLP_FONT_PATH;
-                               newPath += L"/" + pContext->GetAppId();
+                               newPath += L"/" + pContext->GetId();
                                Directory::Create(newPath, false);
                                InstallerUtil::ChangeMode(newPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
 
@@ -253,11 +253,11 @@ ConfigurationManager::CreateFile(InstallationContext* pContext)
 
        //if (pContext->IsPreloaded() == true)
        //{
-       //      xmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->GetAppId().GetPointer());
+       //      xmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
        //}
        //else
        //{
-       xmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->GetAppId().GetPointer());
+       xmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
        //}
 
        pXmlPath = _StringConverter::CopyToCharArrayN(xmlPath);
@@ -324,11 +324,11 @@ ConfigurationManager::RemoveFile(InstallationContext* pContext)
 
        //if (pContext->IsPreloaded() == true)
        //{
-       //      xmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->GetAppId().GetPointer());
+       //      xmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
        //}
        //else
        //{
-       xmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->GetAppId().GetPointer());
+       xmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
        //}
 
        pXmlPath = _StringConverter::CopyToCharArrayN(xmlPath);
@@ -386,7 +386,7 @@ ConfigurationManager::RegisterCertInfo(InstallationContext* pContext) const
        int res = 0;
        bool result = true;
        pkgmgr_instcertinfo_h handle = null;
-       String appId = pContext->GetAppId();
+       String appId = pContext->GetId();
        X509CertificatePath* pAuthorCertPath = pContext->GetAuthorCertPath();
        X509CertificatePath* pDistributorCertPath = pContext->GetDistributorCertPath();
 
@@ -496,7 +496,7 @@ ConfigurationManager::UnregisterCertInfo(InstallationContext* pContext) const
        AppLogTag(OSP_INSTALLER, "UnregisterCertInfo - START");
        int res = 0;
        bool result = true;
-       String appId = pContext->GetAppId();
+       String appId = pContext->GetId();
 
        char* pAppId = _StringConverter::CopyToCharArrayN(appId);
        TryCatch(pAppId, result = false, "[osp-installer] pAppId is null");
@@ -518,7 +518,7 @@ ConfigurationManager::PostInstall(InstallationContext* pContext, bool error) con
        app2ext_handle* pHandle = pContext->GetApp2ExtHandle();
        if (pHandle)
        {
-               String appId = pContext->GetAppId();
+               String appId = pContext->GetId();
                std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
                TryReturn(pAppId, false, "[osp-installer] pAppId is null");
 
@@ -545,7 +545,7 @@ ConfigurationManager::PostUninstall(InstallationContext* pContext) const
        app2ext_handle* pHandle = pContext->GetApp2ExtHandle();
        if (pHandle)
        {
-               String appId = pContext->GetAppId();
+               String appId = pContext->GetId();
                std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
                TryReturn(pAppId, false, "[osp-installer] pAppId is null");
 
index b8b5e8c..d789949 100755 (executable)
@@ -37,6 +37,7 @@ using namespace Tizen::Base;
 using namespace Tizen::Base::Utility;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Io;
+using namespace Tizen::App;
 using namespace Tizen::App::Package;
 
 const int BUFSIZE = 512;
@@ -120,7 +121,7 @@ InstallerManager::Construct(const String& path, InstallerOperation operation, Re
 
                AppLogTag(OSP_INSTALLER, "operation is INSTALLER_OPERATION_UNINSTALL");
                __pContext->SetCurrentInstallationStep(INSTALLER_STEP_INIT_UNINSTALL);
-               __pContext->SetAppId(path);
+               __pContext->SetId(path);
        }
 
        __pContext->SetInstallerOperation(operation);
@@ -319,7 +320,7 @@ InstallerManager::Request(const String& path, InstallerOperation operation, Requ
        InstallationContext* pContext = null;
        InstallerError errorType = INSTALLER_ERROR_NONE;
        InstallerManager* pInstallManager = null;
-       String appId;
+       PackageId packageId;
 
        AppLogTag(OSP_INSTALLER, "------------------------------------------");
        AppLogTag(OSP_INSTALLER, "InstallerManager::Request");
@@ -342,8 +343,8 @@ InstallerManager::Request(const String& path, InstallerOperation operation, Requ
        pContext = pInstallManager->GetContext();
        TryCatch(pContext, errorType = INSTALLER_ERROR_INTERNAL_STATE, "[osp-installer] pContext is null.");
 
-       appId = pContext->GetAppId();
-       SetAppId(appId);
+       packageId = pContext->GetId();
+       SetId(packageId);
 
 CATCH:
        if (File::IsFileExist(DIR_OSP_APPLICATIONS_TEMP) == true)
@@ -731,7 +732,7 @@ InstallerManager::PrintPackageInfo(const char* appId)
        AppLogTag(OSP_INSTALLER, "------------------------------------------");
        AppLogTag(OSP_INSTALLER, "PackageInfo");
        AppLogTag(OSP_INSTALLER, "------------------------------------------");
-       AppLogTag(OSP_INSTALLER, "# id = [%S]",  pPackageInfoImpl->GetAppId().GetPointer());
+       AppLogTag(OSP_INSTALLER, "# id = [%S]",  pPackageInfoImpl->GetId().GetPointer());
        AppLogTag(OSP_INSTALLER, "# version = [%S]", pPackageInfoImpl->GetAppVersion().GetPointer());
        AppLogTag(OSP_INSTALLER, "# secret = [%S]", pPackageInfoImpl->GetAppSecret().GetPointer());
        AppLogTag(OSP_INSTALLER, "# name = [%S]", pPackageInfoImpl->GetAppName().GetPointer());
@@ -781,7 +782,7 @@ InstallerManager::PrintPackageInfo(const char* appId)
 void
 InstallerManager::PrintResult(void)
 {
-       String appId = GetAppId();
+       String appId = GetId();
        int errorType = GetErrorType();
        InstallerOperation operation = GetInstallerOperation();
 
@@ -797,16 +798,16 @@ InstallerManager::PrintResult(void)
        fprintf(stderr, " # result    = [%s]\n", (errorType == 0)?"Success":"Failure");
 }
 
-const String&
-InstallerManager::GetAppId(void) const
+const PackageId&
+InstallerManager::GetId(void) const
 {
-       return __appId;
+       return __packageId;
 }
 
 void
-InstallerManager::SetAppId(const String& appId)
+InstallerManager::SetId(const PackageId& packageId)
 {
-       __appId = appId;
+       __packageId = packageId;
 }
 
 int
old mode 100644 (file)
new mode 100755 (executable)
index 5eadd56..4e458e4
@@ -55,8 +55,8 @@ public:
        void PrintPackageInfo(const char* appId);
        void PrintResult(void);
 
-       const Tizen::Base::String& GetAppId(void) const;
-       void SetAppId(const Tizen::Base::String& appId);
+       const Tizen::App::PackageId& GetId(void) const;
+       void SetId(const Tizen::App::PackageId& appId);
 
        int GetErrorType(void) const;
        void SetErrorType(int errorType);
@@ -91,7 +91,7 @@ private:
        InstallationContext* __pContext;
        Installer* __pInstaller;
 
-       Tizen::Base::String __appId;
+       Tizen::App::PackageId __packageId;
        int __errorType;
        InstallerOperation __operation;
 
index db2837e..2fefcd1 100755 (executable)
@@ -69,19 +69,19 @@ PermissionManager::SetDirectory(InstallationContext* pContext)
 
        // appRoot/bin
        destPath = appRootPath + DIR_BIN;
-       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE | PERM_EXECUTE);
+       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE | PERM_EXECUTE, false);
 
        // appRoot/info
        destPath = appRootPath + DIR_INFO;
-       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE);
+       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE, false);
 
        // appRoot/res
        destPath = appRootPath + DIR_RES;
-       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE);
+       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE, false);
 
        // appRoot/lib
        destPath = appRootPath + DIR_LIB;
-       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE | PERM_EXECUTE);
+       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE | PERM_EXECUTE, false);
 
        // appRoot/shared
        destPath = appRootPath + DIR_SHARED;
@@ -90,7 +90,7 @@ PermissionManager::SetDirectory(InstallationContext* pContext)
                r = Directory::Create(destPath, false);
                TryReturn(!IsFailed(r), INSTALLER_ERROR_INTERNAL_STATE, "[osp-installer] Directory::Create() failed");
        }
-       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE);
+       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE, false);
 
        destPath = appRootPath + DIR_SHARED_RES;
        if (File::IsFileExist(destPath) == false)
@@ -98,11 +98,11 @@ PermissionManager::SetDirectory(InstallationContext* pContext)
                String iconPath = appRootPath + DIR_ICONS;
                InstallerUtil::CreateSymlink(iconPath, destPath);
        }
-       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE);
+       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE, false);
 
        // appRoot/contents
        destPath = appRootPath + DIR_CONTENTS;
-       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE);
+       InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE, false);
 
        // appRoot/setting
        destPath = appRootPath + DIR_SETTING;
@@ -119,7 +119,7 @@ PermissionManager::SetDirectory(InstallationContext* pContext)
                InstallerUtil::Remove(settingXmlPath);
                InstallerUtil::CreateSymlink(srcPath, settingXmlPath);
 
-               InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE | PERM_WRITE);
+               InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE | PERM_WRITE, false);
        }
 
        // appRoot/data
@@ -131,7 +131,7 @@ PermissionManager::SetDirectory(InstallationContext* pContext)
        }
        InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE, true);
 
-       String appId = pContext->GetAppId();
+       String appId = pContext->GetId();
        String apiVersion = pPackageInfoImpl->GetAppApiVersion();
 
        AppLogTag(OSP_INSTALLER, "------------------------------------------");
old mode 100644 (file)
new mode 100755 (executable)
index b7a82ca..69cf1ae
@@ -133,7 +133,7 @@ ManifestXmlStep::OnStateManifestXml(void)
 
        pPackageInfoImpl = __pContext->GetPackageInfoImpl();
        TryReturn(pPackageInfoImpl, error = INSTALLER_ERROR_INVALID_MANIFEST, "[osp-installer] pPackageInfoImpl is null");
-       __pContext->SetAppId(pPackageInfoImpl->GetAppId());
+       __pContext->SetId(pPackageInfoImpl->GetId());
 
        GoNextState();
 
index 8a12fa2..54c50f4 100755 (executable)
@@ -162,7 +162,7 @@ SignatureStep::OnStateRootCert(void)
        const ArrayList* pPrivilegeList = __pContext->GetPrivilegeList();
        RootCertificateType certType = __pContext->GetRootCertType();
        _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl();
-       String appId = pPackageInfoImpl->GetAppId();
+       String appId = pPackageInfoImpl->GetId();
        int apiVisibility = GetApiVisibility(certType);
 
        AppLogTag(OSP_INSTALLER, "AppId = [%ls], CertType = [%d], ApiVisibility = [%d]", appId.GetPointer(), certType, apiVisibility);
old mode 100644 (file)
new mode 100755 (executable)
index 17c7fd2..f3e6666
@@ -123,7 +123,7 @@ InstallerError
 UninstallStep::OnStateGetPackageInfo(void)
 {
        InstallerError error = INSTALLER_ERROR_NONE;
-       String appId = __pContext->GetAppId();
+       String appId = __pContext->GetId();
 
        _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl();
        TryReturn(pPackageInfoImpl, INSTALLER_ERROR_INTERNAL_STATE, "[osp-installer] pPackageInfoImpl is null");
index 0711d39..5cc4375 100755 (executable)
@@ -151,7 +151,7 @@ UnpackStep::OnUnzip(void)
                installPath += PACKAGE_NAME_PREFIX_ORG;
        }
 
-       installPath += __pContext->GetAppId();
+       installPath += __pContext->GetId();
 
        result r = E_SUCCESS;
        FileUnzipper unzipper;
@@ -161,7 +161,7 @@ UnpackStep::OnUnzip(void)
        if (__pContext->GetInstallationStorage() == InstallationContext::INSTALLATION_STORAGE_EXTERNAL)
        {
                int res = 0;
-               String appId = __pContext->GetAppId();
+               String appId = __pContext->GetId();
 
                std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
                TryReturn(pAppId, INSTALLER_ERROR_INTERNAL_STATE, "[osp-installer] pAppId is null");
index 6957a18..5746d52 100755 (executable)
@@ -273,13 +273,13 @@ InstallerUtil::ChangeOwner(const String& filePath)
 }
 
 bool
-InstallerUtil::ChangeDirectoryPermission(const String& filePath, int mode, bool isOwnerChanged)
+InstallerUtil::ChangeDirectoryPermission(const String& filePath, int mode, bool appOwner)
 {
        result r = E_SUCCESS;
        bool res = false;
 
-       AppLogTag(OSP_INSTALLER, "+ ChangeDirectoryPermission(): path=[%ls], mode=[%04o], isOwnerChanged=[%s]",
-                       filePath.GetPointer(), mode, isOwnerChanged?"true":"false");
+       AppLogTag(OSP_INSTALLER, "+ ChangeDirectoryPermission(): path=[%ls], mode=[%04o], appOwner=[%s]",
+                       filePath.GetPointer(), mode, appOwner?"true":"false");
 
        res = File::IsFileExist(filePath);
        if (res == false)
@@ -308,7 +308,7 @@ InstallerUtil::ChangeDirectoryPermission(const String& filePath, int mode, bool
 
                if (entryName == L".")
                {
-                       if (isOwnerChanged == true)
+                       if (appOwner == true)
                        {
                                InstallerUtil::ChangeOwner(entryDir);
                        }
@@ -322,7 +322,7 @@ InstallerUtil::ChangeDirectoryPermission(const String& filePath, int mode, bool
 
                if (entry.IsDirectory() == false)
                {
-                       if (isOwnerChanged == true)
+                       if (appOwner == true)
                        {
                                InstallerUtil::ChangeOwner(entryDir);
                        }
@@ -330,8 +330,8 @@ InstallerUtil::ChangeDirectoryPermission(const String& filePath, int mode, bool
                }
                else
                {
-                       ChangeDirectoryPermission(entryDir, mode, isOwnerChanged);
-                       if (isOwnerChanged == true)
+                       ChangeDirectoryPermission(entryDir, mode, appOwner);
+                       if (appOwner == true)
                        {
                                InstallerUtil::ChangeOwner(entryDir);
                        }
index 0ffd10a..4fac08a 100755 (executable)
@@ -51,7 +51,7 @@ public:
        static bool CreateSymlink(const Tizen::Base::String& oldPath, const Tizen::Base::String& newPath);
        static bool ChangeMode(const Tizen::Base::String& filePath, int mode);
        static bool     ChangeOwner(const Tizen::Base::String& filePath);
-       static bool     ChangeDirectoryPermission(const Tizen::Base::String& filePath, int mode, bool isOwnerChanged=false);
+       static bool     ChangeDirectoryPermission(const Tizen::Base::String& filePath, int mode, bool appOwner);
 
        static bool IsDrmFile(const Tizen::Base::String& path);
        static bool DecryptPackage(const Tizen::Base::String& packagePath);
index d82cefc..4afee3a 100755 (executable)
@@ -74,16 +74,16 @@ ManifestGenerator::Write()
 
        //if (preload == true)
        //{
-       //      xmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, __pContext->GetAppId().GetPointer());
+       //      xmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, __pContext->GetId().GetPointer());
        //      location = L"internal-only";
        //}
        //else
        //{
-       xmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, __pContext->GetAppId().GetPointer());
+       xmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, __pContext->GetId().GetPointer());
        location = L"auto";
        //}
 
-       package = __pContext->GetAppId();
+       package = __pContext->GetId();
 
        __pWriter->Construct(xmlPath);
 
@@ -651,20 +651,28 @@ ManifestGenerator::WriteSubModeApp(int index)
        _PackageInfoImpl *pPackageInfoImpl = null;
        pPackageInfoImpl = __pContext->GetPackageInfoImpl();
 
+       // SUB_MODE_APPCONTROL_NAME -> AppName
+       String subBinaryPath;
+       subBinaryPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, SUB_MODE_APPCONTROL_NAME);
+
        String binaryPath;
-       binaryPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, SUB_MODE_APPCONTROL_NAME);
+       binaryPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, __pContext->__subModeAppName.GetPointer());
 
-       String binaryExecPath = binaryPath + ".exe";
+       if (File::IsFileExist(subBinaryPath) == true)
+       {
+               InstallerUtil::Remove(subBinaryPath);
+       }
+       InstallerUtil::CreateSymlink(binaryPath, subBinaryPath);
 
-       InstallerUtil::Copy(UIAPP_LOADER_PATH, binaryExecPath);
-       InstallerUtil::ChangeMode(binaryExecPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
+       // SUB_MODE_APPCONTROL_NAME.exe -> AppName.exe
+       String subBinaryExecPath = subBinaryPath + ".exe";
+       String binaryExecPath = binaryPath + ".exe";
 
-       if (File::IsFileExist(binaryPath) == true)
+       if (File::IsFileExist(subBinaryExecPath) == true)
        {
-               InstallerUtil::Remove(binaryPath);
+               InstallerUtil::Remove(subBinaryExecPath);
        }
-
-       InstallerUtil::CreateSymlink(binaryExecPath, binaryPath);
+       InstallerUtil::CreateSymlink(binaryExecPath, subBinaryExecPath);
 
        IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
        TryReturn(pAppDataList, false, "[osp-installer] pAppDataList is null");
@@ -675,12 +683,12 @@ ManifestGenerator::WriteSubModeApp(int index)
        pAppDataList->GetAt(index, pAppData);
        TryReturn(pAppData, false, "[osp-installer] pAppData is null");
 
-       PackageId packageId = __pContext->GetAppId();
+       PackageId packageId = __pContext->GetId();
        AppId appId = packageId + L"." + SUB_MODE_APPCONTROL_NAME;
 
        __pWriter->StartElement("ui-application");
        __pWriter->WriteAttribute("appid", appId);
-       __pWriter->WriteAttribute("exec", binaryPath);
+       __pWriter->WriteAttribute("exec", subBinaryPath);
        __pWriter->WriteAttribute("nodisplay", "true");
        __pWriter->WriteAttribute("taskmanage", "false");
        __pWriter->WriteAttribute("multiple", "true");
index 223cbc5..049d93d 100755 (executable)
@@ -670,7 +670,7 @@ ManifestHandler::OnPrivilegesEndElement(void)
                result r = E_SUCCESS;
                String privileges;
                String hmacPrivileges;
-               String appId = __pPackageInfoImpl->GetAppId();
+               String appId = __pPackageInfoImpl->GetId();
                r = PrivilegeHandler::GenerateCipherPrivilege(appId, *__pPrivilegeList, privileges, hmacPrivileges);
                if (IsFailed(r))
                {
@@ -691,17 +691,18 @@ ManifestHandler::OnPrivilegesEndElement(void)
 bool
 ManifestHandler::OnUiAppEndElement(void)
 {
-       __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl);
-       __pPackageAppInfoImpl = null;
-
-       __isDefaultName = false;
-
        if (__pContext->__isSubMode == true)
        {
                __pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
                __pAppData->__pAppControlDataList = null;
+               __pContext->__subModeAppName = __pPackageAppInfoImpl->GetName();
        }
 
+       __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl);
+       __pPackageAppInfoImpl = null;
+
+       __isDefaultName = false;
+
        __pContext->__pAppDataList->Add(__pAppData);
        __pAppData = null;
 
@@ -713,17 +714,18 @@ ManifestHandler::OnUiAppEndElement(void)
 bool
 ManifestHandler::OnServiceAppEndElement(void)
 {
-       __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl);
-       __pPackageAppInfoImpl = null;
-
-       __isDefaultName = false;
-
        if (__pContext->__isSubMode == true)
        {
                __pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
                __pAppData->__pAppControlDataList = null;
+               __pContext->__subModeAppName = __pPackageAppInfoImpl->GetName();
        }
 
+       __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl);
+       __pPackageAppInfoImpl = null;
+
+       __isDefaultName = false;
+
        __pContext->__pAppDataList->Add(__pAppData);
        __pAppData = null;
 
@@ -866,7 +868,7 @@ bool
 ManifestHandler::OnIdValue(const char *pCharacters)
 {
        AppLogTag(OSP_INSTALLER, "<Id>%s</Id>", pCharacters);
-       __pPackageInfoImpl->SetAppId(pCharacters);
+       __pPackageInfoImpl->SetId(pCharacters);
 
        return true;
 }
@@ -1374,7 +1376,7 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
        }
 
        String appId;
-       appId.Format(1024, PACKAGE_NAME_RULE, __pPackageInfoImpl->GetAppId().GetPointer(), pName);
+       appId.Format(1024, PACKAGE_NAME_RULE, __pPackageInfoImpl->GetId().GetPointer(), pName);
        __pPackageAppInfoImpl->SetPackageName(appId);
 
        AppLogTag(OSP_INSTALLER, " - appId=%ls", appId.GetPointer());
old mode 100644 (file)
new mode 100755 (executable)
index 1f6e72d..e8bfefb
@@ -97,7 +97,7 @@ main(int argc, char **argv)
        case PKGMGR_REQ_INSTALL:
                {
                        errorType = manager.Request(path, INSTALLER_OPERATION_INSTALL, REQUESTER_TYPE_NORMAL);
-                       appId = manager.GetAppId();
+                       appId = manager.GetId();
                        if (_pi != 0)
                        {
                                char resultBuf[128] = {0};
@@ -135,7 +135,7 @@ main(int argc, char **argv)
 
                        AppLogTag(OSP_INSTALLER, "requestAppId = %ls", requestAppId.GetPointer());
                        ret = manager.Request(requestAppId, INSTALLER_OPERATION_UNINSTALL, REQUESTER_TYPE_NORMAL);
-                       appId = manager.GetAppId();
+                       appId = manager.GetId();
 
                        if (_pi != 0)
                        {