Skip to content

Commit

Permalink
- Issue #1046: ComponentCondition doesn't work for InternetShortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg.shilo authored and oleg.shilo committed Sep 26, 2021
1 parent 06aff03 commit c27a9ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Source/src/WixSharp/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ public static bool IsEmpty(this string s)
/// <summary>
/// Determines whether the given string is empty or not.
/// </summary>
/// <param name="s">The string to analyse.</param>
/// <param name="s">The string to analyses.</param>
/// <returns>
/// <c>true</c> if the specified string is not empty; otherwise, <c>false</c>.
/// </returns>
Expand Down
17 changes: 10 additions & 7 deletions Source/src/WixSharp/WixEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,17 @@ public Dictionary<string, string> Attributes
/// </example>
public string AttributesDefinition { get; set; }

internal string HiddenAttributesDefinition;

internal Dictionary<string, string> attributesBag = new Dictionary<string, string>();

void ProcessAttributesDefinition()
{
if (!AttributesDefinition.IsEmpty())
if (AttributesDefinition.IsNotEmpty() || HiddenAttributesDefinition.IsNotEmpty())
{
try
{
this.Attributes = AttributesDefinition.ToDictionary();
this.Attributes = (AttributesDefinition + ";" + HiddenAttributesDefinition).ToDictionary();
}
catch (Exception e)
{
Expand All @@ -128,7 +130,7 @@ internal string GetAttributeDefinition(string name)
{
var preffix = name + "=";

return (AttributesDefinition ?? "").Trim()
return (HiddenAttributesDefinition ?? "").Trim()
.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
.Where(x => x.StartsWith(preffix))
.Select(x => x.Substring(preffix.Length))
Expand All @@ -139,9 +141,10 @@ internal void SetAttributeDefinition(string name, string value, bool append = fa
{
var preffix = name + "=";

var allItems = (AttributesDefinition ?? "").Trim()
.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
.ToList();
var allItems = (HiddenAttributesDefinition ?? "")
.Trim()
.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
.ToList();

var items = allItems;

Expand All @@ -161,7 +164,7 @@ internal void SetAttributeDefinition(string name, string value, bool append = fa
}
}

AttributesDefinition = string.Join(";", items.ToArray());
HiddenAttributesDefinition = string.Join(";", items.ToArray());
}

/// <summary>
Expand Down

0 comments on commit c27a9ce

Please sign in to comment.