| 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.Data |
| 4 | { |
| 5 | using WixToolset.Data.Symbols; |
| 6 | |
| 7 | public static partial class SymbolDefinitions |
| 8 | { |
| 9 | public static readonly IntermediateSymbolDefinition ServiceInstall = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.ServiceInstall, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.Name), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.DisplayName), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.ServiceType), IntermediateFieldType.Number), |
| 16 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.StartType), IntermediateFieldType.Number), |
| 17 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.ErrorControl), IntermediateFieldType.Number), |
| 18 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.LoadOrderGroup), IntermediateFieldType.String), |
| 19 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.Dependencies), IntermediateFieldType.String), |
| 20 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.StartName), IntermediateFieldType.String), |
| 21 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.Password), IntermediateFieldType.String), |
| 22 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.Arguments), IntermediateFieldType.String), |
| 23 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.ComponentRef), IntermediateFieldType.String), |
| 24 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.Description), IntermediateFieldType.String), |
| 25 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.Interactive), IntermediateFieldType.Bool), |
| 26 | new IntermediateFieldDefinition(nameof(ServiceInstallSymbolFields.Vital), IntermediateFieldType.Bool), |
| 27 | }, |
| 28 | typeof(ServiceInstallSymbol)); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | namespace WixToolset.Data.Symbols |
| 33 | { |
| 34 | public enum ServiceInstallSymbolFields |
| 35 | { |
| 36 | Name, |
| 37 | DisplayName, |
| 38 | ServiceType, |
| 39 | StartType, |
| 40 | ErrorControl, |
| 41 | LoadOrderGroup, |
| 42 | Dependencies, |
| 43 | StartName, |
| 44 | Password, |
| 45 | Arguments, |
| 46 | ComponentRef, |
| 47 | Description, |
| 48 | Interactive, |
| 49 | Vital, |
| 50 | } |
| 51 | |
| 52 | public enum ServiceType |
| 53 | { |
| 54 | KernelDriver, |
| 55 | SystemDriver, |
| 56 | OwnProcess = 0x10, |
| 57 | ShareProcess = 0x20, |
| 58 | InteractiveProcess = 0x100, |
| 59 | } |
| 60 | |
| 61 | public enum ServiceStartType |
| 62 | { |
| 63 | Boot, |
| 64 | System, |
| 65 | Auto, |
| 66 | Demand, |
| 67 | Disabled, |
| 68 | } |
| 69 | |
| 70 | public enum ServiceErrorControl |
| 71 | { |
| 72 | Ignore, |
| 73 | Normal, |
| 74 | Critical = 3, |
| 75 | } |
| 76 | |
| 77 | public class ServiceInstallSymbol : IntermediateSymbol |
| 78 | { |
| 79 | public ServiceInstallSymbol() : base(SymbolDefinitions.ServiceInstall, null, null) |
| 80 | { |
| 81 | } |
| 82 | |
| 83 | public ServiceInstallSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.ServiceInstall, sourceLineNumber, id) |
| 84 | { |
| 85 | } |
| 86 | |
| 87 | public IntermediateField this[ServiceInstallSymbolFields index] => this.Fields[(int)index]; |
| 88 | |
| 89 | public string Name |
| 90 | { |
| 91 | get => (string)this.Fields[(int)ServiceInstallSymbolFields.Name]; |
| 92 | set => this.Set((int)ServiceInstallSymbolFields.Name, value); |
| 93 | } |
| 94 | |
| 95 | public string DisplayName |
| 96 | { |
| 97 | get => (string)this.Fields[(int)ServiceInstallSymbolFields.DisplayName]; |
| 98 | set => this.Set((int)ServiceInstallSymbolFields.DisplayName, value); |
| 99 | } |
| 100 | |
| 101 | public ServiceType ServiceType |
| 102 | { |
| 103 | get => (ServiceType)this.Fields[(int)ServiceInstallSymbolFields.ServiceType].AsNumber(); |
| 104 | set => this.Set((int)ServiceInstallSymbolFields.ServiceType, (int)value); |
| 105 | } |
| 106 | |
| 107 | public ServiceStartType StartType |
| 108 | { |
| 109 | get => (ServiceStartType)this.Fields[(int)ServiceInstallSymbolFields.StartType].AsNumber(); |
| 110 | set => this.Set((int)ServiceInstallSymbolFields.StartType, (int)value); |
| 111 | } |
| 112 | |
| 113 | public ServiceErrorControl ErrorControl |
| 114 | { |
| 115 | get => (ServiceErrorControl)this.Fields[(int)ServiceInstallSymbolFields.ErrorControl].AsNumber(); |
| 116 | set => this.Set((int)ServiceInstallSymbolFields.ErrorControl, (int)value); |
| 117 | } |
| 118 | |
| 119 | public string LoadOrderGroup |
| 120 | { |
| 121 | get => (string)this.Fields[(int)ServiceInstallSymbolFields.LoadOrderGroup]; |
| 122 | set => this.Set((int)ServiceInstallSymbolFields.LoadOrderGroup, value); |
| 123 | } |
| 124 | |
| 125 | public string Dependencies |
| 126 | { |
| 127 | get => (string)this.Fields[(int)ServiceInstallSymbolFields.Dependencies]; |
| 128 | set => this.Set((int)ServiceInstallSymbolFields.Dependencies, value); |
| 129 | } |
| 130 | |
| 131 | public string StartName |
| 132 | { |
| 133 | get => (string)this.Fields[(int)ServiceInstallSymbolFields.StartName]; |
| 134 | set => this.Set((int)ServiceInstallSymbolFields.StartName, value); |
| 135 | } |
| 136 | |
| 137 | public string Password |
| 138 | { |
| 139 | get => (string)this.Fields[(int)ServiceInstallSymbolFields.Password]; |
| 140 | set => this.Set((int)ServiceInstallSymbolFields.Password, value); |
| 141 | } |
| 142 | |
| 143 | public string Arguments |
| 144 | { |
| 145 | get => (string)this.Fields[(int)ServiceInstallSymbolFields.Arguments]; |
| 146 | set => this.Set((int)ServiceInstallSymbolFields.Arguments, value); |
| 147 | } |
| 148 | |
| 149 | public string ComponentRef |
| 150 | { |
| 151 | get => (string)this.Fields[(int)ServiceInstallSymbolFields.ComponentRef]; |
| 152 | set => this.Set((int)ServiceInstallSymbolFields.ComponentRef, value); |
| 153 | } |
| 154 | |
| 155 | public string Description |
| 156 | { |
| 157 | get => (string)this.Fields[(int)ServiceInstallSymbolFields.Description]; |
| 158 | set => this.Set((int)ServiceInstallSymbolFields.Description, value); |
| 159 | } |
| 160 | |
| 161 | public bool Interactive |
| 162 | { |
| 163 | get => this.Fields[(int)ServiceInstallSymbolFields.Interactive].AsBool(); |
| 164 | set => this.Set((int)ServiceInstallSymbolFields.Interactive, value); |
| 165 | } |
| 166 | |
| 167 | public bool Vital |
| 168 | { |
| 169 | get => this.Fields[(int)ServiceInstallSymbolFields.Vital].AsBool(); |
| 170 | set => this.Set((int)ServiceInstallSymbolFields.Vital, value); |
| 171 | } |
| 172 | } |
| 173 | } |