Skip to content
⌘ NSIS Forum Archive

Help needed to call main program at foreground

6 posts

jacilore#

Help needed to call main program at foreground

Hi all:

I have what I hope is a very basic question, but I haven't been able to solve it by myself so I ask for your kind help.

I have created a NSIS installer using the Assistant, but the problem I have is that the call to the main aplication (TIMETUNNEL.EXE) makes it always being executed at background. (I cannot see it if there are other Windows opened unless I begin to close windows.)

As I understand it's always predefined in the MACRO MUI_FINISHPAGE_RUN "$INSTDIR\TIMETUNNEL.exe",

so, how could I tell the installer to execute it at foreground as the Active Window?

Thanks anticipated.
jpderuiter#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
Afrow UK#
Just a note. That will put your installer into an infinite loop if the user chooses not to run your app. Using a For loop would be more desirable:

${For} $R0 1 10
FindWindow $R1 `` `my app title`
${If} ${Cmd} `IsWindow $R1`
System::Call `user32::SetForegroundWindow(i R0)`
${Break}
${EndIf}
Sleep 1000
${Next}
Stu
jacilore#
Thanks a lot. I'm trying your code, AfroUK. Actually the other one gave some errors while compiling.

I will write in 10 minutes to tell the result.

Regards