From a85f2e992a301abe5d2c0d58f07e7bc9692ff6e3 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 10 Feb 2020 14:10:51 -0500 Subject: Support loading WindowsInstallerData and Intermediate from WixOutput. --- .../WindowsInstaller/WindowsInstallerData.cs | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/WixToolset.Data/WindowsInstaller') 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 /// Path to output file saved on disk. /// Suppresses wix.dll version mismatch check. /// Output object. - public static WindowsInstallerData Load(string path, bool suppressVersionCheck) + public static WindowsInstallerData Load(string path, bool suppressVersionCheck = false) { - using (var wixout = WixOutput.Read(path)) - using (var stream = wixout.GetDataStream(WixOutputStreamName)) - using (var reader = XmlReader.Create(stream, null, wixout.Uri.AbsoluteUri)) + using (var wixOutput = WixOutput.Read(path)) + { + return WindowsInstallerData.Load(wixOutput, suppressVersionCheck); + } + } + + /// + /// Loads an output from a WixOutput object. + /// + /// WixOutput object. + /// Suppresses wix.dll version mismatch check. + /// Output object. + public static WindowsInstallerData Load(WixOutput wixOutput, bool suppressVersionCheck = false) + { + using (var stream = wixOutput.GetDataStream(WixOutputStreamName)) + using (var reader = XmlReader.Create(stream, null, wixOutput.Uri.AbsoluteUri)) { try { @@ -115,7 +128,7 @@ namespace WixToolset.Data.WindowsInstaller } catch (XmlException xe) { - throw new WixCorruptFileException(path, "wixout", xe); + throw new WixCorruptFileException(wixOutput.Uri.AbsoluteUri, "wixout", xe); } } } -- cgit v1.2.3-55-g6feb