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