def app(i): for app in winapps.search_installed(i): app = str(app) path = app[app.find('WindowsPath') + 13:app.find('install_source') - 4] print(path) return path + r'/' + i.lower() + '.exe'
def getLocationOfExe(self, exe): import winapps for app in winapps.search_installed(exe): if app != "": result = self.__Get_App_Path( self.__regexGetInstallLocation(app), exe) if result != "": return (result) return ("")
def verify_software(self): ''' This method verify SSY is install or not Returns ------- verify_flag : int This flag indicate SSY is installed or not 0 = not installed 1 = installed jre_flag : int This flag indicate JRE is installed or not 0 = not installed 1 = installed ''' verify_flag = 0 install_flag = 0 for item in winapps.search_installed('DataCore SANsymphony'): install_flag = 1 del item if install_flag == 1: flag, jre_flag = self.verify_jre() if flag == 1: verify_flag = 1 return verify_flag, jre_flag
def search_installed_npp() -> Optional[InstalledApplication]: try: return next(winapps.search_installed(re.escape(NPP_NAME))) except StopIteration: return None
def check_software(software_name): for item in winapps.search_installed(software_name): print(item)
import subprocess as s import winapps a = int(input("press 1 for making ping request and 2 for checking software=")) if a == 1: ip = input("Enter the ip=") #enter ip address 127.0.0.1 in this format if (s.call(["ping", ip]) == 0): #pinging using subprocess module print("host is up") else: print("host is down") elif a == 2: p = input("Enter the programe to be search=" ) #enter the programe name to be search for item in winapps.search_installed( p): # searching programe using 3rd party module print(item) else: print("wrong choice")