0

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 custom actions that will run a command, but not capture output or set a property's value.

Ben Collins
  • 20,538
  • 18
  • 127
  • 187

1 Answers1

1

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

Community
  • 1
  • 1
Daniel Powell
  • 8,143
  • 11
  • 61
  • 108