jacilore
19th July 2009 22:44 UTC
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.
jacilore
20th July 2009 21:51 UTC
Thank you very much. I will try that
Afrow UK
20th July 2009 22:10 UTC
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
20th July 2009 22:21 UTC
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
jacilore
20th July 2009 22:32 UTC
It worked fine!!. Thanks a lot to all for your help.