aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.Native/Msi/Installer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core.Native/Msi/Installer.cs')
-rw-r--r--src/WixToolset.Core.Native/Msi/Installer.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/WixToolset.Core.Native/Msi/Installer.cs b/src/WixToolset.Core.Native/Msi/Installer.cs
index 2bb41078..8a45aaa8 100644
--- a/src/WixToolset.Core.Native/Msi/Installer.cs
+++ b/src/WixToolset.Core.Native/Msi/Installer.cs
@@ -24,6 +24,31 @@ namespace WixToolset.Core.Native.Msi
24 public static class Installer 24 public static class Installer
25 { 25 {
26 /// <summary> 26 /// <summary>
27 /// Extacts the patch metadata as XML.
28 /// </summary>
29 /// <param name="path">Path to patch.</param>
30 /// <returns>String XML.</returns>
31 public static string ExtractPatchXml(string path)
32 {
33 var buffer = new StringBuilder(65535);
34 var size = buffer.Capacity;
35
36 var error = MsiInterop.MsiExtractPatchXMLData(path, 0, buffer, ref size);
37 if (234 == error)
38 {
39 buffer.EnsureCapacity(++size);
40 error = MsiInterop.MsiExtractPatchXMLData(path, 0, buffer, ref size);
41 }
42
43 if (error != 0)
44 {
45 throw new MsiException(error);
46 }
47
48 return buffer.ToString();
49 }
50
51 /// <summary>
27 /// Takes the path to a file and returns a 128-bit hash of that file. 52 /// Takes the path to a file and returns a 128-bit hash of that file.
28 /// </summary> 53 /// </summary>
29 /// <param name="filePath">Path to file that is to be hashed.</param> 54 /// <param name="filePath">Path to file that is to be hashed.</param>