aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.Native
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2019-05-23 16:29:55 -0700
committerRob Mensching <rob@firegiant.com>2019-05-23 16:34:09 -0700
commit36cfc9509cb6a364f58531ff41eae16243091a3c (patch)
tree7e88ad0e1bea778a35dc393d0d62b889e15eea8d /src/WixToolset.Core.Native
parent26b1860dcd8a84b410ab5cd3df7e37104e6ee1b1 (diff)
downloadwix-36cfc9509cb6a364f58531ff41eae16243091a3c.tar.gz
wix-36cfc9509cb6a364f58531ff41eae16243091a3c.tar.bz2
wix-36cfc9509cb6a364f58531ff41eae16243091a3c.zip
User shared data types from WixToolset.Data
Diffstat (limited to 'src/WixToolset.Core.Native')
-rw-r--r--src/WixToolset.Core.Native/Cabinet.cs6
-rw-r--r--src/WixToolset.Core.Native/CabinetCompressionLevel.cs25
-rw-r--r--src/WixToolset.Core.Native/WixToolset.Core.Native.csproj6
3 files changed, 8 insertions, 29 deletions
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
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using System.Linq; 7 using System.Linq;
8 using WixToolset.Data;
8 9
9 /// <summary> 10 /// <summary>
10 /// Wrapper class around interop with wixcab.dll to compress files into a cabinet. 11 /// Wrapper class around interop with wixcab.dll to compress files into a cabinet.
@@ -29,7 +30,7 @@ namespace WixToolset.Core.Native
29 /// <param name="maxFiles">Maximum number of files that will be added to cabinet.</param> 30 /// <param name="maxFiles">Maximum number of files that will be added to cabinet.</param>
30 /// <param name="maxSize">Maximum size of cabinet.</param> 31 /// <param name="maxSize">Maximum size of cabinet.</param>
31 /// <param name="maxThresh">Maximum threshold for each cabinet.</param> 32 /// <param name="maxThresh">Maximum threshold for each cabinet.</param>
32 public void Compress(IEnumerable<CabinetCompressFile> files, CabinetCompressionLevel compressionLevel, int maxSize = 0, int maxThresh = 0) 33 public void Compress(IEnumerable<CabinetCompressFile> files, CompressionLevel compressionLevel, int maxSize = 0, int maxThresh = 0)
33 { 34 {
34 var compressionLevelVariable = Environment.GetEnvironmentVariable(CompressionLevelVariable); 35 var compressionLevelVariable = Environment.GetEnvironmentVariable(CompressionLevelVariable);
35 36
@@ -38,8 +39,7 @@ namespace WixToolset.Core.Native
38 { 39 {
39 if (!Enum.TryParse(compressionLevelVariable, true, out compressionLevel)) 40 if (!Enum.TryParse(compressionLevelVariable, true, out compressionLevel))
40 { 41 {
41 //throw new WixException(WixErrors.IllegalEnvironmentVariable(CompressionLevelVariable, compressionLevelVariable)); 42 throw new WixException(ErrorMessages.IllegalEnvironmentVariable(CompressionLevelVariable, compressionLevelVariable));
42 throw new ArgumentException();
43 } 43 }
44 } 44 }
45 45
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 @@
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
3namespace WixToolset.Core.Native
4{
5 /// <summary>
6 /// Compression level to use when creating cabinet.
7 /// </summary>
8 public enum CabinetCompressionLevel
9 {
10 /// <summary>Use no compression.</summary>
11 None,
12
13 /// <summary>Use low compression.</summary>
14 Low,
15
16 /// <summary>Use medium compression.</summary>
17 Medium,
18
19 /// <summary>Use high compression.</summary>
20 High,
21
22 /// <summary>Use ms-zip compression.</summary>
23 Mszip
24 }
25} \ 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 @@
1<Project Sdk="Microsoft.NET.Sdk"> 1<Project Sdk="Microsoft.NET.Sdk">
2 2
3 <PropertyGroup> 3 <PropertyGroup>
4 <TargetFramework>netstandard2.0</TargetFramework> 4 <TargetFramework>netstandard2.0</TargetFramework>
@@ -9,6 +9,10 @@
9 </PropertyGroup> 9 </PropertyGroup>
10 10
11 <ItemGroup> 11 <ItemGroup>
12 <PackageReference Include="WixToolset.Data" Version="4.0.*" PrivateAssets="All" />
13 </ItemGroup>
14
15 <ItemGroup>
12 <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" /> 16 <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" />
13 <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" /> 17 <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" />
14 </ItemGroup> 18 </ItemGroup>