From 36cfc9509cb6a364f58531ff41eae16243091a3c Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 23 May 2019 16:29:55 -0700 Subject: User shared data types from WixToolset.Data --- src/WixToolset.Core.Native/Cabinet.cs | 6 +++--- .../CabinetCompressionLevel.cs | 25 ---------------------- .../WixToolset.Core.Native.csproj | 6 +++++- 3 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 src/WixToolset.Core.Native/CabinetCompressionLevel.cs (limited to 'src/WixToolset.Core.Native') diff --git a/src/WixToolset.Core.Native/Cabinet.cs b/src/WixToolset.Core.Native/Cabinet.cs index 27b0ec74..3f5fa715 100644 --- a/src/WixToolset.Core.Native/Cabinet.cs +++ b/src/WixToolset.Core.Native/Cabinet.cs @@ -5,6 +5,7 @@ namespace WixToolset.Core.Native using System; using System.Collections.Generic; using System.Linq; + using WixToolset.Data; /// /// Wrapper class around interop with wixcab.dll to compress files into a cabinet. @@ -29,7 +30,7 @@ namespace WixToolset.Core.Native /// Maximum number of files that will be added to cabinet. /// Maximum size of cabinet. /// Maximum threshold for each cabinet. - public void Compress(IEnumerable files, CabinetCompressionLevel compressionLevel, int maxSize = 0, int maxThresh = 0) + public void Compress(IEnumerable files, CompressionLevel compressionLevel, int maxSize = 0, int maxThresh = 0) { var compressionLevelVariable = Environment.GetEnvironmentVariable(CompressionLevelVariable); @@ -38,8 +39,7 @@ namespace WixToolset.Core.Native { if (!Enum.TryParse(compressionLevelVariable, true, out compressionLevel)) { - //throw new WixException(WixErrors.IllegalEnvironmentVariable(CompressionLevelVariable, compressionLevelVariable)); - throw new ArgumentException(); + throw new WixException(ErrorMessages.IllegalEnvironmentVariable(CompressionLevelVariable, compressionLevelVariable)); } } diff --git a/src/WixToolset.Core.Native/CabinetCompressionLevel.cs b/src/WixToolset.Core.Native/CabinetCompressionLevel.cs deleted file mode 100644 index fce1ff41..00000000 --- a/src/WixToolset.Core.Native/CabinetCompressionLevel.cs +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - -namespace WixToolset.Core.Native -{ - /// - /// Compression level to use when creating cabinet. - /// - public enum CabinetCompressionLevel - { - /// Use no compression. - None, - - /// Use low compression. - Low, - - /// Use medium compression. - Medium, - - /// Use high compression. - High, - - /// Use ms-zip compression. - Mszip - } -} \ No newline at end of file diff --git a/src/WixToolset.Core.Native/WixToolset.Core.Native.csproj b/src/WixToolset.Core.Native/WixToolset.Core.Native.csproj index c93ff5bc..b4b1082f 100644 --- a/src/WixToolset.Core.Native/WixToolset.Core.Native.csproj +++ b/src/WixToolset.Core.Native/WixToolset.Core.Native.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -8,6 +8,10 @@ + + + + -- cgit v1.2.3-55-g6feb