diff options
Diffstat (limited to 'src/wixext/UtilCompiler.cs')
-rw-r--r-- | src/wixext/UtilCompiler.cs | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs index 12213e63..63f2b469 100644 --- a/src/wixext/UtilCompiler.cs +++ b/src/wixext/UtilCompiler.cs | |||
@@ -41,13 +41,6 @@ namespace WixToolset.Util | |||
41 | Compatible, | 41 | Compatible, |
42 | } | 42 | } |
43 | 43 | ||
44 | internal enum WixRemoveFolderExOn | ||
45 | { | ||
46 | Install = 1, | ||
47 | Uninstall = 2, | ||
48 | Both = 3, | ||
49 | } | ||
50 | |||
51 | private static readonly Regex FindPropertyBrackets = new Regex(@"\[(?!\\|\])|(?<!\[\\\]|\[\\|\\\[)\]", RegexOptions.ExplicitCapture | RegexOptions.Compiled); | 44 | private static readonly Regex FindPropertyBrackets = new Regex(@"\[(?!\\|\])|(?<!\[\\\]|\[\\|\\\[)\]", RegexOptions.ExplicitCapture | RegexOptions.Compiled); |
52 | 45 | ||
53 | public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/util"; | 46 | public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/util"; |
@@ -2812,8 +2805,9 @@ namespace WixToolset.Util | |||
2812 | { | 2805 | { |
2813 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2806 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2814 | Identifier id = null; | 2807 | Identifier id = null; |
2815 | var on = (int)WixRemoveFolderExOn.Uninstall; | 2808 | var mode = WixRemoveFolderExInstallMode.Uninstall; |
2816 | string property = null; | 2809 | string property = null; |
2810 | string condition = null; | ||
2817 | 2811 | ||
2818 | foreach (var attrib in element.Attributes()) | 2812 | foreach (var attrib in element.Attributes()) |
2819 | { | 2813 | { |
@@ -2821,6 +2815,9 @@ namespace WixToolset.Util | |||
2821 | { | 2815 | { |
2822 | switch (attrib.Name.LocalName) | 2816 | switch (attrib.Name.LocalName) |
2823 | { | 2817 | { |
2818 | case "Condition": | ||
2819 | condition = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
2820 | break; | ||
2824 | case "Id": | 2821 | case "Id": |
2825 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); | 2822 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); |
2826 | break; | 2823 | break; |
@@ -2828,24 +2825,22 @@ namespace WixToolset.Util | |||
2828 | var onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 2825 | var onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
2829 | if (onValue.Length == 0) | 2826 | if (onValue.Length == 0) |
2830 | { | 2827 | { |
2831 | on = CompilerConstants.IllegalInteger; | ||
2832 | } | 2828 | } |
2833 | else | 2829 | else |
2834 | { | 2830 | { |
2835 | switch (onValue) | 2831 | switch (onValue) |
2836 | { | 2832 | { |
2837 | case "install": | 2833 | case "install": |
2838 | on = (int)WixRemoveFolderExOn.Install; | 2834 | mode = WixRemoveFolderExInstallMode.Install; |
2839 | break; | 2835 | break; |
2840 | case "uninstall": | 2836 | case "uninstall": |
2841 | on = (int)WixRemoveFolderExOn.Uninstall; | 2837 | mode = WixRemoveFolderExInstallMode.Uninstall; |
2842 | break; | 2838 | break; |
2843 | case "both": | 2839 | case "both": |
2844 | on = (int)WixRemoveFolderExOn.Both; | 2840 | mode = WixRemoveFolderExInstallMode.Both; |
2845 | break; | 2841 | break; |
2846 | default: | 2842 | default: |
2847 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "On", onValue, "install", "uninstall", "both")); | 2843 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "On", onValue, "install", "uninstall", "both")); |
2848 | on = CompilerConstants.IllegalInteger; | ||
2849 | break; | 2844 | break; |
2850 | } | 2845 | } |
2851 | } | 2846 | } |
@@ -2869,9 +2864,9 @@ namespace WixToolset.Util | |||
2869 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Property")); | 2864 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Property")); |
2870 | } | 2865 | } |
2871 | 2866 | ||
2872 | if (null == id) | 2867 | if (id == null) |
2873 | { | 2868 | { |
2874 | id = this.ParseHelper.CreateIdentifier("wrf", componentId, property, on.ToString(CultureInfo.InvariantCulture.NumberFormat)); | 2869 | id = this.ParseHelper.CreateIdentifier("wrf", componentId, property, mode.ToString()); |
2875 | } | 2870 | } |
2876 | 2871 | ||
2877 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | 2872 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); |
@@ -2884,7 +2879,8 @@ namespace WixToolset.Util | |||
2884 | { | 2879 | { |
2885 | ComponentRef = componentId, | 2880 | ComponentRef = componentId, |
2886 | Property = property, | 2881 | Property = property, |
2887 | InstallMode = on, | 2882 | InstallMode = mode, |
2883 | Condition = condition | ||
2888 | }); | 2884 | }); |
2889 | 2885 | ||
2890 | this.ParseHelper.EnsureTable(section, sourceLineNumbers, "RemoveFile"); | 2886 | this.ParseHelper.EnsureTable(section, sourceLineNumbers, "RemoveFile"); |