shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Application is launched in the background(Windows 7 problem)

Hi,

I have created a setup which would "launch application at the end of the installation" which is configured using the "ExitDialog". On Windows 7(32 bit) operating system, it launches the application. But this goes to the background.

Reproduction steps
1) Keep the Internet explorer open
2) Click on the Setup.exe
3) At the end of the installation, make sure that "Launch application" is checked. click on "Finish"
When the application is launched, it is hidden behind the Internet Explorer.

Note: this works fine on Windows XP

Regards,
Rohan
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Application is launched in the background(Windows 7 prob

Hi Rohan,

Please keep in mind that this is the normal behavior.

Starting with Windows Vista the background applications that display a window do not display it in foreground not to spam the user.

As a workaround, you can take a look on the How can I bring a window to the foreground in Vista using C++? article.

Best regards,
Eusebiu
Last edited by Eusebiu on Fri Dec 21, 2012 10:28 am, edited 1 time in total.
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Application is launched in the background(Windows 7 prob

I guess, I am facing the different problem. May be I will explain this(in Win7)
1) scenario 1:
In the setup script, I uncheck "Launch application checked by default", then build.
During the execution of the script, I check "Launch Application" checkbox. In this case application is opened in the foreground
2) scenario 2:
In the setup script, I check "Launch application checked by default", then build.
During the execution of the script, I do not change anything and just click on "finsih" button. In this case application is opened in the background
3) scenario 3:
In the setup script, I check "Launch application checked by default", then build.
During the execution of the script, I uncheck and then check "Launch Application" checkbox. In this case application is opened in the foreground

I guess, when the ExitDialog appears, if I perform some operation(e.g. click on the checkbox) then the application is launched in the foreground
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Application is launched in the background(Windows 7 prob

Hi,

As I told before Windows decides if an application is launched in foreground or in background.

You can take a look on the How to open window in foreground thread.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Application is launched in the background(Windows 7 prob

Ok thanks :-)

As a workaround I would uncheck "Launch application checked by default" in the setup.
So, during the installation, user has to check the "Launch Application" checkbox. In this case application always opens in the forground.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Application is launched in the background(Windows 7 prob

You're welcome. I'm glad that workaround works for you.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ashley.Donaldson
Posts: 3
Joined: Fri Mar 01, 2013 6:33 am

Re: Application is launched in the background(Windows 7 prob

I'm not sure I understand this statement:
Eusebiu wrote:Please keep in mind that this is the normal behavior.

Starting with Windows Vista the background applications that display a window do not display it in foreground not to spam the user.
Could you please explain this further, or link me to a Microsoft page where this is explained? I don't understand why Vista/Win7 forces applications to be launched behind their parent.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Application is launched in the background(Windows 7 prob

Hi,

I found many discussion forums talking about this problem. You can read about it in the following threads: Windows Vista/7 and application opening in front and new browser window always open in background.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ashley.Donaldson
Posts: 3
Joined: Fri Mar 01, 2013 6:33 am

Re: Application is launched in the background(Windows 7 prob

Thanks for your response.

While the second article you linked to does fix the problem, I'm sure you can appreciate that we can't ask all our customers to edit their registry before installing our software.

The first article says that:
Window Vista and above do not allow background applications to bring themselves to focus unless the foreground application tells Windows to do so.
(Emphasis mine)

This is exactly the confusing thing, though: Isn't the installer the foreground application? Why can't it bring another application to the front?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Application is launched in the background(Windows 7 prob

Hi,

This problem has been analyzed in multiple forum threads. The following one mentions an alternative solution to our Finish Actions support:

http://www.advancedinstaller.com/forums ... 231#p49220

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”