12 Replies Latest reply on Oct 5, 2018 1:22 AM by Andrew Waters

    Unable to get installation dates for software from windows registry using TPL.

    Anita Hatagale

      Hi All,

       

      We are trying to run tpl for retrieving installation dates for software's on windows OS. unable to get expected result.

       

      Version details:

      ADDM 11.3 (CentOs 6) .

      TPL 1.5

       

      below is the tpl we are trying:

       

      tpl 1.5 module install_date;

       

      pattern soft_instance 1.0

         """

        This is a template pattern for a simple SoftwareInstance based on

        identifying a process.

        This required description block should be replaced with a

        description of the pattern and the product it is identifying. The

        description appears as an attribute on the Pattern node stored in

        the data store.

        """

          overview

              tags TKU, OpenText, Server;

          end overview;

          triggers

             on pi := Host created,confirmed;

          end triggers;

          body

              host := model.host(pi);

              hostname := host.name;

              log.debug("test 1 %hostname%");

              processors_list := discovery.listRegistry(host, 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall');

               if processors_list then

                  num_threads := size(processors_list);

                  for processor in processors_list do

                      processor_type := discovery.registryKey(host,'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%processor.name%\\DisplayName');

                       if processor_type and processor_type.value then

                          si_type := processor_type.value;

                         log.debug("%si_type%");

                      end if;

                    end for;

             num_threads := size(processors_list);

             log.debug("%num_threads%");

              log.debug("print something"); 

           end if;               

          end body;

      end pattern;

       

       

      please suggest!

       

      Thanks in advance.

       

      Regards,

      Anita.