The PortableApps launchers already get the process id in order to monitor for the process close to do cleanup. The launchers also already support getting and passing arguments.
I would like to suggest that the launchers support a /exit argument which if received would use the same close process command that windows uses when shutting down.
This would allow menu apps like PAM/PStart/ASuite to close the applications when the menu is closed. Assuming the functionality will be added to PAM eventually.
You are here
Portable Apps Launchers Suggestion
May 11, 2007 - 12:18pm
#1
Portable Apps Launchers Suggestion
the ProcessID is stored? Or in which variable?
Then I think it would be definitely possible.
I wish I knew.
It has to be storing it somewhere though, else how does it know which process to wait for to finish running and do the cleanup?
-----------------------------------------------------------------------------------------------
Because they stand on a wall and say nothing is going to hurt you tonight. Not on my watch.
"Because they stand on a wall and say, 'Nothing is going to hurt you tonight. Not on my watch.'" (A Few Good Men)
Coincidence is God's way of remaining anonymous.(Albert Einstein)
is a built-in windows API function. (a shell command of some sort) But I'm not too sure about that.
I haven't studied the portable template, but i tested a nsis script once that unpacked the contents of the launcher in a directory, the run the file (using shellexecute - the file was a html) and it erased it after the file was closed. I suspected that the portable app tmplate uses the same functionality. But i can't be shure of it as i haven't studied the temnplate script. As for the Launcher, it closes even if one of the portable app is running. The windows menu command "Safely remove hardware" refuses to execute (with a coresponding message in a baloon tip) when the exe (the package) is still in memory. Its sad that it doesn't close when i start to remove my thumbdrive, but its understandable
The process, i susspect, works like this:
- the package (launcher) sets the environment
- it copies the files in the corresponding directories
- it runs the exe (that was copied on the hdd in the previous step)
- and after the exe closes it resets the environment to its previous state
- it copies the files back on the thumbdrive from the corresponding directories (including newly created files)
- its shuts down
If it doesn't act exactly this way, than it does in a similar way, according to this lines of behaviour