From 0fd0f531db8250a121939dc9d453a236b477ae7a Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 21 Mar 2019 20:05:15 -0400 Subject: Avoid hang when a .cab is has no files. --- src/wixnative/smartcab.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wixnative/smartcab.cpp b/src/wixnative/smartcab.cpp index da9087a3..0dff6c94 100644 --- a/src/wixnative/smartcab.cpp +++ b/src/wixnative/smartcab.cpp @@ -64,8 +64,11 @@ HRESULT SmartCabCommand( hr = CabCBegin(wzCabName, sczCabDir, uiFileCount, uiMaxSize, uiMaxThresh, ct, &hCab); ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to initialize cabinet: %ls", wzCabPath); - hr = CompressFiles(hCab); - ExitOnFailure(hr, "failed to compress files into cabinet: %ls", wzCabPath); + if (uiFileCount > 0) + { + hr = CompressFiles(hCab); + ExitOnFailure(hr, "failed to compress files into cabinet: %ls", wzCabPath); + } hr = CabCFinish(hCab, CabNamesCallback); hCab = NULL; // once finish is called, the handle is invalid. -- cgit v1.2.3-55-g6feb