def getVersion(self, client, fullFileName):
     if fullFileName:
         fileVer = file_ver_lib.getWindowsWMICFileVer(client, fullFileName)
         if not fileVer:
             fileVer = file_ver_lib.getWindowsShellFileVer(client, fullFileName)
         if fileVer:
             return fileVer
 def process(self, context):
     client = context.client
     applicationOsh = context.application.getOsh()
     process = context.application.getProcess(EX_2003_MAIN_PROCESS) 
     fileVer = None
     if not process:
         process = context.application.getProcess(EX_2007_MAIN_PROCESS)
     
     fullFileName = process.executablePath
     if fullFileName:
         try:
             fileVer = file_ver_lib.getWindowsWMICFileVer(client, fullFileName)
         except:
             logger.warn('Get version info using wmic failure')
         if not fileVer:
             try:
                 fileVer = file_ver_lib.getWindowsShellFileVer(client, fullFileName)
             except:
                 logger.warn('Get version info using Windows shell failure.')
             
         if fileVer:
             truncatedVersion = re.match('(\d+\.\d+).*',fileVer)
             if truncatedVersion and FILE_VERSION_TO_PRODUCT_VERSION.has_key(truncatedVersion.group(1)):
                 applicationOsh.setAttribute("application_version_number", FILE_VERSION_TO_PRODUCT_VERSION[truncatedVersion.group(1)])
             else:
                 logger.warn('Unknown product version %s' % fileVer)
         else: 
             logger.warn('For file %s no version found.' % fullFileName)
     else:
         logger.warn('Process %s full path is not available.' % process.getName())
Beispiel #3
0
 def getVersion(self, client, fullFileName):
     if fullFileName:
         fileVer = file_ver_lib.getWindowsWMICFileVer(client, fullFileName)
         if not fileVer:
             fileVer = file_ver_lib.getWindowsShellFileVer(
                 client, fullFileName)
         if fileVer:
             return fileVer
 def getVersion(self, client, fullFileName):
     if fullFileName:
         fileVer = file_ver_lib.getWindowsWMICFileVer(client, fullFileName)
         if not fileVer:
             fileVer = file_ver_lib.getWindowsShellFileVer(client, fullFileName)
         if fileVer:
             validVer = re.match('\s*(\d+\.\d+)', fileVer)
             if validVer and validVer.group(1):
                 return validVer.group(1)
 def getVersion(self, client, fullFileName):
     if fullFileName:
         fileVer = file_ver_lib.getWindowsWMICFileVer(client, fullFileName)
         if not fileVer:
             fileVer = file_ver_lib.getWindowsShellFileVer(
                 client, fullFileName)
         if fileVer:
             validVer = re.match('\s*(\d+\.\d+)', fileVer)
             if validVer and validVer.group(1):
                 return validVer.group(1)
 def getVersion(self, client, fullFileName):
     if fullFileName:
         fileVer = file_ver_lib.getWindowsWMICFileVer(client, fullFileName)
         if not fileVer:
             fileVer = file_ver_lib.getWindowsShellFileVer(client, fullFileName)
         if fileVer:
             validVer = re.match('\s*(\d+)\,\s+(\d+)\,\s+(\d*),\s+(\d+)',fileVer)
             if validVer:
                 readableVer = validVer.group(1).strip()+'.'+validVer.group(2).strip()+'.'+validVer.group(3).strip()+'.'+validVer.group(4).strip() 
                 return readableVer
 def process(self, context):
     applicationOsh = context.application.getOsh()
     version = None
     try:
         version = getWindowsWMICFileVer(self.__client, self.__path)
     except Exception, e:
         logger.warn("Failed to get version by WMIC: %s" % e)
         try:
             version = getWindowsShellFileVer(self.__client, self.__path)
         except Exception, e:
             logger.warn("Failed to get version by VBS: %s" % e)
Beispiel #8
0
 def process(self, context):
     applicationOsh = context.application.getOsh()
     version = None
     try:
         version = getWindowsWMICFileVer(self.__client, self.__path)
     except Exception, e:
         logger.warn("Failed to get version by WMIC: %s" % e)
         try:
             version = getWindowsShellFileVer(self.__client, self.__path)
         except Exception, e:
             logger.warn("Failed to get version by VBS: %s" % e)
 def process(self, context):
     applicationOsh = context.application.getOsh()
     version = getWindowsWMICFileVer(self.__client, self.__path)
     if not version:
         version = getWindowsShellFileVer(self.__client, self.__path)
     if version:
         match = re.match('\s*(\d+\.\d+)', version)
         if match:
             logger.debug('File version: %s' % match.group(1))
             applicationOsh.setAttribute("application_version_number", match.group(1))
     else:
         logger.debug('Cannot get file version.')
