diff --git a/assets/install.ps1 b/assets/install.ps1 index 45e9b7c2..80fe01e4 100644 --- a/assets/install.ps1 +++ b/assets/install.ps1 @@ -33,6 +33,12 @@ def find_location(): return None, None return install_dir, os.path.join(install_dir, LIB) +def deletion_error(func, path, excinfo): + print 'Problem deleting {}'.format(path) + print 'Please try and delete {} manually'.format(path) + print 'Aborted!' + sys.exit() + def fail(message): print 'Error: %s' % message sys.exit(1) @@ -98,20 +104,12 @@ def main(): ).lower().strip() if input in ('', 'y'): + shutil.rmtree(get_location()) break elif input == 'n': print 'Aborted!' sys.exit() - def report_error(func, path, excinfo): - print('Problem deleting {}, {}, {}'.format(func, path, excinfo)) - print('Please try and delete {} manually'.format(get_location()) - print('Aborted!') - sys.exit() - - shutil.rmtree(get_location(), onerror=report_error) - - print ' Installing at: %s' % install_dir while 1: input = raw_input('Continue? [Yn] ').lower().strip()