#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130429.3]"
+#define OSP_INSTALLER_VERSION "version=[20130430.1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
INSTALLER_OPTION_NO_INPUT = 16,
INSTALLER_OPTION_FILELOG_ON = 32,
INSTALLER_OPTION_UPDATE_STDOUT = 64,
+ INSTALLER_OPTION_CSC = 128,
};
,__isUpdated(false)
,__isAppSetting(false)
,__isAntiVirus(false)
+,__isCsc(false)
+,__isUninstallable(true)
,__operation(INSTALLER_OPERATION_INSTALL)
,__storage(INSTALLATION_STORAGE_INTERNAL)
,__rootCertType(ROOT_CERTIFICATE_NONE)
Tizen::Base::Collection::IListT<AppData *>* __pAppDataList;
bool __isOspCompat;
-
bool __isPreloaded;
bool __isHybridService;
bool __isVerificationMode;
bool __isUpdated;
bool __isAppSetting;
bool __isAntiVirus;
+ bool __isCsc;
+ bool __isUninstallable;
InstallerOperation __operation;
InstallationStorage __storage;
Tizen::Base::String __author;
Tizen::Base::String __url;
Tizen::Base::String __description;
- Tizen::App::AppId __storeClientId;
+ Tizen::App::PackageId __storeClientId;
Tizen::Base::String __additionalErrorString;
int __certType;
SetPreloadedProperty(packageId);
}
+ if (pContext->__isCsc == true)
+ {
+ SetPackageProperty(pContext);
+ }
+
SmackManager smackManager;
smackManager.Construct(pContext);
smackManager.EnablePermissions(packageId);
return ret;
}
+
+bool
+ConfigurationManager::SetPackageProperty(InstallationContext* pContext) const
+{
+ TryReturn(pContext, false, "pContext is null.");
+
+ std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(pContext->__packageId));
+ TryReturn(pPackageId, false, "pPackageId is null.");
+
+ bool ret = true;
+ int res = PMINFO_R_OK;
+ int removable = 1;
+ pkgmgrinfo_pkgdbinfo_h handle = null;
+
+ if (pContext->__isUninstallable == false)
+ {
+ removable = 0;
+ }
+
+ res = pkgmgrinfo_create_pkgdbinfo(pPackageId.get(), &handle);
+ TryCatch(res == PMINFO_R_OK, ret = false, "pkgmgrinfo_create_pkgdbinfo() failed. [%d]", res);
+
+ res = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
+ TryCatch(res == PMINFO_R_OK, ret = false, "pkgmgrinfo_set_preload_to_pkgdbinfo() failed. [%d]", res);
+
+ res = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, removable);
+ TryCatch(res == PMINFO_R_OK, ret = false, "pkgmgrinfo_set_removable_to_pkgdbinfo(%d) failed. [%d]", removable, res);
+
+ res = pkgmgrinfo_save_pkgdbinfo(handle);
+ TryCatch(res == PMINFO_R_OK, ret = false, "pkgmgrinfo_save_pkgdbinfo() failed. [%d]", res);
+
+ AppLog("Preloaded property is set. [%s]", pPackageId.get());
+ AppLog("Removable property is set. [%s]", removable?"true":"false");
+
+CATCH:
+ if (handle)
+ {
+ pkgmgrinfo_destroy_pkgdbinfo(handle);
+ }
+
+ return ret;
+}
bool CreateImeSymlink(const Tizen::Base::String& binaryPath, const Tizen::Base::String& packageName);
bool FindPrivilege(InstallationContext* pContext, const Tizen::Base::String& privilege) const;
bool SetPreloadedProperty(const Tizen::App::PackageId& packageId) const;
+ bool SetPackageProperty(InstallationContext* pContext) const;
}; // ConfigurationManager
}
else
{
+ if (option & INSTALLER_OPTION_CSC)
+ {
+ AppLog("INSTALLER_OPTION_CSC is detected.");
+ __pContext->__isCsc = true;
+ }
+
installerType = INSTALLER_TYPE_PACKAGE;
__pContext->__packagePath = newPath;
}
AppLog(" # storeClient = [%ls]", storeClientId.GetPointer());
}
-#if 0
- if (removable.IsEmpty() == false)
+ if (removable.Equals(L"false", false) == true)
{
- // TODO : removable
+ __pContext->__isUninstallable = false;
+ AppLog(" # removable = [false]");
}
-#endif
-
}
return true;
AppLog("__osp_installer_parse_options: c");
option = (InstallerOption)(option | INSTALLER_OPTION_UPDATE_STDOUT);
+ option = (InstallerOption)(option | INSTALLER_OPTION_CSC);
*mode = INSTALLER_MODE_PARSE_CSC_STRING;
AppLog("__osp_installer_parse_options: argv[optind] = [%s]", argv[optind]);
strncpy(buf, argv[optind], BUFSIZE);
String path;
String removable;
+ // format -> "path=/opt/usr/apps/22VoFBmj2I/:op=install:removable=true"
+ // format -> "path=yandexmaps:op=uninstall"
+
while (pEnum->MoveNext() == E_SUCCESS)
{
String* pKey = static_cast< String* > (pEnum->GetKey());
if (op.Equals(L"install", false) == true)
{
- errorType = InstallerManager::Request(path, INSTALLER_OPERATION_INSTALL, option, null);
+ errorType = InstallerManager::Request(path, INSTALLER_OPERATION_INSTALL, option, null, &buffer);
}
else if (op.Equals(L"uninstall", false) == true)
{