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

Return value of Custom Action

Hi!

I am using AI-6.4 and building an enterprise project. My custom action dll is regular MFC DLL.

In a situation, i am checking if Edit control of a dialog is empty, then i display a error message and want to remain on that dialog until user enters any valid text in Edit control or cancel the installation process.
What error code should i return to MSI , so that, i can be remain on that dialog?

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

Re: Return value of Custom Action

Hi Vicky,

The error code of the custom action should be 0, otherwise the installation will be stopped. Please note that the User Guide contains the Make sure an edit box is not empty how-to which may help you.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
vicky
Posts: 66
Joined: Thu Aug 21, 2008 10:52 am

Re: Return value of Custom Action

Hi Cosmin!

Zillion thanks for ur reply. I did return 0 from my custom action but still next dialog get appeared.
Following is the code:

Code: Select all

UINT __stdcall MyFunc(MSIHANDLE hModule )
{
...............
...............
	if (MsiGetProperty(hModule, "DLGEDIT_PROP", szvalue, &cchValue)
		 == ERROR_SUCCESS)
		 strEditBoxVal = szvalue;

	if(strEditBoxVal.GetLength() ==0 )
	{
		msg = "Please specify valid text.";
                AfxMessageBox(msg, MB_OK|MB_ICONERROR);
		return 0;//return zero to remain at the dialog
	}
................
..............
	return ERROR_SUCCESS;
}
Regards,
Vicky
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Return value of Custom Action

Hi Vicky,

Please note that you also need to condition the "NewDialog" control event which shows the next dialog. Please check the how-to I mentioned for more details.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”