#3338 session.Message in C# with MessageButtons.RetryCancel shows incorrect button texts

v4.0
migrated
nobody
None
2014-08-24
2013-07-08
mfm
No

When creating a custom action in C# which only shows a message box with Retry and Cancel button the output is a dialog with two buttons with same label "Close" in both, but with correct behavior.
If you create a custom action in C++ that only shows a message box and it is executed before this C# custom action, then the C# code works perfectly.

Here is the affected C# code:

[CustomAction]
public static ActionResult CustomAction1(Session session)
{
    session.Log("Begin CustomAction1");

    Record record = new Record();
    record.FormatString = "Message";
    session.Message(InstallMessage.User |
        (InstallMessage)MessageButtons.RetryCancel, record);

    return ActionResult.Success;
}
1 Attachments

Discussion

  • mfm
    mfm
    2013-07-08

    The correct behavior only works if the C++ fails. If the C++ succeeds, then the same error occurs in both custom actions.

     
  • mfm
    mfm
    2013-07-08

    The buffer content in both calls (the one that works and the one that doesn't) is the same:
    1) Handle to MSI: 0x00000005
    2) Message Type: 0x03000005
    3) Handle to Record: 0x0000000a

     
  • Rob Mensching
    Rob Mensching
    2013-08-21

    • Status: open --> migrated