Beispiel #10
0
 def getVersion(self):
     for process in self.processes:
         fullFileName = process.executablePath
         if fullFileName:
             fileVer = file_ver_lib.getWindowsWMICFileVer(self.client, fullFileName)
             if not fileVer:
                 fileVer = file_ver_lib.getWindowsShellFileVer(self.client, fullFileName)
             if fileVer:
                 validVer = re.match('\s*(\d+\.\d+).*',fileVer)
                 if validVer and validVer.group(1):
                     logger.debug('Found version ' + validVer.group(1))
                     self.version = validVer.group(1)
                     break
 def process(self, context):
     client = context.client
     applicationOsh = context.application.getOsh()
     processes = context.application.getProcesses()
     for process in processes:
         fullFileName = process.executablePath
         if fullFileName:
             fileVer = file_ver_lib.getWindowsWMICFileVer(client, fullFileName)
             if not fileVer:
                 fileVer = file_ver_lib.getWindowsShellFileVer(client, fullFileName)
             if fileVer:
                 applicationOsh.setAttribute("application_version_number", fileVer)
                 break
Beispiel #12
0
 def process(self, context):
     applicationOsh = context.application.getOsh()
     version = getWindowsWMICFileVer(self.__client, self.__path)
     if not version:
         version = getWindowsShellFileVer(self.__client, self.__path)
     if version:
         match = re.match('\s*(\d+\.\d+)', version)
         if match:
             logger.debug('File version: %s' % match.group(1))
             applicationOsh.setAttribute("application_version_number",
                                         match.group(1))
     else:
         logger.debug('Cannot get file version.')
 def process(self, context):
     applicationOsh = context.application.getOsh()
     for allowedProc in self.__allowedProcesses:
         process = context.application.getProcess(allowedProc)
         if process and process.executablePath:
             processPath = process.executablePath
             rawVersion = getWindowsWMICFileVer(self.__client, processPath)
             if not rawVersion:
                 rawVersion = getWindowsShellFileVer(self.__client, processPath)
             if rawVersion:
                 version = re.match(r"\s*(\d+.\d+)", rawVersion)
                 if version:
                     applicationOsh.setAttribute("application_version_number", version.group(1).strip())
 def getVersion(self):
     for process in self.processes:
         fullFileName = process.executablePath
         if fullFileName:
             fileVer = file_ver_lib.getWindowsWMICFileVer(self.client, fullFileName)
             if not fileVer:
                 fileVer = file_ver_lib.getWindowsShellFileVer(self.client, fullFileName)
             if fileVer:
                 validVer = re.match("\s*(\d+\.\d+).*", fileVer)
                 if validVer and validVer.group(1):
                     logger.debug("Found version " + validVer.group(1))
                     self.version = validVer.group(1)
                     break
Beispiel #15
0
 def getVersion(self, client, fullFileName):
     if fullFileName:
         fileVer = file_ver_lib.getWindowsWMICFileVer(client, fullFileName)
         if not fileVer:
             fileVer = file_ver_lib.getWindowsShellFileVer(
                 client, fullFileName)
         if fileVer:
             validVer = re.match('\s*(\d+)\,\s+(\d+)\,\s+(\d*),\s+(\d+)',
                                 fileVer)
             if validVer:
                 readableVer = validVer.group(1).strip(
                 ) + '.' + validVer.group(2).strip() + '.' + validVer.group(
                     3).strip() + '.' + validVer.group(4).strip()
                 return readableVer
 def process(self, context):
     path = self.__process.executablePath
     if path:
         version = file_ver_lib.getWindowsWMICFileVer(self.__client, path)
         if not version:
             logger.debug('Failed getting version by WMIC.')
             logger.debug('Trying get version by Shell....')
             version = file_ver_lib.getWindowsShellFileVer(self.__client, path)
         if version:
             parsedVersion = self.__parseVersion(version)
             self.__applicationOsh.setAttribute("application_version_number", parsedVersion)
         else:
             logger.debug('Failed getting version for IBM WebSphere MQ using NTCMD protocol.')
     else:
         logger.debug('Filed getting full process path for IBM WebSphere MQ using NTCMD protocol.')
 def process(self, context):
     applicationOsh = context.application.getOsh()
     for allowedProc in self.__allowedProcesses:
         process = context.application.getProcess(allowedProc)
         if process and process.executablePath:
             processPath = process.executablePath
             rawVersion = getWindowsWMICFileVer(self.__client, processPath)
             if not rawVersion:
                 rawVersion = getWindowsShellFileVer(
                     self.__client, processPath)
             if rawVersion:
                 version = re.match(r"\s*(\d+.\d+)", rawVersion)
                 if version:
                     applicationOsh.setAttribute(
                         "application_version_number",
                         version.group(1).strip())
 def process(self, context):
     for execFile in LotusDominoVersionFromExecutableByNtcmdPlugin.TARGET_EXEC_FILES:
         process = context.application.getProcess(execFile)
         if process:
             processPath = process.executablePath
             if processPath:
                 logger.debug("Getting version by process path '%s'" % processPath)
                 try:
                     version = getWindowsWMICFileVer(context.client, processPath)
                     if version:
                         logger.debug("Lotus Domino version found: %s" % version)
                         applicationOsh = context.application.getOsh()
                         applicationOsh.setAttribute("application_version_number", version)
                         break
                 except:
                     logger.debugException("Failed getting version by process path '%s'" % processPath)
