Support Multi-Package Install Scenario
[platform/core/dotnet/launcher.git] / NativeLauncher / installer-plugin / dotnet_apptype_plugin.cc
index 0cff386..973a806 100644 (file)
 typedef struct _xmlDoc xmlDoc;
 typedef xmlDoc* xmlDocPtr;
 
-static bool pluginInstalled = false;
+static std::string prevInstallPkgId = std::string("");
 
 extern "C" int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr doc, const char* pkgId)
 {
+       if (pkgId == NULL) {
+               return 0;
+       }
+
        // Can be multiple apps in one package
-       if (pluginInstalled) {
-               _INFO("Plugin already installed");
+       if (strcmp(pkgId, prevInstallPkgId.c_str()) == 0) {
+               _INFO("AppType Plugin already run for same pkgId (%s)", pkgId);
                return 0;
        }
-       pluginInstalled = true;
+       prevInstallPkgId = pkgId;
 
        std::string appType = getAppType(pkgId);
        if (appType.empty()) {