aboutsummaryrefslogtreecommitdiff
path: root/src/wixnative/enumcab.cpp
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2017-11-29 14:08:08 -0800
committerRob Mensching <rob@firegiant.com>2017-11-29 14:08:08 -0800
commitea3d18595a610ee07b03f07af4f03cf75b5ab420 (patch)
treeb69ac2185b05254b136051d561b189c4fda1fc5b /src/wixnative/enumcab.cpp
parent95f4f9b9b99e1a6f91f4687c2dd511a6d6fc2716 (diff)
downloadwix-ea3d18595a610ee07b03f07af4f03cf75b5ab420.tar.gz
wix-ea3d18595a610ee07b03f07af4f03cf75b5ab420.tar.bz2
wix-ea3d18595a610ee07b03f07af4f03cf75b5ab420.zip
Improved cabinet handling
Diffstat (limited to 'src/wixnative/enumcab.cpp')
-rw-r--r--src/wixnative/enumcab.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/wixnative/enumcab.cpp b/src/wixnative/enumcab.cpp
new file mode 100644
index 00000000..e7717bac
--- /dev/null
+++ b/src/wixnative/enumcab.cpp
@@ -0,0 +1,47 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3#include "precomp.h"
4
5static INT_PTR __stdcall EnumCallback(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin);
6
7
8HRESULT EnumCabCommand(
9 __in int argc,
10 __in LPWSTR argv[]
11)
12{
13 HRESULT hr = E_INVALIDARG;
14 LPCWSTR wzCabPath = NULL;
15
16 if (argc < 1)
17 {
18 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Must specify: cabPath outputFolder");
19 }
20
21 wzCabPath = argv[0];
22
23 hr = CabInitialize(FALSE);
24 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to initialize cabinet: %ls", wzCabPath);
25
26 hr = CabEnumerate(wzCabPath, L"*", EnumCallback, 0);
27 ExitOnFailure(hr, "failed to compress files into cabinet: %ls", wzCabPath);
28
29LExit:
30 CabUninitialize();
31
32 return hr;
33}
34
35
36static INT_PTR __stdcall EnumCallback(
37 __in FDINOTIFICATIONTYPE fdint,
38 __in PFDINOTIFICATION pfdin
39)
40{
41 if (fdint == fdintCOPY_FILE)
42 {
43 ConsoleWriteLine(CONSOLE_COLOR_NORMAL, "%s\t%d\t%u\t%u", pfdin->psz1, pfdin->cb, pfdin->date, pfdin->time);
44 }
45
46 return 0;
47}