wix result from program execution?
Using Wix, I would like to run an executable (that is being installed) and capture the return value. I have no problem running the executable via:
<CustomAction Id="UpgradeDBFromExe" FileKey="UpgradeDB.exe" ExeCommand="/update" Execute="deferred" Impersonate="no" Return="ignore"/>
But i'm not sure how to capture the return value. If I change the return to 'check' then on failure the installer rolls back (not what I want to happen), instead I want to check this result later (presumable via a property) and display a warning. My thoughts are to use a CustomAction script to call the executable and store the result as a property but this seems messy. Is there any be开发者_开发问答tter way to do this?
I will assume that this CustomAction makes a change to the system and therefore requires privs and is therefire scheduled as deferred / no impersonation. Because of this, and the fact that it's an EXE custom action that's running out of process, MSI doesn't provide a way to set properties. If you use the WiX Quiet Execute Custom Action pattern you could capture the stdout and log it but that's about it. If you used a DLL custom action type you could check the UILevel property and optionally popup an MSI MessageBox asking the user if they want to continue and based on that you could return success or failure but as an EXE you are kind of stuck.
Another approach would be to have another custom action run in the UI Sequence after the execute action that validates what the EXE did and set a property for success/failure and then drive some UI off of that. My only concern there is it's too late to roll the install back and users tend to not read what you put in front of them anyways.
精彩评论