diff options
author | Bob Arnson <bob@firegiant.com> | 2019-03-21 20:05:15 -0400 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2019-03-21 20:05:15 -0400 |
commit | 0fd0f531db8250a121939dc9d453a236b477ae7a (patch) | |
tree | ac9324889b60e1f0c794fa829544002468c57174 /src | |
parent | 0ef921687dd07e7c298b1c7533e51982c56f8d28 (diff) | |
download | wix-0fd0f531db8250a121939dc9d453a236b477ae7a.tar.gz wix-0fd0f531db8250a121939dc9d453a236b477ae7a.tar.bz2 wix-0fd0f531db8250a121939dc9d453a236b477ae7a.zip |
Avoid hang when a .cab is has no files.
Diffstat (limited to 'src')
-rw-r--r-- | src/wixnative/smartcab.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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( | |||
64 | hr = CabCBegin(wzCabName, sczCabDir, uiFileCount, uiMaxSize, uiMaxThresh, ct, &hCab); | 64 | hr = CabCBegin(wzCabName, sczCabDir, uiFileCount, uiMaxSize, uiMaxThresh, ct, &hCab); |
65 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to initialize cabinet: %ls", wzCabPath); | 65 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to initialize cabinet: %ls", wzCabPath); |
66 | 66 | ||
67 | hr = CompressFiles(hCab); | 67 | if (uiFileCount > 0) |
68 | ExitOnFailure(hr, "failed to compress files into cabinet: %ls", wzCabPath); | 68 | { |
69 | hr = CompressFiles(hCab); | ||
70 | ExitOnFailure(hr, "failed to compress files into cabinet: %ls", wzCabPath); | ||
71 | } | ||
69 | 72 | ||
70 | hr = CabCFinish(hCab, CabNamesCallback); | 73 | hr = CabCFinish(hCab, CabNamesCallback); |
71 | hCab = NULL; // once finish is called, the handle is invalid. | 74 | hCab = NULL; // once finish is called, the handle is invalid. |