| 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 MsiServiceConfig = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.MsiServiceConfig, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(MsiServiceConfigSymbolFields.Name), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(MsiServiceConfigFailureActionsSymbolFields.OnInstall), IntermediateFieldType.Bool), |
| 15 | new IntermediateFieldDefinition(nameof(MsiServiceConfigFailureActionsSymbolFields.OnReinstall), IntermediateFieldType.Bool), |
| 16 | new IntermediateFieldDefinition(nameof(MsiServiceConfigFailureActionsSymbolFields.OnUninstall), IntermediateFieldType.Bool), |
| 17 | new IntermediateFieldDefinition(nameof(MsiServiceConfigSymbolFields.ConfigType), IntermediateFieldType.Number), |
| 18 | new IntermediateFieldDefinition(nameof(MsiServiceConfigSymbolFields.Argument), IntermediateFieldType.String), |
| 19 | new IntermediateFieldDefinition(nameof(MsiServiceConfigSymbolFields.ComponentRef), IntermediateFieldType.String), |
| 20 | }, |
| 21 | typeof(MsiServiceConfigSymbol)); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | namespace WixToolset.Data.Symbols |
| 26 | { |
| 27 | public enum MsiServiceConfigSymbolFields |
| 28 | { |
| 29 | Name, |
| 30 | OnInstall, |
| 31 | OnReinstall, |
| 32 | OnUninstall, |
| 33 | ConfigType, |
| 34 | Argument, |
| 35 | ComponentRef, |
| 36 | } |
| 37 | |
| 38 | public enum MsiServiceConfigType |
| 39 | { |
| 40 | DelayedAutoStart = 3, |
| 41 | FailureActionsFlag, |
| 42 | ServiceSidInfo, |
| 43 | RequiredPrivilegesInfo, |
| 44 | PreshutdownInfo, |
| 45 | } |
| 46 | |
| 47 | public class MsiServiceConfigSymbol : IntermediateSymbol |
| 48 | { |
| 49 | public MsiServiceConfigSymbol() : base(SymbolDefinitions.MsiServiceConfig, null, null) |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | public MsiServiceConfigSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.MsiServiceConfig, sourceLineNumber, id) |
| 54 | { |
| 55 | } |
| 56 | |
| 57 | public IntermediateField this[MsiServiceConfigSymbolFields index] => this.Fields[(int)index]; |
| 58 | |
| 59 | public string Name |
| 60 | { |
| 61 | get => (string)this.Fields[(int)MsiServiceConfigSymbolFields.Name]; |
| 62 | set => this.Set((int)MsiServiceConfigSymbolFields.Name, value); |
| 63 | } |
| 64 | |
| 65 | public bool OnInstall |
| 66 | { |
| 67 | get => this.Fields[(int)MsiServiceConfigSymbolFields.OnInstall].AsBool(); |
| 68 | set => this.Set((int)MsiServiceConfigSymbolFields.OnInstall, value); |
| 69 | } |
| 70 | |
| 71 | public bool OnReinstall |
| 72 | { |
| 73 | get => this.Fields[(int)MsiServiceConfigSymbolFields.OnReinstall].AsBool(); |
| 74 | set => this.Set((int)MsiServiceConfigSymbolFields.OnReinstall, value); |
| 75 | } |
| 76 | |
| 77 | public bool OnUninstall |
| 78 | { |
| 79 | get => this.Fields[(int)MsiServiceConfigSymbolFields.OnUninstall].AsBool(); |
| 80 | set => this.Set((int)MsiServiceConfigSymbolFields.OnUninstall, value); |
| 81 | } |
| 82 | |
| 83 | public MsiServiceConfigType ConfigType |
| 84 | { |
| 85 | get => (MsiServiceConfigType)this.Fields[(int)MsiServiceConfigSymbolFields.ConfigType].AsNumber(); |
| 86 | set => this.Set((int)MsiServiceConfigSymbolFields.ConfigType, (int)value); |
| 87 | } |
| 88 | |
| 89 | public string Argument |
| 90 | { |
| 91 | get => (string)this.Fields[(int)MsiServiceConfigSymbolFields.Argument]; |
| 92 | set => this.Set((int)MsiServiceConfigSymbolFields.Argument, value); |
| 93 | } |
| 94 | |
| 95 | public string ComponentRef |
| 96 | { |
| 97 | get => (string)this.Fields[(int)MsiServiceConfigSymbolFields.ComponentRef]; |
| 98 | set => this.Set((int)MsiServiceConfigSymbolFields.ComponentRef, value); |
| 99 | } |
| 100 | } |
| 101 | } |