aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Mba.Core/PackageInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Mba.Core/PackageInfo.cs')
-rw-r--r--src/WixToolset.Mba.Core/PackageInfo.cs107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/WixToolset.Mba.Core/PackageInfo.cs b/src/WixToolset.Mba.Core/PackageInfo.cs
index d54438f5..75a0fd53 100644
--- a/src/WixToolset.Mba.Core/PackageInfo.cs
+++ b/src/WixToolset.Mba.Core/PackageInfo.cs
@@ -7,46 +7,133 @@ namespace WixToolset.Mba.Core
7 using System.Xml; 7 using System.Xml;
8 using System.Xml.XPath; 8 using System.Xml.XPath;
9 9
10 /// <summary>
11 ///
12 /// </summary>
10 public enum CacheType 13 public enum CacheType
11 { 14 {
15 /// <summary>
16 ///
17 /// </summary>
12 No, 18 No,
19
20 /// <summary>
21 ///
22 /// </summary>
13 Yes, 23 Yes,
24
25 /// <summary>
26 ///
27 /// </summary>
14 Always, 28 Always,
15 } 29 }
16 30
31 /// <summary>
32 ///
33 /// </summary>
17 public enum PackageType 34 public enum PackageType
18 { 35 {
36 /// <summary>
37 ///
38 /// </summary>
19 Unknown, 39 Unknown,
40
41 /// <summary>
42 ///
43 /// </summary>
20 Exe, 44 Exe,
45
46 /// <summary>
47 ///
48 /// </summary>
21 Msi, 49 Msi,
50
51 /// <summary>
52 ///
53 /// </summary>
22 Msp, 54 Msp,
55
56 /// <summary>
57 ///
58 /// </summary>
23 Msu, 59 Msu,
60
61 /// <summary>
62 ///
63 /// </summary>
24 UpgradeBundle, 64 UpgradeBundle,
65
66 /// <summary>
67 ///
68 /// </summary>
25 AddonBundle, 69 AddonBundle,
70
71 /// <summary>
72 ///
73 /// </summary>
26 PatchBundle, 74 PatchBundle,
27 } 75 }
28 76
77 /// <summary>
78 /// Default implementation of <see cref="IPackageInfo"/>.
79 /// </summary>
29 public class PackageInfo : IPackageInfo 80 public class PackageInfo : IPackageInfo
30 { 81 {
82 /// <inheritdoc/>
31 public string Id { get; internal set; } 83 public string Id { get; internal set; }
84
85 /// <inheritdoc/>
32 public string DisplayName { get; internal set; } 86 public string DisplayName { get; internal set; }
87
88 /// <inheritdoc/>
33 public string Description { get; internal set; } 89 public string Description { get; internal set; }
90
91 /// <inheritdoc/>
34 public PackageType Type { get; internal set; } 92 public PackageType Type { get; internal set; }
93
94 /// <inheritdoc/>
35 public bool Permanent { get; internal set; } 95 public bool Permanent { get; internal set; }
96
97 /// <inheritdoc/>
36 public bool Vital { get; internal set; } 98 public bool Vital { get; internal set; }
99
100 /// <inheritdoc/>
37 public string DisplayInternalUICondition { get; internal set; } 101 public string DisplayInternalUICondition { get; internal set; }
102
103 /// <inheritdoc/>
38 public string ProductCode { get; internal set; } 104 public string ProductCode { get; internal set; }
105
106 /// <inheritdoc/>
39 public string UpgradeCode { get; internal set; } 107 public string UpgradeCode { get; internal set; }
108
109 /// <inheritdoc/>
40 public string Version { get; internal set; } 110 public string Version { get; internal set; }
111
112 /// <inheritdoc/>
41 public string InstallCondition { get; internal set; } 113 public string InstallCondition { get; internal set; }
114
115 /// <inheritdoc/>
42 public CacheType CacheType { get; internal set; } 116 public CacheType CacheType { get; internal set; }
117
118 /// <inheritdoc/>
43 public bool PrereqPackage { get; internal set; } 119 public bool PrereqPackage { get; internal set; }
120
121 /// <inheritdoc/>
44 public string PrereqLicenseFile { get; internal set; } 122 public string PrereqLicenseFile { get; internal set; }
123
124 /// <inheritdoc/>
45 public string PrereqLicenseUrl { get; internal set; } 125 public string PrereqLicenseUrl { get; internal set; }
126
127 /// <inheritdoc/>
46 public object CustomData { get; set; } 128 public object CustomData { get; set; }
47 129
48 internal PackageInfo() { } 130 internal PackageInfo() { }
49 131
132 /// <summary>
133 ///
134 /// </summary>
135 /// <param name="root"></param>
136 /// <returns></returns>
50 public static IDictionary<string, IPackageInfo> ParsePackagesFromXml(XPathNavigator root) 137 public static IDictionary<string, IPackageInfo> ParsePackagesFromXml(XPathNavigator root)
51 { 138 {
52 var packagesById = new Dictionary<string, IPackageInfo>(); 139 var packagesById = new Dictionary<string, IPackageInfo>();
@@ -105,6 +192,12 @@ namespace WixToolset.Mba.Core
105 return packagesById; 192 return packagesById;
106 } 193 }
107 194
195 /// <summary>
196 ///
197 /// </summary>
198 /// <param name="node"></param>
199 /// <param name="attributeName"></param>
200 /// <returns></returns>
108 public static CacheType? GetCacheTypeAttribute(XPathNavigator node, string attributeName) 201 public static CacheType? GetCacheTypeAttribute(XPathNavigator node, string attributeName)
109 { 202 {
110 string attributeValue = BootstrapperApplicationData.GetAttribute(node, attributeName); 203 string attributeValue = BootstrapperApplicationData.GetAttribute(node, attributeName);
@@ -128,6 +221,12 @@ namespace WixToolset.Mba.Core
128 } 221 }
129 } 222 }
130 223
224 /// <summary>
225 ///
226 /// </summary>
227 /// <param name="node"></param>
228 /// <param name="attributeName"></param>
229 /// <returns></returns>
131 public static PackageType? GetPackageTypeAttribute(XPathNavigator node, string attributeName) 230 public static PackageType? GetPackageTypeAttribute(XPathNavigator node, string attributeName)
132 { 231 {
133 string attributeValue = BootstrapperApplicationData.GetAttribute(node, attributeName); 232 string attributeValue = BootstrapperApplicationData.GetAttribute(node, attributeName);
@@ -159,6 +258,14 @@ namespace WixToolset.Mba.Core
159 } 258 }
160 } 259 }
161 260
261 /// <summary>
262 ///
263 /// </summary>
264 /// <param name="id"></param>
265 /// <param name="relationType"></param>
266 /// <param name="perMachine"></param>
267 /// <param name="version"></param>
268 /// <returns></returns>
162 public static IPackageInfo GetRelatedBundleAsPackage(string id, RelationType relationType, bool perMachine, string version) 269 public static IPackageInfo GetRelatedBundleAsPackage(string id, RelationType relationType, bool perMachine, string version)
163 { 270 {
164 PackageInfo package = new PackageInfo(); 271 PackageInfo package = new PackageInfo();