diff options
| author | Bob Arnson <bob@firegiant.com> | 2023-12-23 21:37:02 -0500 |
|---|---|---|
| committer | Bob Arnson <github@bobs.org> | 2023-12-30 18:00:56 -0500 |
| commit | 1eea9c6e7b276c7c0dfde7779dfec45046ad5831 (patch) | |
| tree | 487929fdae1e827722d951f97447b185a4d73148 /src/api | |
| parent | f4a0522fde6066c76e771f6be381bf9e658b875a (diff) | |
| download | wix-1eea9c6e7b276c7c0dfde7779dfec45046ad5831.tar.gz wix-1eea9c6e7b276c7c0dfde7779dfec45046ad5831.tar.bz2 wix-1eea9c6e7b276c7c0dfde7779dfec45046ad5831.zip | |
Add default major upgrade.
Add Package/@UpgradeStrategy to allow `none` to suppress major upgrade.
Implements https://github.com/wixtoolset/issues/issues/7605.
Requires https://github.com/wixtoolset/wix/pull/435.
Diffstat (limited to 'src/api')
3 files changed, 28 insertions, 1 deletions
diff --git a/src/api/wix/WixToolset.Data/Symbols/WixPackageSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/WixPackageSymbol.cs index e1720033..4a112266 100644 --- a/src/api/wix/WixToolset.Data/Symbols/WixPackageSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/WixPackageSymbol.cs | |||
| @@ -46,6 +46,12 @@ namespace WixToolset.Data.Symbols | |||
| 46 | PerMachine = 0x1, | 46 | PerMachine = 0x1, |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | public enum WixPackageUpgradeStrategy | ||
| 50 | { | ||
| 51 | None = 0x0, | ||
| 52 | MajorUpgrade = 0x1, | ||
| 53 | } | ||
| 54 | |||
| 49 | public class WixPackageSymbol : IntermediateSymbol | 55 | public class WixPackageSymbol : IntermediateSymbol |
| 50 | { | 56 | { |
| 51 | public WixPackageSymbol() : base(SymbolDefinitions.WixPackage, null, null) | 57 | public WixPackageSymbol() : base(SymbolDefinitions.WixPackage, null, null) |
| @@ -106,6 +112,12 @@ namespace WixToolset.Data.Symbols | |||
| 106 | set => this.Set((int)WixPackageSymbolFields.Codepage, value); | 112 | set => this.Set((int)WixPackageSymbolFields.Codepage, value); |
| 107 | } | 113 | } |
| 108 | 114 | ||
| 115 | public WixPackageUpgradeStrategy UpgradeStrategy | ||
| 116 | { | ||
| 117 | get => (WixPackageUpgradeStrategy)this.Fields[(int)WixPackageSymbolFields.Attributes].AsNumber(); | ||
| 118 | set => this.Set((int)WixPackageSymbolFields.Attributes, (int)value); | ||
| 119 | } | ||
| 120 | |||
| 109 | public bool PerMachine => (this.Attributes & WixPackageAttributes.PerMachine) == WixPackageAttributes.PerMachine; | 121 | public bool PerMachine => (this.Attributes & WixPackageAttributes.PerMachine) == WixPackageAttributes.PerMachine; |
| 110 | } | 122 | } |
| 111 | } | 123 | } |
diff --git a/src/api/wix/WixToolset.Data/WixStandardLibrary.cs b/src/api/wix/WixToolset.Data/WixStandardLibrary.cs index 3758e5b1..3f851f09 100644 --- a/src/api/wix/WixToolset.Data/WixStandardLibrary.cs +++ b/src/api/wix/WixToolset.Data/WixStandardLibrary.cs | |||
| @@ -32,7 +32,17 @@ namespace WixToolset.Data | |||
| 32 | 32 | ||
| 33 | private static IEnumerable<Localization> YieldLocalizations() | 33 | private static IEnumerable<Localization> YieldLocalizations() |
| 34 | { | 34 | { |
| 35 | var strings = new BindVariable[0]; | 35 | var sourceLineNumber = new SourceLineNumber("wixstd.wixlib"); |
| 36 | |||
| 37 | var strings = new[] { | ||
| 38 | new BindVariable() | ||
| 39 | { | ||
| 40 | SourceLineNumbers = sourceLineNumber, | ||
| 41 | Id = "WixDowngradePreventedMessage", | ||
| 42 | Value = "A newer version of [ProductName] is already installed.", | ||
| 43 | Overridable = true, | ||
| 44 | }, | ||
| 45 | }; | ||
| 36 | 46 | ||
| 37 | var localizedControls = new LocalizedControl[0]; | 47 | var localizedControls = new LocalizedControl[0]; |
| 38 | 48 | ||
diff --git a/src/api/wix/WixToolset.Data/WixStandardLibraryIdentifiers.cs b/src/api/wix/WixToolset.Data/WixStandardLibraryIdentifiers.cs index 6579a42b..73e4245b 100644 --- a/src/api/wix/WixToolset.Data/WixStandardLibraryIdentifiers.cs +++ b/src/api/wix/WixToolset.Data/WixStandardLibraryIdentifiers.cs | |||
| @@ -21,5 +21,10 @@ namespace WixToolset.Data | |||
| 21 | /// Default feature name. | 21 | /// Default feature name. |
| 22 | /// </summary> | 22 | /// </summary> |
| 23 | public static readonly string DefaultFeatureName = "WixDefaultFeature"; | 23 | public static readonly string DefaultFeatureName = "WixDefaultFeature"; |
| 24 | |||
| 25 | /// <summary> | ||
| 26 | /// WiX Standard localization strings. | ||
| 27 | /// </summary> | ||
| 28 | public static readonly string WixStandardLocalizationStrings = "WixStandardLocalizationStrings"; | ||
| 24 | } | 29 | } |
| 25 | } | 30 | } |
