#NEWLINE# def Install( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# for update in self . search_results . Updates : #NEWLINE# #INDENT# if update . IsDownloaded : #NEWLINE# #INDENT# self . install_collection . Add ( self ) #NEWLINE# #UNINDENT# #UNINDENT# log . debug ( 'Updates prepared. beginning installation' ) #NEWLINE# #UNINDENT# except Exception as exc : #NEWLINE# #INDENT# log . info ( 'Preparing install list failed: {0}' . format ( exc ) ) #NEWLINE# return exc #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# for update in self . search_results . Updates : #NEWLINE# #INDENT# if ( not update . EulaAccepted ) : #NEWLINE# #INDENT# log . debug ( 'Accepting EULA: {0}' . format ( update . Title ) ) #NEWLINE# update . AcceptEula ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except Exception as exc : #NEWLINE# #INDENT# log . info ( 'Accepting Eula failed: {0}' . format ( exc ) ) #NEWLINE# return exc #NEWLINE# #UNINDENT# if ( self . install_collection . Count != 0 ) : #NEWLINE# #INDENT# log . debug ( 'Install list created, about to install' ) #NEWLINE# try : #NEWLINE# #INDENT# self . install_results = self . win_installer . Install ( ) #NEWLINE# log . info ( 'Installation of updates complete' ) #NEWLINE# return True #NEWLINE# #UNINDENT# except Exception as exc : #NEWLINE# #INDENT# log . info ( 'Installation failed: {0}' . format ( exc ) ) #NEWLINE# return exc #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# log . info ( 'no new updates.' ) #NEWLINE# return True