From f06f96cc3a87de98b661c8a4391273af46a0536b Mon Sep 17 00:00:00 2001 From: Anthony Plunkett Date: Tue, 9 Feb 2016 17:28:51 -0400 Subject: [PATCH] Error reporting if deletion fails. --- assets/install.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/install.ps1 b/assets/install.ps1 index 5be61aa8..45e9b7c2 100644 --- a/assets/install.ps1 +++ b/assets/install.ps1 @@ -103,7 +103,13 @@ def main(): print 'Aborted!' sys.exit() - shutil.rmtree(get_location()) + 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