You are here

Execwait problem when calling launcher within launcher

6 posts / 0 new
Last post
concept303
Offline
Last seen: 8 years 4 months ago
Joined: 2015-03-03 17:53
Execwait problem when calling launcher within launcher

Hello all,

I have recently started with PAF development and quickly stumbled upon this problem after my first 10 or so portables.
Please note that I do not use the launcher and ini files, I write straight NSI scripts.

The problem happens with a game which has 2 exes A and B. A acts as a launcher that launches B and then exits. The game does not allow you to start immediately from B. If you try, you get an error message indicating that you should start the game by double clicking A.exe.

I guess you can see the problem.
If I use EXECWAIT on A.exe, then A.exe will launch B.exe (the game) and itself will quit which will make my nsi script continue and try to backup portable settings and restore local settings while the actual game (B.exe) is still running.

How do you account for such a case? Is there a way, within NSIS, to make the NSI script wait until a certain process quits (in our case B.exe) before it continues with its flow?

Concept303

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 11 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Code

You need to code a loop to keep checking if the second EXE is still running. We recommend using the PA.c Launcher... and, in fact, no longer create new launchers ourselves... as PAL already has this functionality built in. Along with lots of other features.

https://portableapps.com/manuals/PortableApps.comLauncher/ref/launcher.i...

Sometimes, the impossible can become possible, if you're awesome!

concept303
Offline
Last seen: 8 years 4 months ago
Joined: 2015-03-03 17:53
Thanks for the heads up

Thanks for the heads up John.

I opted for writing my own nsi scripts because it appears that PAL development has stalled for a while, and it also had some problem dealing with redirection when a 32bit process was writing to a 64bit computer registry.

It definitely is very useful for situations like these though.

I wonder if you could point me out to how it is possible to write such a loop myself in an nsi script.

Best Regards,
Concept303

concept303
Offline
Last seen: 8 years 4 months ago
Joined: 2015-03-03 17:53
To answer my own second

To answer my own second request, after running into the issue with yet another software and searching a good while on the net.

An easy way to do this waiting loop is to use this line at an appropriate place in the script (after execwait for the launcher has been ran):

FindProcDLL::WaitProcEnd "mymainexe.exe" -1

I also found out the FindProcDLL packaged with NSISPortable does not work correctly and had to download the modified plugin from here:
http://forums.winamp.com/showthread.php?p=2777729 and drop it into the Plugins folder of NSISPortable.

Hope this helps someone.

BR

DrBarbie
Offline
Last seen: 9 years 9 months ago
Joined: 2015-03-04 21:30
Code Interpreter

I am told that with Note++ it will interpreter my text into Python code. I need to know if this is true. And can someone help me get setup. Thanks

DrBarbie

Wm ...
Offline
Last seen: 7 years 11 months ago
Joined: 2010-07-17 12:37
Python Script for Notepad++

is mainly for writing scripts to control NPP itself

see http://npppythonscript.sourceforge.net/

Wm

Log in or register to post comments