diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-29 14:08:08 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-29 14:08:08 -0800 |
| commit | ea3d18595a610ee07b03f07af4f03cf75b5ab420 (patch) | |
| tree | b69ac2185b05254b136051d561b189c4fda1fc5b /src/wixnative | |
| parent | 95f4f9b9b99e1a6f91f4687c2dd511a6d6fc2716 (diff) | |
| download | wix-ea3d18595a610ee07b03f07af4f03cf75b5ab420.tar.gz wix-ea3d18595a610ee07b03f07af4f03cf75b5ab420.tar.bz2 wix-ea3d18595a610ee07b03f07af4f03cf75b5ab420.zip | |
Improved cabinet handling
Diffstat (limited to 'src/wixnative')
| -rw-r--r-- | src/wixnative/enumcab.cpp | 47 | ||||
| -rw-r--r-- | src/wixnative/extractcab.cpp | 50 | ||||
| -rw-r--r-- | src/wixnative/packages.config | 5 | ||||
| -rw-r--r-- | src/wixnative/precomp.cpp | 3 | ||||
| -rw-r--r-- | src/wixnative/precomp.h | 19 | ||||
| -rw-r--r-- | src/wixnative/resetacls.cpp | 51 | ||||
| -rw-r--r-- | src/wixnative/smartcab.cpp | 157 | ||||
| -rw-r--r-- | src/wixnative/wixnative.cpp | 38 | ||||
| -rw-r--r-- | src/wixnative/wixnative.vcxproj | 80 |
9 files changed, 450 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 | |||
| 5 | static INT_PTR __stdcall EnumCallback(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin); | ||
| 6 | |||
| 7 | |||
| 8 | HRESULT 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 | |||
| 29 | LExit: | ||
| 30 | CabUninitialize(); | ||
| 31 | |||
| 32 | return hr; | ||
| 33 | } | ||
| 34 | |||
| 35 | |||
| 36 | static 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 | } | ||
diff --git a/src/wixnative/extractcab.cpp b/src/wixnative/extractcab.cpp new file mode 100644 index 00000000..53f53266 --- /dev/null +++ b/src/wixnative/extractcab.cpp | |||
| @@ -0,0 +1,50 @@ | |||
| 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 | |||
| 5 | static HRESULT ProgressCallback(BOOL fBeginFile, LPCWSTR wzFileId, LPVOID pvContext); | ||
| 6 | |||
| 7 | |||
| 8 | HRESULT ExtractCabCommand( | ||
| 9 | __in int argc, | ||
| 10 | __in LPWSTR argv[] | ||
| 11 | ) | ||
| 12 | { | ||
| 13 | HRESULT hr = E_INVALIDARG; | ||
| 14 | LPCWSTR wzCabPath = NULL; | ||
| 15 | LPCWSTR wzOutputFolder = NULL; | ||
| 16 | |||
| 17 | if (argc < 2) | ||
| 18 | { | ||
| 19 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Must specify: cabPath outputFolder"); | ||
| 20 | } | ||
| 21 | |||
| 22 | wzCabPath = argv[0]; | ||
| 23 | wzOutputFolder = argv[1]; | ||
| 24 | |||
| 25 | hr = CabInitialize(FALSE); | ||
| 26 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to initialize cabinet: %ls", wzCabPath); | ||
| 27 | |||
| 28 | hr = CabExtract(wzCabPath, L"*", wzOutputFolder, ProgressCallback, NULL, 0); | ||
| 29 | ExitOnFailure(hr, "failed to compress files into cabinet: %ls", wzCabPath); | ||
| 30 | |||
| 31 | LExit: | ||
| 32 | CabUninitialize(); | ||
| 33 | |||
| 34 | return hr; | ||
| 35 | } | ||
| 36 | |||
| 37 | |||
| 38 | static HRESULT ProgressCallback( | ||
| 39 | __in BOOL fBeginFile, | ||
| 40 | __in LPCWSTR wzFileId, | ||
| 41 | __in LPVOID /*pvContext*/ | ||
| 42 | ) | ||
| 43 | { | ||
| 44 | if (fBeginFile) | ||
| 45 | { | ||
| 46 | ConsoleWriteLine(CONSOLE_COLOR_NORMAL, "%ls", wzFileId); | ||
| 47 | } | ||
| 48 | |||
| 49 | return S_OK; | ||
| 50 | } | ||
diff --git a/src/wixnative/packages.config b/src/wixnative/packages.config new file mode 100644 index 00000000..02ee2250 --- /dev/null +++ b/src/wixnative/packages.config | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <packages> | ||
| 3 | <package id="Nerdbank.GitVersioning" version="2.0.41" targetFramework="native" developmentDependency="true" /> | ||
| 4 | <package id="WixToolset.DUtil" version="4.0.3" targetFramework="native" /> | ||
| 5 | </packages> \ No newline at end of file | ||
diff --git a/src/wixnative/precomp.cpp b/src/wixnative/precomp.cpp new file mode 100644 index 00000000..37664a1c --- /dev/null +++ b/src/wixnative/precomp.cpp | |||
| @@ -0,0 +1,3 @@ | |||
| 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" | ||
diff --git a/src/wixnative/precomp.h b/src/wixnative/precomp.h new file mode 100644 index 00000000..5bd617e5 --- /dev/null +++ b/src/wixnative/precomp.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #pragma once | ||
| 2 | // 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. | ||
| 3 | |||
| 4 | #include <windows.h> | ||
| 5 | #include <aclapi.h> | ||
| 6 | #include <mergemod.h> | ||
| 7 | |||
| 8 | #include "dutil.h" | ||
| 9 | #include "conutil.h" | ||
| 10 | #include "memutil.h" | ||
| 11 | #include "pathutil.h" | ||
| 12 | #include "strutil.h" | ||
| 13 | #include "cabcutil.h" | ||
| 14 | #include "cabutil.h" | ||
| 15 | |||
| 16 | HRESULT SmartCabCommand(int argc, LPWSTR argv[]); | ||
| 17 | HRESULT ResetAclsCommand(int argc, LPWSTR argv[]); | ||
| 18 | HRESULT EnumCabCommand(int argc, LPWSTR argv[]); | ||
| 19 | HRESULT ExtractCabCommand(int argc, LPWSTR argv[]); | ||
diff --git a/src/wixnative/resetacls.cpp b/src/wixnative/resetacls.cpp new file mode 100644 index 00000000..8c5bdc56 --- /dev/null +++ b/src/wixnative/resetacls.cpp | |||
| @@ -0,0 +1,51 @@ | |||
| 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 | |||
| 5 | HRESULT ResetAclsCommand(int argc, LPWSTR argv[]) | ||
| 6 | { | ||
| 7 | Unused(argc); | ||
| 8 | Unused(argv); | ||
| 9 | |||
| 10 | HRESULT hr = S_OK; | ||
| 11 | ACL* pacl = NULL; | ||
| 12 | DWORD cbAcl = sizeof(ACL); | ||
| 13 | LPWSTR sczFilePath = NULL; | ||
| 14 | |||
| 15 | // create an empty (not NULL!) ACL to use on all the files | ||
| 16 | pacl = static_cast<ACL*>(MemAlloc(cbAcl, FALSE)); | ||
| 17 | ConsoleExitOnNull(pacl, hr, E_OUTOFMEMORY, CONSOLE_COLOR_RED, "failed to allocate ACL"); | ||
| 18 | |||
| 19 | #pragma prefast(push) | ||
| 20 | #pragma prefast(disable:25029) | ||
| 21 | if (!::InitializeAcl(pacl, cbAcl, ACL_REVISION)) | ||
| 22 | #pragma prefast(op) | ||
| 23 | { | ||
| 24 | ConsoleExitOnLastError(hr, CONSOLE_COLOR_RED, "failed to initialize ACL"); | ||
| 25 | } | ||
| 26 | |||
| 27 | // Reset the existing security permissions on each provided file. | ||
| 28 | for (;;) | ||
| 29 | { | ||
| 30 | hr = ConsoleReadW(&sczFilePath); | ||
| 31 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to read file path from stdin"); | ||
| 32 | |||
| 33 | if (!*sczFilePath) | ||
| 34 | { | ||
| 35 | break; | ||
| 36 | } | ||
| 37 | |||
| 38 | hr = ::SetNamedSecurityInfoW(sczFilePath, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION | UNPROTECTED_DACL_SECURITY_INFORMATION, NULL, NULL, pacl, NULL); | ||
| 39 | if (ERROR_FILE_NOT_FOUND != hr && ERROR_PATH_NOT_FOUND != hr) | ||
| 40 | { | ||
| 41 | ConsoleExitOnFailure(hr = HRESULT_FROM_WIN32(hr), CONSOLE_COLOR_RED, "failed to set security descriptor for file: %ls", sczFilePath); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | AssertSz(::IsValidAcl(pacl), "ResetAcls() - created invalid ACL"); | ||
| 46 | |||
| 47 | LExit: | ||
| 48 | ReleaseStr(sczFilePath); | ||
| 49 | ReleaseMem(pacl); | ||
| 50 | return hr; | ||
| 51 | } | ||
diff --git a/src/wixnative/smartcab.cpp b/src/wixnative/smartcab.cpp new file mode 100644 index 00000000..da9087a3 --- /dev/null +++ b/src/wixnative/smartcab.cpp | |||
| @@ -0,0 +1,157 @@ | |||
| 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 | |||
| 5 | static HRESULT CompressFiles(HANDLE hCab); | ||
| 6 | static void __stdcall CabNamesCallback(LPWSTR wzFirstCabName, LPWSTR wzNewCabName, LPWSTR wzFileToken); | ||
| 7 | |||
| 8 | |||
| 9 | HRESULT SmartCabCommand( | ||
| 10 | __in int argc, | ||
| 11 | __in LPWSTR argv[] | ||
| 12 | ) | ||
| 13 | { | ||
| 14 | HRESULT hr = E_INVALIDARG; | ||
| 15 | LPCWSTR wzCabPath = NULL; | ||
| 16 | LPCWSTR wzCabName = NULL; | ||
| 17 | LPWSTR sczCabDir = NULL; | ||
| 18 | UINT uiFileCount = 0; | ||
| 19 | UINT uiMaxSize = 0; | ||
| 20 | UINT uiMaxThresh = 0; | ||
| 21 | COMPRESSION_TYPE ct = COMPRESSION_TYPE_NONE; | ||
| 22 | HANDLE hCab = NULL; | ||
| 23 | |||
| 24 | if (argc < 1) | ||
| 25 | { | ||
| 26 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Must specify: outCabPath [compressionType] [fileCount] [maxSizePerCabInMB [maxThreshold]]"); | ||
| 27 | } | ||
| 28 | else | ||
| 29 | { | ||
| 30 | wzCabPath = argv[0]; | ||
| 31 | wzCabName = PathFile(wzCabPath); | ||
| 32 | |||
| 33 | hr = PathGetDirectory(wzCabPath, &sczCabDir); | ||
| 34 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Could not parse directory from path: %ls", wzCabPath); | ||
| 35 | |||
| 36 | if (argc > 1) | ||
| 37 | { | ||
| 38 | UINT uiCompressionType; | ||
| 39 | hr = StrStringToUInt32(argv[1], 0, &uiCompressionType); | ||
| 40 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Could not parse compression type as number: %ls", argv[1]); | ||
| 41 | |||
| 42 | ct = (uiCompressionType > 4) ? COMPRESSION_TYPE_HIGH : static_cast<COMPRESSION_TYPE>(uiCompressionType); | ||
| 43 | } | ||
| 44 | |||
| 45 | if (argc > 2) | ||
| 46 | { | ||
| 47 | hr = StrStringToUInt32(argv[2], 0, &uiFileCount); | ||
| 48 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Could not parse file count as number: %ls", argv[2]); | ||
| 49 | } | ||
| 50 | |||
| 51 | if (argc > 3) | ||
| 52 | { | ||
| 53 | hr = StrStringToUInt32(argv[3], 0, &uiMaxSize); | ||
| 54 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Could not parse max size as number: %ls", argv[3]); | ||
| 55 | } | ||
| 56 | |||
| 57 | if (argc > 4) | ||
| 58 | { | ||
| 59 | hr = StrStringToUInt32(argv[4], 0, &uiMaxThresh); | ||
| 60 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Could not parse max threshold as number: %ls", argv[4]); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | |||
| 64 | hr = CabCBegin(wzCabName, sczCabDir, uiFileCount, uiMaxSize, uiMaxThresh, ct, &hCab); | ||
| 65 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to initialize cabinet: %ls", wzCabPath); | ||
| 66 | |||
| 67 | hr = CompressFiles(hCab); | ||
| 68 | ExitOnFailure(hr, "failed to compress files into cabinet: %ls", wzCabPath); | ||
| 69 | |||
| 70 | hr = CabCFinish(hCab, CabNamesCallback); | ||
| 71 | hCab = NULL; // once finish is called, the handle is invalid. | ||
| 72 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to compress cabinet: %ls", wzCabPath); | ||
| 73 | |||
| 74 | |||
| 75 | LExit: | ||
| 76 | if (hCab) | ||
| 77 | { | ||
| 78 | CabCCancel(hCab); | ||
| 79 | } | ||
| 80 | ReleaseStr(sczCabDir); | ||
| 81 | |||
| 82 | return hr; | ||
| 83 | } | ||
| 84 | |||
| 85 | |||
| 86 | static HRESULT CompressFiles( | ||
| 87 | __in HANDLE hCab | ||
| 88 | ) | ||
| 89 | { | ||
| 90 | HRESULT hr = S_OK; | ||
| 91 | LPWSTR sczLine = NULL; | ||
| 92 | LPWSTR* rgsczSplit = NULL; | ||
| 93 | UINT cSplit = 0; | ||
| 94 | MSIFILEHASHINFO hashInfo = { sizeof(MSIFILEHASHINFO) }; | ||
| 95 | |||
| 96 | for (;;) | ||
| 97 | { | ||
| 98 | hr = ConsoleReadW(&sczLine); | ||
| 99 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to read smartcab line from stdin"); | ||
| 100 | |||
| 101 | if (!*sczLine) | ||
| 102 | { | ||
| 103 | break; | ||
| 104 | } | ||
| 105 | |||
| 106 | hr = StrSplitAllocArray(&rgsczSplit, &cSplit, sczLine, L"\t"); | ||
| 107 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to split smartcab line from stdin: %ls", sczLine); | ||
| 108 | |||
| 109 | if (cSplit != 2 && cSplit != 6) | ||
| 110 | { | ||
| 111 | hr = E_INVALIDARG; | ||
| 112 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to split smartcab line into hash x 4, token, source file: %ls", sczLine); | ||
| 113 | } | ||
| 114 | |||
| 115 | LPCWSTR wzFilePath = rgsczSplit[0]; | ||
| 116 | LPCWSTR wzToken = rgsczSplit[1]; | ||
| 117 | PMSIFILEHASHINFO pHashInfo = NULL; | ||
| 118 | |||
| 119 | if (cSplit == 6) | ||
| 120 | { | ||
| 121 | for (int i = 0; i < 4; ++i) | ||
| 122 | { | ||
| 123 | LPCWSTR wzHash = rgsczSplit[i + 2]; | ||
| 124 | |||
| 125 | hr = StrStringToInt32(wzHash, 0, reinterpret_cast<INT*>(hashInfo.dwData + i)); | ||
| 126 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to parse hash: %ls for file: %ls", wzHash, wzFilePath); | ||
| 127 | } | ||
| 128 | |||
| 129 | pHashInfo = &hashInfo; | ||
| 130 | } | ||
| 131 | |||
| 132 | hr = CabCAddFile(wzFilePath, wzToken, pHashInfo, hCab); | ||
| 133 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "failed to add file: %ls", wzFilePath); | ||
| 134 | |||
| 135 | ReleaseNullStrArray(rgsczSplit, cSplit); | ||
| 136 | } | ||
| 137 | |||
| 138 | LExit: | ||
| 139 | ReleaseNullStrArray(rgsczSplit, cSplit); | ||
| 140 | ReleaseStr(sczLine); | ||
| 141 | |||
| 142 | return hr; | ||
| 143 | } | ||
| 144 | |||
| 145 | |||
| 146 | // Callback from PFNFCIGETNEXTCABINET CabCGetNextCabinet method | ||
| 147 | // First argument is the name of splitting cabinet without extension e.g. "cab1" | ||
| 148 | // Second argument is name of the new cabinet that would be formed by splitting e.g. "cab1b.cab" | ||
| 149 | // Third argument is the file token of the first file present in the splitting cabinet | ||
| 150 | static void __stdcall CabNamesCallback( | ||
| 151 | __in LPWSTR wzFirstCabName, | ||
| 152 | __in LPWSTR wzNewCabName, | ||
| 153 | __in LPWSTR wzFileToken | ||
| 154 | ) | ||
| 155 | { | ||
| 156 | ConsoleWriteLine(CONSOLE_COLOR_NORMAL, "%ls\t%ls\t%ls", wzFirstCabName, wzNewCabName, wzFileToken); | ||
| 157 | } | ||
diff --git a/src/wixnative/wixnative.cpp b/src/wixnative/wixnative.cpp new file mode 100644 index 00000000..7bd8dbca --- /dev/null +++ b/src/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 | |||
| 5 | int __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 | } | ||
diff --git a/src/wixnative/wixnative.vcxproj b/src/wixnative/wixnative.vcxproj new file mode 100644 index 00000000..2a4ce3d5 --- /dev/null +++ b/src/wixnative/wixnative.vcxproj | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- 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. --> | ||
| 3 | |||
| 4 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| 5 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.3\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.3\build\WixToolset.DUtil.props')" /> | ||
| 6 | |||
| 7 | <ItemGroup Label="ProjectConfigurations"> | ||
| 8 | <ProjectConfiguration Include="Debug|Win32"> | ||
| 9 | <Configuration>Debug</Configuration> | ||
| 10 | <Platform>Win32</Platform> | ||
| 11 | </ProjectConfiguration> | ||
| 12 | <ProjectConfiguration Include="Release|Win32"> | ||
| 13 | <Configuration>Release</Configuration> | ||
| 14 | <Platform>Win32</Platform> | ||
| 15 | </ProjectConfiguration> | ||
| 16 | <ProjectConfiguration Include="Debug|x64"> | ||
| 17 | <Configuration>Debug</Configuration> | ||
| 18 | <Platform>x64</Platform> | ||
| 19 | </ProjectConfiguration> | ||
| 20 | <ProjectConfiguration Include="Release|x64"> | ||
| 21 | <Configuration>Release</Configuration> | ||
| 22 | <Platform>x64</Platform> | ||
| 23 | </ProjectConfiguration> | ||
| 24 | </ItemGroup> | ||
| 25 | |||
| 26 | <PropertyGroup Label="Globals"> | ||
| 27 | <ProjectGuid>{8497EC72-B8D0-4272-A9D0-7E9D871CEFBF}</ProjectGuid> | ||
| 28 | <ConfigurationType>Application</ConfigurationType> | ||
| 29 | <ProjectSubSystem>Console</ProjectSubSystem> | ||
| 30 | <TargetName>wixnative</TargetName> | ||
| 31 | <PlatformToolset>v141</PlatformToolset> | ||
| 32 | <CharacterSet>Unicode</CharacterSet> | ||
| 33 | <Description>Native component of WixToolset.Core</Description> | ||
| 34 | </PropertyGroup> | ||
| 35 | |||
| 36 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
| 37 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
| 38 | |||
| 39 | <ImportGroup Label="ExtensionSettings"> | ||
| 40 | </ImportGroup> | ||
| 41 | |||
| 42 | <ImportGroup Label="Shared"> | ||
| 43 | </ImportGroup> | ||
| 44 | |||
| 45 | <PropertyGroup> | ||
| 46 | <ProjectAdditionalLinkLibraries>crypt32.lib;cabinet.lib;msi.lib</ProjectAdditionalLinkLibraries> | ||
| 47 | </PropertyGroup> | ||
| 48 | |||
| 49 | <ItemGroup> | ||
| 50 | <ClCompile Include="wixnative.cpp"> | ||
| 51 | <!-- turn off deprecation warning --> | ||
| 52 | <DisableSpecificWarnings>4996</DisableSpecificWarnings> | ||
| 53 | </ClCompile> | ||
| 54 | <ClCompile Include="precomp.cpp"> | ||
| 55 | <PrecompiledHeader>Create</PrecompiledHeader> | ||
| 56 | </ClCompile> | ||
| 57 | <ClCompile Include="enumcab.cpp"/> | ||
| 58 | <ClCompile Include="extractcab.cpp"/> | ||
| 59 | <ClCompile Include="resetacls.cpp"/> | ||
| 60 | <ClCompile Include="smartcab.cpp"/> | ||
| 61 | </ItemGroup> | ||
| 62 | |||
| 63 | <ItemGroup> | ||
| 64 | <ClInclude Include="precomp.h" /> | ||
| 65 | </ItemGroup> | ||
| 66 | |||
| 67 | <ItemGroup> | ||
| 68 | <None Include="packages.config" /> | ||
| 69 | </ItemGroup> | ||
| 70 | |||
| 71 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
| 72 | <Import Project="..\..\packages\Nerdbank.GitVersioning.2.0.41\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.0.41\build\Nerdbank.GitVersioning.targets')" /> | ||
| 73 | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
| 74 | <PropertyGroup> | ||
| 75 | <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> | ||
| 76 | </PropertyGroup> | ||
| 77 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.3\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.3\build\WixToolset.DUtil.props'))" /> | ||
| 78 | <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.0.41\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.0.41\build\Nerdbank.GitVersioning.targets'))" /> | ||
| 79 | </Target> | ||
| 80 | </Project> | ||
