diff options
Diffstat (limited to 'src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs')
| -rw-r--r-- | src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs b/src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs index ac593152..43c19d69 100644 --- a/src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs +++ b/src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs | |||
| @@ -102,11 +102,24 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 102 | /// <param name="path">Path to output file saved on disk.</param> | 102 | /// <param name="path">Path to output file saved on disk.</param> |
| 103 | /// <param name="suppressVersionCheck">Suppresses wix.dll version mismatch check.</param> | 103 | /// <param name="suppressVersionCheck">Suppresses wix.dll version mismatch check.</param> |
| 104 | /// <returns>Output object.</returns> | 104 | /// <returns>Output object.</returns> |
| 105 | public static WindowsInstallerData Load(string path, bool suppressVersionCheck) | 105 | public static WindowsInstallerData Load(string path, bool suppressVersionCheck = false) |
| 106 | { | 106 | { |
| 107 | using (var wixout = WixOutput.Read(path)) | 107 | using (var wixOutput = WixOutput.Read(path)) |
| 108 | using (var stream = wixout.GetDataStream(WixOutputStreamName)) | 108 | { |
| 109 | using (var reader = XmlReader.Create(stream, null, wixout.Uri.AbsoluteUri)) | 109 | return WindowsInstallerData.Load(wixOutput, suppressVersionCheck); |
| 110 | } | ||
| 111 | } | ||
| 112 | |||
| 113 | /// <summary> | ||
| 114 | /// Loads an output from a WixOutput object. | ||
| 115 | /// </summary> | ||
| 116 | /// <param name="wixOutput">WixOutput object.</param> | ||
| 117 | /// <param name="suppressVersionCheck">Suppresses wix.dll version mismatch check.</param> | ||
| 118 | /// <returns>Output object.</returns> | ||
| 119 | public static WindowsInstallerData Load(WixOutput wixOutput, bool suppressVersionCheck = false) | ||
| 120 | { | ||
| 121 | using (var stream = wixOutput.GetDataStream(WixOutputStreamName)) | ||
| 122 | using (var reader = XmlReader.Create(stream, null, wixOutput.Uri.AbsoluteUri)) | ||
| 110 | { | 123 | { |
| 111 | try | 124 | try |
| 112 | { | 125 | { |
| @@ -115,7 +128,7 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 115 | } | 128 | } |
| 116 | catch (XmlException xe) | 129 | catch (XmlException xe) |
| 117 | { | 130 | { |
| 118 | throw new WixCorruptFileException(path, "wixout", xe); | 131 | throw new WixCorruptFileException(wixOutput.Uri.AbsoluteUri, "wixout", xe); |
| 119 | } | 132 | } |
| 120 | } | 133 | } |
| 121 | } | 134 | } |
