cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bjnelson62
Level 2

Logging during validation of UI (DoAction)

I have a Basic MSI installer that has some wizard pages, 2 of which need validation via external tools that I launch. All that is working fine.

My problem is that to do the validation, I launch the Custom Action to do the validation via DoAction in the Dialogs section.

When a problem occurs with the external tool, I want to log the information. I've written InstallScript code to do that, but nothing comes out.

After much searching, I found that there's an MSI limitation on this in that SprintfMsiLog and MsiProcessMessage don't work in a custom action launched via DoAction.

I did find that one could log via VBScript Session.Message.

1. Is there a way to replicate what VB does in InstallScript? I'd prefer not to have two different languages in there.

2. If there isn't a solution to #1, how do I setup and create the VBScript custom action, and call it from the InstallScript? I found some VB code to do what I want, but when I add the file to the project, InstallShield doesn't seem to notice it. It's not compiled. I've been unable to find a set of steps that tells one how to create a VBScript custom action (this isn't a custom action that will be run separately, rather it's code that will be called from my InstallScript custom actions to do the logging).

3. if there's no solution to #2, then am I simply stuck with writing the information to *another* file, and telling the user about it? That's clearly not ideal.

Thank you,

Brian
Labels (1)
0 Kudos
(1) Reply
MichaelU
Level 12 Flexeran
Level 12 Flexeran

That's correct; the ability to log is somehow provided to VBScript actions, and to no others when executing a custom action off of a DoAction control event. All I know are hackish workarounds, such as using the property change logging as a surrogate for a real message (e.g. MsiSetProperty(hInstall, "CAMSG", "Frobbed the widget"); ... MsiSetProperty(hInstall, "CAMSG", "Reticulated Splines"); )

You should be able to cross-call another action by calling MsiDoAction (or equivalent in other languages). I don't know if a DoAction control event CA invoking a VB action will allow the VB action to log or not, however in order for it to know what to log, you'll have to set a property, which brings you to the above hackish workaround already.
0 Kudos