diff options
Diffstat (limited to 'src/WixToolset.Core.Burn/Bind/WixRegistrySearchInfo.cs')
-rw-r--r-- | src/WixToolset.Core.Burn/Bind/WixRegistrySearchInfo.cs | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/src/WixToolset.Core.Burn/Bind/WixRegistrySearchInfo.cs b/src/WixToolset.Core.Burn/Bind/WixRegistrySearchInfo.cs deleted file mode 100644 index 3f85b996..00000000 --- a/src/WixToolset.Core.Burn/Bind/WixRegistrySearchInfo.cs +++ /dev/null | |||
@@ -1,93 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Core.Burn | ||
4 | { | ||
5 | using System; | ||
6 | using System.Xml; | ||
7 | using WixToolset.Data.WindowsInstaller; | ||
8 | |||
9 | /// <summary> | ||
10 | /// Utility class for all WixRegistrySearches. | ||
11 | /// </summary> | ||
12 | internal class WixRegistrySearchInfo : WixSearchInfo | ||
13 | { | ||
14 | #if TODO | ||
15 | public WixRegistrySearchInfo(Row row) | ||
16 | : this((string)row[0], (int)row[1], (string)row[2], (string)row[3], (int)row[4]) | ||
17 | { | ||
18 | } | ||
19 | #endif | ||
20 | |||
21 | public WixRegistrySearchInfo(string id, int root, string key, string value, int attributes) | ||
22 | : base(id) | ||
23 | { | ||
24 | this.Root = root; | ||
25 | this.Key = key; | ||
26 | this.Value = value; | ||
27 | this.Attributes = (WixRegistrySearchAttributes)attributes; | ||
28 | } | ||
29 | |||
30 | public int Root { get; private set; } | ||
31 | public string Key { get; private set; } | ||
32 | public string Value { get; private set; } | ||
33 | public WixRegistrySearchAttributes Attributes { get; private set; } | ||
34 | |||
35 | /// <summary> | ||
36 | /// Generates Burn manifest and ParameterInfo-style markup for a registry search. | ||
37 | /// </summary> | ||
38 | /// <param name="writer"></param> | ||
39 | public override void WriteXml(XmlTextWriter writer) | ||
40 | { | ||
41 | writer.WriteStartElement("RegistrySearch"); | ||
42 | this.WriteWixSearchAttributes(writer); | ||
43 | |||
44 | switch (this.Root) | ||
45 | { | ||
46 | case WindowsInstallerConstants.MsidbRegistryRootClassesRoot: | ||
47 | writer.WriteAttributeString("Root", "HKCR"); | ||
48 | break; | ||
49 | case WindowsInstallerConstants.MsidbRegistryRootCurrentUser: | ||
50 | writer.WriteAttributeString("Root", "HKCU"); | ||
51 | break; | ||
52 | case WindowsInstallerConstants.MsidbRegistryRootLocalMachine: | ||
53 | writer.WriteAttributeString("Root", "HKLM"); | ||
54 | break; | ||
55 | case WindowsInstallerConstants.MsidbRegistryRootUsers: | ||
56 | writer.WriteAttributeString("Root", "HKU"); | ||
57 | break; | ||
58 | } | ||
59 | |||
60 | writer.WriteAttributeString("Key", this.Key); | ||
61 | |||
62 | if (!String.IsNullOrEmpty(this.Value)) | ||
63 | { | ||
64 | writer.WriteAttributeString("Value", this.Value); | ||
65 | } | ||
66 | |||
67 | bool existenceOnly = 0 != (this.Attributes & WixRegistrySearchAttributes.WantExists); | ||
68 | |||
69 | writer.WriteAttributeString("Type", existenceOnly ? "exists" : "value"); | ||
70 | |||
71 | if (0 != (this.Attributes & WixRegistrySearchAttributes.Win64)) | ||
72 | { | ||
73 | writer.WriteAttributeString("Win64", "yes"); | ||
74 | } | ||
75 | |||
76 | if (!existenceOnly) | ||
77 | { | ||
78 | if (0 != (this.Attributes & WixRegistrySearchAttributes.ExpandEnvironmentVariables)) | ||
79 | { | ||
80 | writer.WriteAttributeString("ExpandEnvironment", "yes"); | ||
81 | } | ||
82 | |||
83 | // We *always* say this is VariableType="string". If we end up | ||
84 | // needing to be more specific, we will have to expand the "Format" | ||
85 | // attribute to allow "number" and "version". | ||
86 | |||
87 | writer.WriteAttributeString("VariableType", "string"); | ||
88 | } | ||
89 | |||
90 | writer.WriteEndElement(); | ||
91 | } | ||
92 | } | ||
93 | } | ||