aboutsummaryrefslogtreecommitdiff
path: root/src/wix/wixnative/wixnative.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wix/wixnative/wixnative.cpp')
-rw-r--r--src/wix/wixnative/wixnative.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/wix/wixnative/wixnative.cpp b/src/wix/wixnative/wixnative.cpp
new file mode 100644
index 00000000..7bd8dbca
--- /dev/null
+++ b/src/wix/wixnative/wixnative.cpp
@@ -0,0 +1,38 @@
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
5int __cdecl wmain(int argc, LPWSTR argv[])
6{
7 HRESULT hr = E_INVALIDARG;
8
9 ConsoleInitialize();
10
11 if (argc < 2)
12 {
13 ConsoleWriteError(hr, CONSOLE_COLOR_RED, "Must specify a command");
14 }
15 else if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, argv[1], -1, L"smartcab", -1))
16 {
17 hr = SmartCabCommand(argc - 2, argv + 2);
18 }
19 else if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, argv[1], -1, L"extractcab", -1))
20 {
21 hr = ExtractCabCommand(argc - 2, argv + 2);
22 }
23 else if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, argv[1], -1, L"enumcab", -1))
24 {
25 hr = EnumCabCommand(argc - 2, argv + 2);
26 }
27 else if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, argv[1], -1, L"resetacls", -1))
28 {
29 hr = ResetAclsCommand(argc - 2, argv + 2);
30 }
31 else
32 {
33 ConsoleWriteError(hr, CONSOLE_COLOR_RED, "Unknown command: %ls", argv[1]);
34 }
35
36 ConsoleUninitialize();
37 return HRESULT_CODE(hr);
38}