- Timestamp:
- Jan 4, 2017 3:44:31 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/vboxinstaller.py
r62484 r65114 719 719 # 720 720 721 ## VBox windows services we can query the status of. 722 kasWindowsServices = [ 'vboxdrv', 'vboxusbmon' ]; 723 721 724 def _installVBoxOnWindows(self): 722 725 """ Installs VBox on Windows.""" … … 769 772 return fRc; 770 773 774 def _isProcessPresent(self, sName): 775 """ Checks whether the named process is present or not. """ 776 for oProcess in utils.processListAll(): 777 sBase = oProcess.getBaseImageNameNoExeSuff(); 778 if sBase is not None and sBase.lower() == sName: 779 return True; 780 return False; 781 782 def _killProcessesByName(self, sName, sDesc): 783 """ Checks whether the named process is present or not. """ 784 cKilled = 0; 785 for oProcess in utils.processListAll(): 786 sBase = oProcess.getBaseImageNameNoExeSuff(); 787 if sBase is not None and sBase.lower() == sName: 788 reporter.log('Killing %s process: %s (%s)' % (sDesc, oProcess.iPid, sBase)); 789 utils.processKill(oProcess.iPid); 790 cKilled += 1; 791 return cKilled; 792 771 793 def _uninstallVBoxOnWindows(self): 772 794 """ … … 793 815 794 816 # Before we start uninstalling anything, just ruthlessly kill any 795 # msiexec process we might find hanging around.817 # msiexec and drvinst process we might find hanging around. 796 818 cKilled = 0; 797 for oProcess in utils.processListAll(): 798 sBase = oProcess.getBaseImageNameNoExeSuff(); 799 if sBase is not None and sBase.lower() in [ 'msiexec', ]: 800 reporter.log('Killing MSI process: %s (%s)' % (oProcess.iPid, sBase)); 801 utils.processKill(oProcess.iPid); 802 cKilled += 1; 803 if cKilled > 0: 804 time.sleep(16); # fudge. 819 if self._isProcessPresent('drvinst'): 820 time.sleep(15); # In the hope that it goes away. 821 cKilled = self._killProcessesByName('drvinst', 'MSI driver installation'); 822 if cKilled > 0: 823 time.sleep(15); # Give related MSI process a chance to clean up after we killed the driver installer. 824 825 if self._isProcessPresent('msiexec'): 826 time.sleep(15); # In the hope that it goes away. 827 cKilled = self._killProcessesByName('msiexec', 'MSI driver installation'); 828 if cKilled > 0: 829 time.sleep(16); # fudge. 805 830 806 831 # Do the uninstalling. … … 822 847 if fRc is False and os.path.isfile(sLogFile): 823 848 reporter.addLogFile(sLogFile, 'log/uninstaller'); 849 850 # Log driver service states (should ls \Driver\VBox* and \Device\VBox*). 851 for sService in self.kasWindowsServices: 852 self._sudoExecuteSync(['sc.exe', 'query', sService]); 853 824 854 return fRc; 825 855
Note:
See TracChangeset
for help on using the changeset viewer.