@@ -1175,17 +1175,10 @@ def uninstall_game(self, args):
11751175 def _handle_uninstaller (self , igame , yes = False ):
11761176 uninstaller = igame .uninstaller
11771177
1178- print ('\n This game lists the following prerequisites to be installed:' )
1179- print (f'- { " " .join ((uninstaller ["path" ], uninstaller ["args" ]))} \n ' )
1180-
1181- # default to yes
1182- c = 'y'
1183- if not yes :
1184- choice = input ('Do you wish to run the uninstaller? ([y]es, [n]o): ' )
1185- if choice :
1186- c = choice .lower ()[0 ]
1187-
1188- if c == 'y' : # set to installed and launch installation
1178+ print ('\n This game provides the following uninstaller:' )
1179+ print (f'- { uninstaller ["path" ]} { uninstaller ["args" ]} \n ' )
1180+
1181+ if yes or get_boolean_choice ('Do you wish to run the uninstaller?' , default = True ):
11891182 logger .info ('Running uninstaller...' )
11901183 req_path , req_exec = os .path .split (uninstaller ['path' ])
11911184 work_dir = os .path .join (igame .install_path , req_path )
@@ -1195,8 +1188,6 @@ def _handle_uninstaller(self, igame, yes=False):
11951188 p .wait ()
11961189 except Exception as e :
11971190 logger .error (f'Failed to run uninstaller: { e !r} ' )
1198- elif c != 'n' :
1199- print ('Invalid choice, not running uninstaller...' )
12001191
12011192 def verify_game (self , args , print_command = True , repair_mode = False , repair_online = False ):
12021193 args .app_name = self ._resolve_aliases (args .app_name )
0 commit comments