Hello, is there a way to add the BalExtension condition to the bootstrapper standard application?
<bal:Condition Message="Some string"> <My Condition> </bal:Condition>
You can do it in XML generation event:
C#
bootstrapper.WixSourceGenerated += (XDocument doc) =>
{
doc.FindFirst("Bundle")
.AddElement(new XElement(WixExtension.Bal.ToXName("Condition"), "my_condition"))
.SetAttribute("Message", "my_warning");
};
Your post prompted me to revise the current support IGenricItems, which in case of Bundle is limited to Bundle.Variables only.
I have submitted the changes to the Bundle class, which will allow user define generic items to be added to the Bundle. This is how you will be able to add your own WixSharp extensions (bal:Condition), which are otherwise unavailable out of box:
```C#
class BalCondition : WixEntity, IGenericEntity
{
public string Condition;
public string Message;
public void Process(ProcessingContext context)
{
context.Project.Include(WixExtension.Bal); //indicate that candle needs to use WixBlExtension.dll
var element = new XElement(WixExtension.Bal.ToXName("Condition"), Condition)
.SetAttribute("Message", Message);
context.XParent.Add(element);
}
}
...
bootstrapper.Items.Add(new BalCondition
{
Condition = "some condition",
Message = "Warning: ..."
});
```
Most helpful comment
Your post prompted me to revise the current support
IGenricItems, which in case ofBundleis limited toBundle.Variablesonly.I have submitted the changes to the
Bundleclass, which will allow user define generic items to be added to theBundle. This is how you will be able to add your own WixSharp extensions (bal:Condition), which are otherwise unavailable out of box:```C#
class BalCondition : WixEntity, IGenericEntity
{
public string Condition;
}
...
bootstrapper.Items.Add(new BalCondition
{
Condition = "some condition",
Message = "Warning: ..."
});
```