aboutsummaryrefslogtreecommitdiff
path: root/src/dutil/dirutil.cpp
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-04-08 14:06:21 -0700
committerRob Mensching <rob@firegiant.com>2021-04-12 12:29:11 -0700
commitb2c4600453f926fbfdc63219126930ad39601f25 (patch)
treeb7c8429ffcfe4f1f8b98f9e43b00d671b2d3a1d6 /src/dutil/dirutil.cpp
parent0c2b4cf3a439eda3e19d20fadfc65ddc7d0394c0 (diff)
downloadwix-b2c4600453f926fbfdc63219126930ad39601f25.tar.gz
wix-b2c4600453f926fbfdc63219126930ad39601f25.tar.bz2
wix-b2c4600453f926fbfdc63219126930ad39601f25.zip
Port missing WiX v3 changes
Diffstat (limited to 'src/dutil/dirutil.cpp')
-rw-r--r--src/dutil/dirutil.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/dutil/dirutil.cpp b/src/dutil/dirutil.cpp
index 81130a8d..b10e71f3 100644
--- a/src/dutil/dirutil.cpp
+++ b/src/dutil/dirutil.cpp
@@ -353,6 +353,37 @@ LExit:
353 353
354 354
355/******************************************************************* 355/*******************************************************************
356DirDeleteEmptyDirectoriesToRoot - removes an empty directory and as many
357 of its parents as possible.
358
359 Returns: count of directories deleted.
360*******************************************************************/
361extern "C" DWORD DAPI DirDeleteEmptyDirectoriesToRoot(
362 __in_z LPCWSTR wzPath,
363 __in DWORD /*dwFlags*/
364 )
365{
366 DWORD cDeletedDirs = 0;
367 LPWSTR sczPath = NULL;
368
369 while (wzPath && *wzPath && ::RemoveDirectoryW(wzPath))
370 {
371 ++cDeletedDirs;
372
373 HRESULT hr = PathGetParentPath(wzPath, &sczPath);
374 DirExitOnFailure(hr, "Failed to get parent directory for path: %ls", wzPath);
375
376 wzPath = sczPath;
377 }
378
379LExit:
380 ReleaseStr(sczPath);
381
382 return cDeletedDirs;
383}
384
385
386/*******************************************************************
356 DirGetCurrent - gets the current directory. 387 DirGetCurrent - gets the current directory.
357 388
358*******************************************************************/ 389*******************************************************************/