1

Wix CustomAction [C#] session.Message(Messagebox) is not displayed during installation.

I have a Session.Message added in my custom action,

public static ActionResult DisplayConfirmationMessage(Session session) { 
    Record record = new Record(); 
    record.FormatString = pMessage; 
    Session.Message(InstallMessage.Error 
            | (InstallMessage)System.Windows.Forms.MessageBoxIcon.Warning 
            | (InstallMessage)System.Windows.Forms.MessageBoxButtons.OK, record); 
}

And in wxs file custom action

<CustomAction Id="RestartAction" BinaryKey="CustomActions" DllEntry="DisplayMessage" Execute="immediate" Return="check" />

and in install execute (only one custom action call):

<InstallExecute>
<Custom Action="RestartAction" After="InstallFinalize"></Custom>     
</InstallExecute>

the message box is displayed only at time of uninstall. But during installation it is getting logged to session.Log.
I have checked with 'NOT Installed AND NOT REMOVE' still same results.

I am blocked on this, please help.
Thank you in advance.

Greg Domjan
  • 13,943
  • 6
  • 43
  • 59
Nomita
  • 51
  • 4
  • Depending on when you're scheduling your action, this may be addressed by http://stackoverflow.com/questions/3494101/wix-c-sharp-custom-action-logging-not-working/3503257 – Michael Urman Feb 05 '16 at 13:05
  • You should edit the question to show your custom action declarations and when it is called (if Michael's comment doesn't apply). – PhilDW Feb 05 '16 at 18:56
  • [CustomAction] public static ActionResult DisplayConfirmationMessage(Session session) { Record record = new Record(); record.FormatString = pMessage; Session.Message(InstallMessage.Error | (InstallMessage)System.Windows.Forms.MessageBoxIcon.Warning | (InstallMessage)System.Windows.Forms.MessageBoxButtons.OK, record); } this is my custom action method. this is my customaction call Message pops up only at time of installation not on un-installation – Nomita Feb 19 '16 at 09:38

0 Answers0