const int _MAX_CATEGORY = 12;
const int _MAX_PACKAGE_ID_LENGTH = 10;
-const char _APP_PATH_FORMAT[] = "/opt/apps/0000000000/bin/%ls";
+const char _APP_PATH_FORMAT[] = "/opt/usr/apps/0000000000/bin/%ls";
+const char _APP_PATH_FORMAT2[] = "/opt/apps/0000000000/bin/%ls";
+const char PATH_ROOT[] = "/opt/usr/apps/";
+const char PATH_ROOT2[] = "/opt/apps/";
}
char path[FILENAME_MAX];
memset(path, '\0', FILENAME_MAX);
- snprintf(path, FILENAME_MAX, _APP_PATH_FORMAT, appId.GetPointer() + 11);
+#if 0
+ snprintf(path, FILENAME_MAX, _APP_PATH_FORMAT2, appId.GetPointer() + 11);
- int ret = wcstombs(path + strlen("/opt/apps/"), appId.GetPointer(), 10);
+ int ret = wcstombs(path + strlen(PATH_ROOT2), appId.GetPointer(), 10);
if (ret == -1)
{
SysLogException(NID_APP, E_SYSTEM, "Launching service (%ls)(%s) failed with [%s].", appId.GetPointer(), path, strerror(errno));
_Process::Exit(1);
}
+#else
+ snprintf(path, FILENAME_MAX, _APP_PATH_FORMAT2, appId.GetPointer() + 11);
+
+ int ret = wcstombs(path + strlen(PATH_ROOT2), appId.GetPointer(), 10);
+ if (ret == -1)
+ {
+ SysLogException(NID_APP, E_SYSTEM, "Launching service (%ls)(%s) failed with [%s].", appId.GetPointer(), path, strerror(errno));
+ _Process::Exit(1);
+ }
+
+ if (access(path, R_OK) != 0)
+ {
+ snprintf(path, FILENAME_MAX, _APP_PATH_FORMAT, appId.GetPointer() + 11);
+
+ ret = wcstombs(path + strlen(PATH_ROOT), appId.GetPointer(), 10);
+ if (ret == -1)
+ {
+ SysLogException(NID_APP, E_SYSTEM, "Launching service (%ls)(%s) failed with [%s].", appId.GetPointer(), path, strerror(errno));
+ _Process::Exit(1);
+ }
+ }
+#endif
SysLog(NID_APP, "Launching %s.", path);