In the installer, after I selected a different directory it appends "MSN Messenger" to it. This is wrong beheviour. If a user selects a different directory, then you don't have to add yet another subdirectory. Can you change that...
Doing this in a DOS batch file sounds like (excuse my word) crappy. It could be a nice programming exercise, but if you want to do it right, use vbscript at least. In that way you don't need those external programs you use either. Also, don't put choice.com, consoletool.exe, process.exe in the Windows System32 directory, that' a VERY BAD idea. put it into the directory where you installed your loader!!!!!!!!
Anyway, after looking at the actual batchcode (yes I can
):
* Use " when you change to a directory with long filenames, because like you do it now, this will fail in certain situations.
* Anyway, you don't need to change directories to startup a program. This is only needed if the program NEEDS to be in its own directory. Otherwise, it is a bad idea and bound to have problems. Just put the directory before the actual filename.
* This said, if you don't catch the Plus! path from the registry, there is no way in knowing where it is installed on the users computer. (and thus failing in many situations)
* The use of choice to wait a couple of seconds is nice (never used it that way). Although it is not failproof. If the user presses a key during the wait, choice will think that the user just pressed the wrong key and it will halt the delay and waits until the user presses the right key. In otherwords, the script will never continue...
* Like any other loader/program that attemps to kill the Plus! process, it is doing this in a bad way. I mean, what if I startup 1 Messenger without your loader and 1 with your loader. What if I want Windows Messenger and MSN Messenger running at the same time. What if I use another loader like Jnrz's to load MSN Messenger. What if Msgplus is already started before you use the loader, maybe the user doesn't want you to kill plus then, etc... etc...
It isn't as easy as saying: lets start plus, then messenger, after messenger gots terminated, kill plus. The best method to detect if plus can be killed is to use polling and check if there is no instance left of msn messenger and/or windows messenger. But you can't do that with a batchfile.
Note: I realy don't see why you should hide your code.
1) the user can't change the paths
2) the user doesn't have any control on what's happening
3) the code isn't special at all, just your basic, start this, start that...
Also, read these threads:
http://shoutbox.menthix.net/showthread.php?tid=17884
http://shoutbox.menthix.net/showthread.php?tid=19095
http://shoutbox.menthix.net/showthread.php?tid=21619
PS: some things to improve:
* Catch the installation directory of plus in the registry. (this can be done within a batchfile, although again this isn't a good idea)
* Check if the programs you use (even msgplus.exe and all) actually exist before launching them
I'll send you the corrected batchfile as it is now (without the registry checking and file existance checking). Even though doing this with a batchfile is a bad idea to begin with... sorry...