Is it a MSI project? If yes, then instead of using InstallScript's MessageBox function, try using the MsiProcessMessage function -> http://msdn.microsoft.com/en-us/library/aa370354(v=vs.85).aspx.
If your vbs messagebox will not come forward then I suspect you will have to time it better in your installation so that nothing else in your installation is showing at the time - or hope Flexera addresses this EXTREMELY annoying problem in a patch soon.
You can still use the InstallScript custom action, but instead of using MessageBox function, use MsiProcessMessage.
I believe you are seeing this problem during silent uninstall or uninstall from ARP. Basically in these situations, there is no Msi window available and hence, no handle can be passed to the MessageBox call. Using MsiProcessMessage will overcome this issue.
I hope this helps.
Facing same issue during uninstall in UI mode from Control Panel, the prompt created by messageboxEx is hiding behind the progress bar of uninstall window.
Below is the code of installscript:
STRING ivValue, sgProductPathSE;
STRING svMessage, svTitle;
svSize = 4096;
sgProductPathSE = ivValue ^ "Program" ^ "ABC.exe";
// Wait for 10 seconds
// Find the "MessageBoxResult" window (Which is yet to be created by below syntax)and bring it to the foreground
hSettingsWnd = FindWindow("#32770", @ID_STRING5 + " " + @ID_STRING6);
// Display the message box
MessageBoxResult = MessageBoxEx(@ID_STRING2 + L"\n\n" + @ID_STRING3, @ID_STRING5 + " " + @ID_STRING6, MB_YESNO | MB_ICONEXCLAMATION | MB_TASKMODAL | SetForegroundWindow(hSettingsWnd) );
// Launch the abc.exe application if the user clicked "Yes"
if (IDYES == MessageBoxResult)then
LaunchAppAndWait(sgProductPathSE, "", WAIT);
Can you kindly help me to force a MessageBoxResult to prompted on top of uninstall progressbar?
Could you please try using msiprocessmessage option show the message box. please check below help link.
// To Do: Declare local variables.
hRecord = MsiCreateRecord(1);
TEST = MsiProcessMessage(hMSI, INSTALLMESSAGE_USER|MB_YESNO, hRecord);
if (TEST = IDYES) then
if (TEST = IDNO ) then
Thank You @varul , I'm able to popup the dialog on top of the uninstall progress bar.
One more question, is there any way to provide title to the MsiProcessMessage prompt.
I again appreciate for your quick help.
MessageBox (xxx is not installed. You must install it from the Tech Support CD.", WARNING); // Message box may be hidden behind other more recently active windows
hRec = MsiCreateRecord(1);
nResult = MsiRecordSetString(hRec, 1, szMessage);
nResult = MsiRecordSetString(hRec, 0, "");
lCount = StrLength(szMessage);
nResult = MsiFormatRecord(hMSI, hRec, szOutput, lCount);
// At this point nResult=ERROR_MORE_DATA
nResult = MsiProcessMessage(hMSI,INSTALLMESSAGE_INFO, hRec);
// At this point nResult=1
Then (hWnd)parent should be the MSI dialog
if (NULL == (hWndParent=::FindWindow(_T("MsiDialogCloseClass"), _T("
")))) // full UI
if (NULL == (hWndParent=::FindWindow(_T("#32770"), _T("
")))) // basic UI
LOGERR(_T("FindWindow failed, error ") << GetLastError()); // silent?
Thanks for the clue. I tried using the line below in an InstallScript CA.
MessageBox ("My Message", WARNING|Value);
I substituted various values from
for Value. Most notably I expected to be able to make this work with MB_SETFOREGROUND (0x00010000) but no such luck. I would think something like this could be made to work but I am not getting it. If anyone else has the answer please reply.
Is the messagebox behind the installation or is it application modal, but the more recent windows are over installation(and messagebox)? the system modal flag didn't help?
BTW InstallScript MessageBox calls WINAPI MessageBox, BUT it automatically gives the correct hWnd of the Installation, and I remember there were some issues with mixing IS constants and MS constants in the flags.
Have you also tried to call the (user32.dll) MessageBoxA with the wrapper (Custom Actions->New Standard DLL->Located in search path)?
BTW Please use the values, not the constant names.
I would recommend to put all your logic, all your CAs either in C++(CA native dll) or C# (DTF/WiX). You can debug then such confusing buggy scenarios with MsiBreak and MMsiBreak.
This would not be a problem if we could just do like others and say "Close all other windows". It is really only a problem when the user is navigating through other windows while waiting. The message box then appears behind other windows and there is not even a flashing icon in the task bar.
I have message boxes in other CAs that are 'Deferred Execution In System Context' and they will always pop out to the front. This one is in a CA that is marked for "Immediate Execution'.
The system modal flag didn't help.
I did not mix IS constants and MS constants in the flags.
I have not tried to call the (user32.dll) MessageBoxA with the wrapper (Custom Actions->New Standard DLL->Located in search path) as you suggested.
hRecord = MsiCreateRecord(1);
MsiRecordSetString( hRecord, 0, "Please uninstall Previous msi...");
MsiProcessMessage(hInst, INSTALLMESSAGE_ERROR, hRecord);