diff options
Diffstat (limited to 'src/WixToolset.Core.Native/WindowsInstallerValidator.cs')
| -rw-r--r-- | src/WixToolset.Core.Native/WindowsInstallerValidator.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/WixToolset.Core.Native/WindowsInstallerValidator.cs b/src/WixToolset.Core.Native/WindowsInstallerValidator.cs index d013e5f9..9f4b26a3 100644 --- a/src/WixToolset.Core.Native/WindowsInstallerValidator.cs +++ b/src/WixToolset.Core.Native/WindowsInstallerValidator.cs | |||
| @@ -86,9 +86,6 @@ namespace WixToolset.Core.Native | |||
| 86 | var previousHwnd = IntPtr.Zero; | 86 | var previousHwnd = IntPtr.Zero; |
| 87 | InstallUIHandler previousUIHandler = null; | 87 | InstallUIHandler previousUIHandler = null; |
| 88 | 88 | ||
| 89 | var baseCubePath = Path.Combine(Path.GetDirectoryName(typeof(WindowsInstallerValidator).Assembly.Location), CubesFolder); | ||
| 90 | var cubeFiles = this.CubeFiles.Select(s => Path.Combine(baseCubePath, s)).ToList(); | ||
| 91 | |||
| 92 | try | 89 | try |
| 93 | { | 90 | { |
| 94 | using (var database = new Database(this.DatabasePath, OpenDatabase.Direct)) | 91 | using (var database = new Database(this.DatabasePath, OpenDatabase.Direct)) |
| @@ -116,11 +113,18 @@ namespace WixToolset.Core.Native | |||
| 116 | } | 113 | } |
| 117 | 114 | ||
| 118 | // Merge in the cube databases. | 115 | // Merge in the cube databases. |
| 119 | foreach (var cubeFile in cubeFiles) | 116 | foreach (var cubeFile in this.CubeFiles) |
| 120 | { | 117 | { |
| 118 | var findCubeFile = typeof(WindowsInstallerValidator).Assembly.FindFileRelativeToAssembly(Path.Combine(CubesFolder, cubeFile), searchNativeDllDirectories: false); | ||
| 119 | |||
| 120 | if (!findCubeFile.Found) | ||
| 121 | { | ||
| 122 | throw new WixException(ErrorMessages.CubeFileNotFound(findCubeFile.Path)); | ||
| 123 | } | ||
| 124 | |||
| 121 | try | 125 | try |
| 122 | { | 126 | { |
| 123 | using (var cubeDatabase = new Database(cubeFile, OpenDatabase.ReadOnly)) | 127 | using (var cubeDatabase = new Database(findCubeFile.Path, OpenDatabase.ReadOnly)) |
| 124 | { | 128 | { |
| 125 | try | 129 | try |
| 126 | { | 130 | { |
| @@ -136,7 +140,7 @@ namespace WixToolset.Core.Native | |||
| 136 | { | 140 | { |
| 137 | if (0x6E == e.NativeErrorCode) // ERROR_OPEN_FAILED | 141 | if (0x6E == e.NativeErrorCode) // ERROR_OPEN_FAILED |
| 138 | { | 142 | { |
| 139 | throw new WixException(ErrorMessages.CubeFileNotFound(cubeFile)); | 143 | throw new WixException(ErrorMessages.CubeFileNotFound(findCubeFile.Path)); |
| 140 | } | 144 | } |
| 141 | 145 | ||
| 142 | throw; | 146 | throw; |