Beispiel #19
0
 def process(self, context):
     path = self.__process.executablePath
     if path:
         version = file_ver_lib.getWindowsWMICFileVer(self.__client, path)
         if not version:
             logger.debug('Failed getting version by WMIC.')
             logger.debug('Trying get version by Shell....')
             version = file_ver_lib.getWindowsShellFileVer(
                 self.__client, path)
         if version:
             parsedVersion = self.__parseVersion(version)
             self.__applicationOsh.setAttribute(
                 "application_version_number", parsedVersion)
         else:
             logger.debug(
                 'Failed getting version for IBM WebSphere MQ using NTCMD protocol.'
             )
     else:
         logger.debug(
             'Filed getting full process path for IBM WebSphere MQ using NTCMD protocol.'
         )
 def process(self, context):
     for execFile in LotusDominoVersionFromExecutableByNtcmdPlugin.TARGET_EXEC_FILES:
         process = context.application.getProcess(execFile)
         if process:
             processPath = process.executablePath
             if processPath:
                 logger.debug("Getting version by process path '%s'" %
                              processPath)
                 try:
                     version = getWindowsWMICFileVer(
                         context.client, processPath)
                     if version:
                         logger.debug("Lotus Domino version found: %s" %
                                      version)
                         applicationOsh = context.application.getOsh()
                         applicationOsh.setAttribute(
                             "application_version_number", version)
                         break
                 except:
                     logger.debugException(
                         "Failed getting version by process path '%s'" %
                         processPath)
    def process(self, context):
        client = context.client
        applicationOsh = context.application.getOsh()
        process = context.application.getProcess(EX_2003_MAIN_PROCESS)
        fileVer = None
        if not process:
            process = context.application.getProcess(EX_2007_MAIN_PROCESS)

        fullFileName = process.executablePath
        if fullFileName:
            try:
                fileVer = file_ver_lib.getWindowsWMICFileVer(
                    client, fullFileName)
            except:
                logger.warn('Get version info using wmic failure')
            if not fileVer:
                try:
                    fileVer = file_ver_lib.getWindowsShellFileVer(
                        client, fullFileName)
                except:
                    logger.warn(
                        'Get version info using Windows shell failure.')

            if fileVer:
                truncatedVersion = re.match('(\d+\.\d+).*', fileVer)
                if truncatedVersion and FILE_VERSION_TO_PRODUCT_VERSION.has_key(
                        truncatedVersion.group(1)):
                    applicationOsh.setAttribute(
                        "application_version_number",
                        FILE_VERSION_TO_PRODUCT_VERSION[truncatedVersion.group(
                            1)])
                else:
                    logger.warn('Unknown product version %s' % fileVer)
            else:
                logger.warn('For file %s no version found.' % fullFileName)
        else:
            logger.warn('Process %s full path is not available.' %
                        process.getName())
 def getVersionByNTCMD(self, client, fullFileName):
     r'@types: shellutils.Shell, str -> str or None'
     if fullFileName:
         fileVer = (file_ver_lib.getWindowsWMICFileVer(client, fullFileName)
               or file_ver_lib.getWindowsShellFileVer(client, fullFileName))
         return self.parseFileVersion(fileVer)
 def getVersionByPathUsingWmic(self, context, path):
     try:
         return file_ver_lib.getWindowsWMICFileVer(context.client, path)
     except:
         logger.debugException("Exception when getting version by path '%s'\n" % path)
Beispiel #24
0
 def getVersionByPathUsingWmic(self, context, path):
     try:
         return file_ver_lib.getWindowsWMICFileVer(context.client, path)
     except:
         logger.debugException(
             "Exception when getting version by path '%s'\n" % path)