MsgBox from UI Custom Action??? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

vicky
Posts: 66
Joined: Thu Aug 21, 2008 10:52 am

MsgBox from UI Custom Action???

Hi!

I am using AI 6.4.1 and building an enterprise project, I am using windows-XP (SP2). IDE used for customAction.dll is Visual Studio 6.0. I am calling an UI custom Action on 'Next' button of 'Welcome Dialog' , if, certain conditions do not met, i show an error msgbox.

Following is the code to show msgbox:

Code: Select all

HWND hWnd =  FindWindow("MsiDialogCloseClass", "MY Setup");
MessageBox(hWnd, errMsg, "MY Setup", MB_OK|MB_ICONERROR);
I think, it is not a proper way to display error msgs, it could fail in some conditions.
Could anyone help me to find solution to this problem?

Regards,
Vicky
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: MsgBox from UI Custom Action???

Hi Vicky,

I'm afraid that Windows Installer does not offer a simple way of showing a custom error message. Therefore, a custom action seems to be the best approach.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: MsgBox from UI Custom Action???

vicky wrote:I am using AI 6.4.1 and building an enterprise project, I am using windows-XP (SP2). IDE used for customAction.dll is Visual Studio 6.0. I am calling an UI custom Action on 'Next' button of 'Welcome Dialog' , if, certain conditions do not met, i show an error msgbox.
Hello Vicky,

I stumbled over MsiProcessMessage Function recently. (Don't be fooled by the phrase "sends an error" used on that page.)

An equivalent for use in custom actions consisting of scripts is "Session.Message()" if I understand it correctly:

Code: Select all

var msiMessageTypeInfo = 0x04000000;
var rec           = Session.Installer.CreateRecord(1);
rec.StringData(0) = "[1]";
rec.StringData(1) = msg;

Session.Message(msiMessageTypeInfo, rec);


With best regards

Clemens Anhuth

Return to “Common Problems”