@joebigelow / wix / commits / 6dfba4f5

Move wixnative.*.exe back to root libs in .nupkg

It seems NuGet will not copy the .exes from subfolders so move them back to root folder and live with the warnings that the .exe files are not managed code (because they aren't).

Rob Mensching committed Dec 26, 2018 at 16:11 UTC 6dfba4f5a6528991b57d3939c8f62ba9de7cd7d5
2 files changed +11 -20
src/WixToolset.Core.Native/WixNativeExe.cs
+7 -16
@@ -12,7 +12,6 @@ namespace WixToolset.Core.Native
12 internal class WixNativeExe
13 {
14 private const int FiveMinutesInMilliseconds = 300000;
15 - private static readonly object PathToWixNativeExeLock = new object();
15 private static string PathToWixNativeExe;
16
17 private readonly string commandLine;
@@ -83,24 +82,16 @@ namespace WixToolset.Core.Native
82
83 private static void EnsurePathToWixNativeExeSet()
84 {
86 - lock (PathToWixNativeExeLock)
85 + if (String.IsNullOrEmpty(PathToWixNativeExe))
86 {
88 - if (String.IsNullOrEmpty(PathToWixNativeExe))
89 - {
90 - var path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), @"x86\wixnative.x86.exe");
91 -
92 - if (!File.Exists(path))
93 - {
94 - path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), "wixnative.x86.exe");
87 + var path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), "wixnative.x86.exe");
88
96 - if (!File.Exists(path))
97 - {
98 - throw new FileNotFoundException($"Could not find internal piece of WiX Toolset at: {path}", path);
99 - }
100 - }
101 -
102 - PathToWixNativeExe = path;
89 + if (!File.Exists(path))
90 + {
91 + throw new FileNotFoundException($"Could not find internal piece of WiX Toolset at: {path}", path);
92 }
93 +
94 + PathToWixNativeExe = path;
95 }
96 }
97
src/WixToolset.Core.Native/WixToolset.Core.Native.nuspec
+4 -4
@@ -28,9 +28,9 @@
28 These native executables are included in this .nupkg to place the .exe correctly for tests to work.
29 That are ignored when published. The dependency above is used when publishing the tools.
30 -->
31 - <file src="..\Win32\wixnative.x86.exe" target="lib\netstandard2.0\x86" />
32 - <file src="..\Win32\wixnative.x86.pdb" target="lib\netstandard2.0\x86" />
33 - <file src="..\x64\wixnative.amd64.exe" target="lib\netstandard2.0\amd64" />
34 - <file src="..\x64\wixnative.amd64.pdb" target="lib\netstandard2.0\amd64" />
31 + <file src="..\Win32\wixnative.x86.exe" target="lib\netstandard2.0" />
32 + <file src="..\Win32\wixnative.x86.pdb" target="lib\netstandard2.0" />
33 + <file src="..\x64\wixnative.amd64.exe" target="lib\netstandard2.0" />
34 + <file src="..\x64\wixnative.amd64.pdb" target="lib\netstandard2.0" />
35 </files>
36 </package>