#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130527.2]"
+#define OSP_INSTALLER_VERSION "version=[20130528.1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
#define FILE_EXT_INFO L"info"
#define VERSION_INFO_FILE L"/info/version.info"
#define COMPAT_INFO_FILE L"/info/compat.info"
+#define VIRTUAL_ROOT_INFO_FILE L"/info/virtualroot.info"
#define UISCALABILITY_INFO_FILE L"/info/uiscalability.info"
#define WEBSERVICE_INFO_FILE L"/info/webservice.info"
#define TYPE_INFO_FILE L"/info/type.info"
,__isAntiVirus(false)
,__isCsc(false)
,__isUninstallable(false)
+,__isVirtualRoot(false)
,__operation(INSTALLER_OPERATION_INSTALL)
,__storage(INSTALLATION_STORAGE_NONE)
,__rootCertType(ROOT_CERTIFICATE_NONE)
,__pAuthorCertList(null)
,__pDistributorCertList(null)
,__pDistributorCertList2(null)
+,__pSymbolicLinkList(null)
,__certType(0)
,__pPkgmgrInstaller(null)
{
delete __pDistributorCertList2;
__pDistributorCertList2 = null;
}
+
+ if (__pSymbolicLinkList)
+ {
+ __pSymbolicLinkList->RemoveAll();
+ delete __pSymbolicLinkList;
+ __pSymbolicLinkList = null;
+ }
}
InstallerError
__pDistributorCertList2 = new (std::nothrow) ArrayListT<String*>;
TryReturn(__pDistributorCertList2, INSTALLER_ERROR_OUT_OF_MEMORY, "__pDistributorCertList2 is null.");
+ __pSymbolicLinkList = new (std::nothrow) MultiHashMapT<String*, String*>;
+ TryReturn(__pSymbolicLinkList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pSymbolicLinkList is null.");
+ __pSymbolicLinkList->Construct();
+
return INSTALLER_ERROR_NONE;
}
bool __isAntiVirus;
bool __isCsc;
bool __isUninstallable;
+ bool __isVirtualRoot;
InstallerOperation __operation;
InstallationStorage __storage;
Tizen::Base::Collection::ArrayListT<Tizen::Base::String *>* __pDistributorCertList;
Tizen::Base::Collection::ArrayListT<Tizen::Base::String *>* __pDistributorCertList2;
+ Tizen::Base::Collection::MultiHashMapT<Tizen::Base::String*, Tizen::Base::String*>* __pSymbolicLinkList;
+
Tizen::Base::String __coreXmlPath;
Tizen::Base::String __inputPath;
Tizen::Base::String __packagePath;
InstallerUtil::CreateInfoFile(compatInfoFile, null);
}
+ if (pContext->__isVirtualRoot == true)
+ {
+ AppLog("[VirtualRoot] is detected");
+
+ String virtualRootInfoFile;
+ virtualRootInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), VIRTUAL_ROOT_INFO_FILE);
+ InstallerUtil::CreateInfoFile(virtualRootInfoFile, null);
+ }
+
String webServicePrivilege(TIZEN_PRIVILEGE_WEB_SERVICE);
if (FindPrivilege(pContext, webServicePrivilege) == true)
{
}
}
- bool firstPreloadedUpdate = false;
-
String roXmlPath;
roXmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->__packageId.GetPointer());
else
{
pContext->__coreXmlPath = rwXmlPath;
- if ((File::IsFileExist(roXmlPath) == true) && (File::IsFileExist(rwXmlPath) == false))
- {
- AppLog("First preloaded app update");
- firstPreloadedUpdate = true;
- }
}
std::unique_ptr<char[]> pXmlPath(_StringConverter::CopyToCharArrayN(pContext->__coreXmlPath));
}
else
{
-#if 0
- AppLog("pkgmgr_parser_parse_manifest_for_uninstallation() - START");
- if (firstPreloadedUpdate == false)
- {
- AppLog(" - uninstall path=[%s]", pXmlPath.get());
- pkgmgr_parser_parse_manifest_for_uninstallation(pXmlPath.get(), null);
- }
- else
- {
- std::unique_ptr<char[]> pRoXmlPath(_StringConverter::CopyToCharArrayN(roXmlPath));
- AppLog(" - uninstall path=[%s]", pRoXmlPath.get());
- pkgmgr_parser_parse_manifest_for_uninstallation(pRoXmlPath.get(), null);
- }
-
- AppLog("pkgmgr_parser_parse_manifest_for_uninstallation() - END");
-#endif
-
CreateCoreXmlFile(pContext);
}
if (File::IsFileExist(destPath) == false)
{
r = Directory::Create(destPath, false);
- TryReturn(!IsFailed(r), INSTALLER_ERROR_INTERNAL_STATE, "Directory::Create() failed");
+ TryReturn(!IsFailed(r), false, "Directory::Create() failed");
}
InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE, true);
smackManager.AddLabelDir(packageId, destPath);
return false;
}
}
+
+ if (pContext->__isVirtualRoot == true)
+ {
+ if (pContext->__pSymbolicLinkList->GetCount() > 0)
+ {
+ std::unique_ptr< IMapEnumeratorT<String*, String*> > pEnum(pContext->__pSymbolicLinkList->GetMapEnumeratorN());
+ TryReturn(pEnum, false, "pSymbolicLinkList->GetMapEnumeratorN() failed.");
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ String* pKey = null;
+ String* pValue = null;
+
+ pEnum->GetKey(pKey);
+ pEnum->GetValue(pValue);
+
+ AppLog("SymbolicLink - Src = [%ls], Des = [%ls]", pKey->GetPointer(), pValue->GetPointer());
+ }
+ }
+ }
AppLog("------------------------------------------");
return true;
{
status = OnPermissionStartElement(pName);
}
+ else if (strcasecmp(pName, "DirectoryConfig") == 0)
+ {
+ status = OnDirectoryConfigStartElement();
+ }
+ else if (strcasecmp(pName, "SymbolicLink") == 0)
+ {
+ status = OnSymbolicLinkStartElement();
+ }
if (!status)
{
}
bool
+ManifestHandler::OnDirectoryConfigStartElement()
+{
+ XmlAttribute* pAttr = GetAttribute();
+ TryReturn(pAttr, true, "pAttr is null.");
+
+ char* pVirtualRoot = pAttr->Find("VirtualRoot");
+ TryReturn(pVirtualRoot, false, "pVirtualRoot is null.");
+
+ if (strcasecmp(pVirtualRoot, "true") == 0)
+ {
+ __pContext->__isVirtualRoot = true;
+ }
+
+ AppLog("<DirectoryConfig VirtualRoot=\"%s\">", pVirtualRoot);
+
+ return true;
+}
+
+bool
+ManifestHandler::OnSymbolicLinkStartElement()
+{
+ XmlAttribute* pAttr = GetAttribute();
+ TryReturn(pAttr, true, "pAttr is null.");
+
+ char* pSource = pAttr->Find("Source");
+ TryReturn(pSource, false, "pSource is null.");
+
+ char* pDestination = pAttr->Find("Destination");
+ TryReturn(pDestination, false, "pDestination is null.");
+
+ __pContext->__pSymbolicLinkList->Add(new (std::nothrow) String(pSource), new (std::nothrow) String(pDestination));
+
+ AppLog("<SymbolicLink Source=\"%s\", Destination=\"%s\">", pSource, pDestination);
+
+ return true;
+}
+
+bool
ManifestHandler::OnLiveboxesStartElement(const char *pName)
{
__pParser = new (std::nothrow) ManifestLiveboxesParser;
bool OnContentStartElement(void);
bool OnMetadataStartElement(void);
+ bool OnDirectoryConfigStartElement(void);
+ bool OnSymbolicLinkStartElement(void);
// Parsers
bool OnLiveboxesStartElement(const char* pName);