Archive: MUI_FINISHPAGE_RUN runs the application minimized.


MUI_FINISHPAGE_RUN runs the application minimized.
I have created an installer using the MUI. At the end of the installation, the user is given the option to run the application, using:

---
!define MUI_FINISHPAGE_RUN "$INSTDIR\${MAINPRODUCT_EXE}"
---

This works fine, however the application is run minimized. This is quite annoying; you now first have to select the application in the task bar before you can enter your login credentials. When I start the application by double-clicking the icon of the installed file, it runs normally and you can immediately start typing.

I couldn't find any settings in the MUI manual that would cause the application to run minimized, and also no solutions on this forum. Does anyone have a suggestion?


The only idea - your application stores current main window state in registry on exit and restores this on the next run :)
Can you repeat situation in a short nsi script with any other application (like Notepad.exe)?


Hmm... that was indeed a simple test. Why didn't I come up with that?

Anyway, I've tried it with Notepad and that works excellent. So it seems that our application is the cause of the problem. I'll tell the application developers to fix it. :)

Thanks Takhir.


I've done some more research and I may have found the cause for my problem.

First of all, the application is not minimized, but just hidden in the background behind some other application.

Second, the problem only occurs if I click on the Finish button immediately after the installation has completed. If I wait a little bit while the Finish Page shows, the problem does not occur.

When the problem occurs, the following happens:
After I click the Finish button, the installer starts to run our application and closes down. However, our application does not receive focus, but stays hidden behind one other application. A simple Alt+Tab will give it focus.

My explanation (but I could be terribly wrong with this): During a short amount of time, our application has started, but without a GUI. Windows cannot give focus to it (since there is not yet any visible form), so another application receives focus. When the GUI of our application has started, it does not receive focus any more.

This could also explain why the problem does not occur with Notepad: the loading time of (the GUI of) Notepad is very short (it starts in an instant), so Windows can immmediately give focus to it.

However, I am still puzzled why this does not occur if I wait a little longer on the Finish Page.