Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

Window popping up behind installation dialog


We have a Basic MSI project, InstallShield 2008. During uninstallation we are popping up a message box to display an information message to the user. Beginning with Vista and Windows 7 the dialog ends up being hidden behind the installation wizard/progress dialog. As a result the progress bar stops and the user might think the installer is hung, when it is simply waiting for the user to acknowledge our message. The message is so hidden that it only becomes visible after an Alt+Tab. If the user doesn't know it's there, the uninstallation will stuck indefinitely.

I was wondering if there is any workaround for this. We wish to display our message in front of the installation wizard, not behind it.

Our message box is a VBScript type of custom action, Synchronous (Ignores exit code), Deferred Execution, with the following script:
Sub display
MsgBox "Our message.", vbExclamation+vbMsgBoxSetForeground, "Out Title"
End Sub

We are also launching an external application, also from a synchronous custom action. That application, too, launches right behind the install shield wizard. The problem, of course, is that the user can rightfully think the installation is hung.

We experience none of these problems on XP or Windows 2003 Server, only on Vista and Windows 7.

Is there anything we can do to launch our message box and/or application in the front? Would upgrading to InstallShield 2010 help us in any way?

Labels (1)
0 Kudos
(5) Replies
Level 12 Flexeran
Level 12 Flexeran

You should be using MsiProcessMessage (C++, InstallScript, etc.) or Session.Message (VB) to put up a message box. Since this goes through MSI it can parent the message box so it will be shown on top.
0 Kudos
Level 2

Thanks a lot Michael, that worked well. VB Script to pop up a message:
[CODE]Dim record
Const msiMessageTypeUser = &H03000000
Set record = Session.Installer.CreateRecord(1)
record.StringData(0) = "[1]"
record.StringData(1) = "My message"
Session.Message msiMessageTypeUser, record[/CODE]

The external application that I launch, however, is still falling behind the installer window, regardless if I use LaunchAppAndWait from InstallScript, or a "launch executable file" custom action. For example:
LaunchAppAndWait(WINDIR ^ "Notepad.exe", "", WAIT);

One thing that works is if I set the window style in my external application to always on top:
SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);

Not an ideal solution, but better than nothing.

0 Kudos
Level 4

Hi Tamas,
I am running into very similar issue -- where on Vista/Win7 our standard message box during uninstallation stays behind InstallShield's wizard dialog.

I assume you may have solved this issue -- if so, could you please advise? I have posted a separate post regarding this #post464762

0 Kudos
Level 3

I am also facing this problem
Found the article
but to be honest, didn't manage to solve this.
Can anybody from support guys take part in this thread and help. Please?
0 Kudos
Level 11

I ran into this issue once, and found that SetForegroundWindow did not always work on newer OS's. Some investigation was done, and found a different API that appeared to work better, but I wasn't able to fully verify that this was a 100% viable alternative to SetForegroundWindow.

I would recommend testing carefully:

SwitchToThisWindow Function

Ideally, though, Michael is correct. Spawned dialog boxes should be done via MsiProcessMessage. You can change the dialog style by either customizing the SetupError dialog, or by redirecting the error dialog by setting the 'ErrorDialog' property.
0 Kudos