- LogInfo(
- "Widget install/update: incoming guid = '" <<
- update.incomingGUID << "'");
- LogInfo(
- "Widget install/update: incoming version = '" <<
- update.incomingVersion << "'");
-
- // Check policy
- WidgetUpdateMode::Type updateTypeCheckBit;
- JobWidgetInstall::ConfigureResult ret = ConfigureResult::Ok;
-
- if (update.existingWidgetInfo.isExist == false) {
- LogInfo("Widget info does not exist");
- updateTypeCheckBit = WidgetUpdateMode::NotInstalled;
- } else {
- LogInfo("Widget info exists. PkgName: " <<
- update.existingWidgetInfo.pkgname);
+ ConfigureResult result = ConfigureResult::Failed;
+ WidgetUpdateInfo update;
+
+ // checking installed web application
+ Try {
+ // checking existing application is installed
+ WidgetDAOReadOnly dao(m_installerContext.widgetConfig.tzAppid);
+ // no excpetion means, it isn't update mode
+ getInstallerStruct().pkgmgrInterface->sendSignal(
+ PKGMGR_START_KEY,
+ PKGMGR_START_UPDATE);
+
+ update = detectWidgetUpdate(configData,
+ m_installerContext.widgetConfig.tzAppid);
+ result = checkWidgetUpdate(update);
+ if (result != ConfigureResult::Updated) {
+ // Already installed TizenAppId. return failed
+ return ConfigureResult::Failed_AlreadyInstalled;
+ }
+ m_installerContext.isUpdateMode = true;
+ }
+ Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) {
+ result = ConfigureResult::Ok;
+ getInstallerStruct().pkgmgrInterface->sendSignal(
+ PKGMGR_START_KEY,
+ PKGMGR_START_INSTALL);
+ m_installerContext.isUpdateMode = false;
+
+ if (!validateTizenApplicationID(
+ m_installerContext.widgetConfig.tzAppid))
+ {
+ LogError("tizen application ID is already used");
+ return ConfigureResult::Failed_InvalidConfig;
+ }
+ if (!validateTizenPackageID(m_installerContext.widgetConfig.tzPkgid)) {
+ LogError("tizen package ID is already used");
+ return ConfigureResult::Failed_AlreadyInstalled;
+ }
+ }