aboutsummaryrefslogtreecommitdiffstats
path: root/packaging-tools/bldinstallercommon.py
diff options
context:
space:
mode:
Diffstat (limited to 'packaging-tools/bldinstallercommon.py')
-rw-r--r--packaging-tools/bldinstallercommon.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/packaging-tools/bldinstallercommon.py b/packaging-tools/bldinstallercommon.py
index a3518dfd8..ddad07a89 100644
--- a/packaging-tools/bldinstallercommon.py
+++ b/packaging-tools/bldinstallercommon.py
@@ -365,7 +365,16 @@ def remove_tree(path):
if os.path.isdir(path) and os.path.exists(path):
if IS_WIN_PLATFORM:
path = win32api.GetShortPathName(path.replace('/', '\\'))
- shutil.rmtree(path)
+ #a funny thing is that rmdir does not set an exitcode it is just using the last set one
+ try:
+ runCommand(['rmdir', path, '/S', '/Q'], SCRIPT_ROOT_DIR, onlyErrorCaseOutput=True)
+ except:
+ traceback.print_exc()
+ pass
+ else:
+ #shutil.rmtree(path)
+ runCommand(['rm', '-rf', path], SCRIPT_ROOT_DIR, onlyErrorCaseOutput=True)
+ return not os.path.exists(path)
###############################