aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.Native/WixNativeExe.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core.Native/WixNativeExe.cs')
-rw-r--r--src/WixToolset.Core.Native/WixNativeExe.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/WixToolset.Core.Native/WixNativeExe.cs b/src/WixToolset.Core.Native/WixNativeExe.cs
index 935c2a89..063485d3 100644
--- a/src/WixToolset.Core.Native/WixNativeExe.cs
+++ b/src/WixToolset.Core.Native/WixNativeExe.cs
@@ -11,6 +11,7 @@ namespace WixToolset.Core.Native
11 11
12 internal class WixNativeExe 12 internal class WixNativeExe
13 { 13 {
14 private const string WixNativeExeFileName = "wixnative.exe";
14 private static string PathToWixNativeExe; 15 private static string PathToWixNativeExe;
15 16
16 private readonly string commandLine; 17 private readonly string commandLine;
@@ -80,7 +81,25 @@ namespace WixToolset.Core.Native
80 { 81 {
81 if (String.IsNullOrEmpty(PathToWixNativeExe)) 82 if (String.IsNullOrEmpty(PathToWixNativeExe))
82 { 83 {
83 var path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), "wixnative.x86.exe"); 84 var path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), WixNativeExeFileName);
85
86 if (!File.Exists(path))
87 {
88 var searchDirectoriesString = AppContext.GetData("NATIVE_DLL_SEARCH_DIRECTORIES") as string;
89 var searchDirectories = searchDirectoriesString?.Split(';');
90 if (searchDirectories != null)
91 {
92 foreach (string directoryPath in searchDirectories)
93 {
94 var possiblePath = Path.Combine(directoryPath, WixNativeExeFileName);
95 if (File.Exists(possiblePath))
96 {
97 path = possiblePath;
98 break;
99 }
100 }
101 }
102 }
84 103
85 if (!File.Exists(path)) 104 if (!File.Exists(path))
86 { 105 {