diff options
| author | Rob Mensching <rob@firegiant.com> | 2024-12-28 17:41:00 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2024-12-29 16:29:07 -0800 |
| commit | c92494afeefdb226c19c89ff1ffa20b541e50b31 (patch) | |
| tree | 9676b604289b4d6b80c330dc1aacbc3ed6e7d229 /src | |
| parent | 4d6476d43973bc4ebee1ff246fb3e5c88b024bc4 (diff) | |
| download | wix-c92494afeefdb226c19c89ff1ffa20b541e50b31.tar.gz wix-c92494afeefdb226c19c89ff1ffa20b541e50b31.tar.bz2 wix-c92494afeefdb226c19c89ff1ffa20b541e50b31.zip | |
Fix WixPackageSymbol Attributes, Scope, UpgradeStrategy fields
Diffstat (limited to '')
| -rw-r--r-- | src/api/wix/WixToolset.Data/Symbols/WixPackageSymbol.cs | 28 | ||||
| -rw-r--r-- | src/wix/WixToolset.Core/Compiler_Package.cs | 14 |
2 files changed, 27 insertions, 15 deletions
diff --git a/src/api/wix/WixToolset.Data/Symbols/WixPackageSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/WixPackageSymbol.cs index 4a112266..9601ec7a 100644 --- a/src/api/wix/WixToolset.Data/Symbols/WixPackageSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/WixPackageSymbol.cs | |||
| @@ -18,6 +18,8 @@ namespace WixToolset.Data | |||
| 18 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Manufacturer), IntermediateFieldType.String), | 18 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Manufacturer), IntermediateFieldType.String), |
| 19 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Attributes), IntermediateFieldType.Number), | 19 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Attributes), IntermediateFieldType.Number), |
| 20 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Codepage), IntermediateFieldType.String), | 20 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Codepage), IntermediateFieldType.String), |
| 21 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Scope), IntermediateFieldType.Number), | ||
| 22 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.UpgradeStrategy), IntermediateFieldType.Number), | ||
| 21 | }, | 23 | }, |
| 22 | typeof(WixPackageSymbol)); | 24 | typeof(WixPackageSymbol)); |
| 23 | } | 25 | } |
| @@ -37,19 +39,27 @@ namespace WixToolset.Data.Symbols | |||
| 37 | Manufacturer, | 39 | Manufacturer, |
| 38 | Attributes, | 40 | Attributes, |
| 39 | Codepage, | 41 | Codepage, |
| 42 | Scope, | ||
| 43 | UpgradeStrategy, | ||
| 40 | } | 44 | } |
| 41 | 45 | ||
| 42 | [Flags] | 46 | [Flags] |
| 43 | public enum WixPackageAttributes | 47 | public enum WixPackageAttributes |
| 44 | { | 48 | { |
| 45 | None = 0x0, | 49 | None = 0x0, |
| 46 | PerMachine = 0x1, | 50 | } |
| 51 | |||
| 52 | public enum WixPackageScope | ||
| 53 | { | ||
| 54 | PerMachine, | ||
| 55 | PerUser, | ||
| 56 | PerUserOrMachine, | ||
| 47 | } | 57 | } |
| 48 | 58 | ||
| 49 | public enum WixPackageUpgradeStrategy | 59 | public enum WixPackageUpgradeStrategy |
| 50 | { | 60 | { |
| 51 | None = 0x0, | 61 | None, |
| 52 | MajorUpgrade = 0x1, | 62 | MajorUpgrade, |
| 53 | } | 63 | } |
| 54 | 64 | ||
| 55 | public class WixPackageSymbol : IntermediateSymbol | 65 | public class WixPackageSymbol : IntermediateSymbol |
| @@ -112,12 +122,16 @@ namespace WixToolset.Data.Symbols | |||
| 112 | set => this.Set((int)WixPackageSymbolFields.Codepage, value); | 122 | set => this.Set((int)WixPackageSymbolFields.Codepage, value); |
| 113 | } | 123 | } |
| 114 | 124 | ||
| 115 | public WixPackageUpgradeStrategy UpgradeStrategy | 125 | public WixPackageScope Scope |
| 116 | { | 126 | { |
| 117 | get => (WixPackageUpgradeStrategy)this.Fields[(int)WixPackageSymbolFields.Attributes].AsNumber(); | 127 | get => (WixPackageScope)this.Fields[(int)WixPackageSymbolFields.Scope].AsNumber(); |
| 118 | set => this.Set((int)WixPackageSymbolFields.Attributes, (int)value); | 128 | set => this.Set((int)WixPackageSymbolFields.Scope, (int)value); |
| 119 | } | 129 | } |
| 120 | 130 | ||
| 121 | public bool PerMachine => (this.Attributes & WixPackageAttributes.PerMachine) == WixPackageAttributes.PerMachine; | 131 | public WixPackageUpgradeStrategy UpgradeStrategy |
| 132 | { | ||
| 133 | get => (WixPackageUpgradeStrategy)this.Fields[(int)WixPackageSymbolFields.UpgradeStrategy].AsNumber(); | ||
| 134 | set => this.Set((int)WixPackageSymbolFields.UpgradeStrategy, (int)value); | ||
| 135 | } | ||
| 122 | } | 136 | } |
| 123 | } | 137 | } |
diff --git a/src/wix/WixToolset.Core/Compiler_Package.cs b/src/wix/WixToolset.Core/Compiler_Package.cs index 479a1ab3..b84c5fae 100644 --- a/src/wix/WixToolset.Core/Compiler_Package.cs +++ b/src/wix/WixToolset.Core/Compiler_Package.cs | |||
| @@ -30,8 +30,7 @@ namespace WixToolset.Core | |||
| 30 | string codepage = null; | 30 | string codepage = null; |
| 31 | var productCode = "*"; | 31 | var productCode = "*"; |
| 32 | string productLanguage = null; | 32 | string productLanguage = null; |
| 33 | var isPerMachine = true; | 33 | var scope = WixPackageScope.PerMachine; |
| 34 | var isPerUserOrMachine = false; | ||
| 35 | string upgradeCode = null; | 34 | string upgradeCode = null; |
| 36 | string manufacturer = null; | 35 | string manufacturer = null; |
| 37 | string version = null; | 36 | string version = null; |
| @@ -91,12 +90,11 @@ namespace WixToolset.Core | |||
| 91 | // handled below after we create the section. | 90 | // handled below after we create the section. |
| 92 | break; | 91 | break; |
| 93 | case "perUser": | 92 | case "perUser": |
| 94 | isPerMachine = false; | 93 | scope = WixPackageScope.PerUser; |
| 95 | sourceBits |= 8; | 94 | sourceBits |= 8; |
| 96 | break; | 95 | break; |
| 97 | case "perUserOrMachine": | 96 | case "perUserOrMachine": |
| 98 | isPerMachine = false; | 97 | scope = WixPackageScope.PerUserOrMachine; |
| 99 | isPerUserOrMachine = true; | ||
| 100 | break; | 98 | break; |
| 101 | default: | 99 | default: |
| 102 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, installScope, "perMachine", "perUser", "perUserOrMachine")); | 100 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, installScope, "perMachine", "perUser", "perUserOrMachine")); |
| @@ -191,12 +189,12 @@ namespace WixToolset.Core | |||
| 191 | this.AddProperty(sourceLineNumbers, new Identifier(AccessModifier.Global, "UpgradeCode"), upgradeCode, false, false, false, true); | 189 | this.AddProperty(sourceLineNumbers, new Identifier(AccessModifier.Global, "UpgradeCode"), upgradeCode, false, false, false, true); |
| 192 | } | 190 | } |
| 193 | 191 | ||
| 194 | if (isPerUserOrMachine) | 192 | if (scope == WixPackageScope.PerUserOrMachine) |
| 195 | { | 193 | { |
| 196 | this.AddProperty(sourceLineNumbers, new Identifier(AccessModifier.Global, "ALLUSERS"), "2", false, false, false, false); | 194 | this.AddProperty(sourceLineNumbers, new Identifier(AccessModifier.Global, "ALLUSERS"), "2", false, false, false, false); |
| 197 | this.AddProperty(sourceLineNumbers, new Identifier(AccessModifier.Global, "MSIINSTALLPERUSER"), "1", false, false, false, false); | 195 | this.AddProperty(sourceLineNumbers, new Identifier(AccessModifier.Global, "MSIINSTALLPERUSER"), "1", false, false, false, false); |
| 198 | } | 196 | } |
| 199 | else if (isPerMachine) | 197 | else if (scope == WixPackageScope.PerMachine) |
| 200 | { | 198 | { |
| 201 | this.AddProperty(sourceLineNumbers, new Identifier(AccessModifier.Global, "ALLUSERS"), "1", false, false, false, false); | 199 | this.AddProperty(sourceLineNumbers, new Identifier(AccessModifier.Global, "ALLUSERS"), "1", false, false, false, false); |
| 202 | } | 200 | } |
| @@ -402,8 +400,8 @@ namespace WixToolset.Core | |||
| 402 | Language = productLanguage, | 400 | Language = productLanguage, |
| 403 | Version = version, | 401 | Version = version, |
| 404 | Manufacturer = manufacturer, | 402 | Manufacturer = manufacturer, |
| 405 | Attributes = isPerMachine ? WixPackageAttributes.PerMachine : WixPackageAttributes.None, | ||
| 406 | Codepage = codepage, | 403 | Codepage = codepage, |
| 404 | Scope = scope, | ||
| 407 | UpgradeStrategy = upgradeStrategy, | 405 | UpgradeStrategy = upgradeStrategy, |
| 408 | }); | 406 | }); |
| 409 | 407 | ||
