Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve messageType value for ExternalUI setup with Custom Actions #900

Closed
spinico opened this issue Aug 12, 2020 · 1 comment
Closed

Comments

@spinico
Copy link

spinico commented Aug 12, 2020

Hi,

this is more of an enhancement request for messages sent with session.Message() from a custom action that need user input and a handler implemented in an external UI. Here some context info:

In a custom actions dll, a user input request is made from a method calling session.Message() with a User message type combined to a MessageIcon and a MessageButtons values as follow:

{
...
InstallMessage messageType = InstallMessage.User | (InstallMessage)icon | (InstallMessage)buttons;
return session.Message(messageType, new Record { FormatString = text });    
}

For an external UI, the MSI installation is silent, so no dialog is shown and the display of a message box must be handled by the external UI. The way I currently do this is by overriding the OnMessage(string message, MsiInstallMessage messageType) method to be able to return the user input value. But I noticed that the messageType parameter value get masked and the additional values are discarded on the OnExternalUI() method as shown in https://github.com/oleg-shilo/wixsharp/blob/79607f655edc025100cae51db147282fd40358bc/Source/src/WixSharp.Msi/WixSharp.Msi/MsiSession.cs#L404:

int OnExternalUI(IntPtr context, uint messageType, string message)
{
     MsiInstallMessage msgType = (MsiInstallMessage)(MsiInterop.MessageTypeMask & messageType);
     return OnMessage(message, msgType);
}

So I'm looking for a way to obtain the icons and buttons values set on session.Message(...). One approach would be to make the OnExternalUI() method overridable, another would be to pass the original messageType value to OnMessage() and evaluate the msgType within the OnMessage() method instead. But if there is another way, please let me know.

Thanks for your help.

@oleg-shilo
Copy link
Owner

Very good point.
Will bring the feature to the very next release

oleg-shilo added a commit that referenced this issue Aug 29, 2020
* - Issue #902: candle.exe : error CNDL0125 when building bootstrapper application from existing msi and add bootstrapper variable
* Issue #862: I can't seem to get it working
* Issue #900: Preserve messageType value for ExternalUI setup with Custom Actions
* Merge pull request #899 from Q-Sharp/master
* Added Condition Net48_Installed
* Implemented/fixed `WixEntity.ComponentCondition`. Triggered by "How to add Condition to ODBCDataSource #896 "
* Issue #894: LicenseBootstrapperApplication do not add payloads in case of rtf license
* - Added `Process.StartElevated` extension method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants