0

I have been asked to add a function to an existing WiX package. Specifically, I need to run a small c# application and return a single int back to WiX to conditionally control further actions. I can see from ExePackage help that there is an ExitCode, but this is an enumeration of success, error, scheduleReboot or forceReboot.

I have googled quite a bit and I am wondering if I am missing the point. I can probably implement the C# process internally within WiX to get the user to provide the information I need, but the existing package already has custom ExePackages written in C# with a particular style, so I'd like to stay with that if I can. (The existing packages don't return any needed values)

Can I do this, or do I need to try and operate entirely within WiX?

For reference, one of the existing packages looks like this:

<ExePackage
    SourceFile="..."
    DisplayName="License Key"
    InstallSize="0"
    Permanent="yes"
    InstallCommand="/ignoreIfLicensed"
    RepairCommand="/ignore"
    UninstallCommand="/ignore"
/>
riemannzz
  • 1,731
  • 1
  • 13
  • 8

1 Answers1

0

The reference to <ExePackage ...> implies you want the condition to operate in a WIX bundle. In this scenario I think your options are limited and you can only map the return value of an ExePackage to global behaviour like forceReboot.

Do you have any <MsiPackage...> references? If you have, you could move the conditional behaviour inside each <MsiPackage...> using a Custom Action to call the exe and set a property. The property can then be used as a condition in each <component...> you want to conditionally install. See Using a WiX custom action to set a property's value for more information on custom actions setting properties.

Community
  • 1
  • 1
bradfordrg
  • 1,863
  • 2
  • 21
  • 34