Get WiX property value from output of command?
Is there a way to execute a command (in PoSh, ideally) and assign the output to the value of a property in WiX? So far, all I have seen is 开发者_StackOverflowcustom actions that will run a command, but not capture output or set a property's value.
Custom actions can access the Wix Session and set a property on the session that can be read out later.
This is C# code but it would be similar in PS
[CustomAction]
public static ActionResult myaction(Session session)
{
session["myvariable"] = "myvalue";
}
After the action has been executed you can access it in the UI as if it where a normal property. Be aware though that if you are planning on changing the UI to respond to this you will need to use a hack to make the wix UI realise that the value has changed...see my answer in this SO question Wix Interactions with Conditions, Properties & Custom Actions
精彩评论