Here you go:
http://glynor.com/files/MCUtilities/MC-Wait_for_Alive_to_Launch-1030.zipEDIT:
See below for usage updates for current version.
TO USE:
1. Download and extract the ZIP file, which will give you a VB script file (vbs).
2. Open the file in a text editor (notepad.exe is fine) and edit the stuff in the User Defined Variables section of the script.
3. Run the script instead of launching MC directly. If asked what to launch it with, you want to choose the
Microsoft Windows Based Script Host (wscript.exe) application.
The stuff you have to modify is this part, and should be pretty straightforward:
' ************************************************************************************************************
' USER DEFINED VARIABLES
' ************************************************************************************************************
' You need to modify the values below to point to the server you want to use with this script.
' The Server Address
const strServerAddress = "SERVERADDRESS:PORT"
' EXAMPLES
' const strServerAddress = "myserver.mynetwork.com:52199"
' const strServerAddress = "192.168.3.200:52199"
' Authentication
const enableAuthentication = 1 ' Set to zero to disable authentication support
const strUsername = "USERNAME"
const strPassword = "PASSWORD"
' MC Version for launching, or COM to use the most-recently launched version of MC
const launcherType = "cl"
' If you want to use MCcl.exe (part of MCUtilities) specify "cl".
' More info on MCcl.exe: http://blog.glynor.com/mccl/
' If you want to use a specific one of the standard MC Command Line Launchers, just specify the major version
' If you want to use the COM launcher (which loads the most-recently-used version of MC) specify "com"
' EXAMPLES
' const launcherType = 21 ' This will always launch MC21
' const launcherType = "cl" ' This will use MCcl.exe to load the version you saved using it.
' const launcherType = "COM" ' This will use COM to launch the most-recently-launched version.
' If you need to change the default MC command line launch command, do it here.
const launchCommand = "/Start"
' If you want a longer timeout before it gives up, increase this. Each loop waits approximately 20 seconds before trying again.
const maxLoops = 6
' If you want it to launch MC anyway when it gives up, then set this to 1.
const launchEvenWhenFailed = 0
' END USER DEFINED VARIABLES
' ************************************************************************************************************
' ************************************************************************************************************
By default, it'll wait around 2 minutes before it gives up. If it gives up, it'll show you an error.
A few things worth noting:
* This requires Media Network to be enabled on the SERVER (somewhat obviously) and, because I was lazy, requires it to have a Username and Password set.
* If you run yours without authentication for some reason, it should be possible to modify it, but I was too lazy to look that part up and add in checking code.
* You DO have to edit the script to specify the version of MC that you are using. Meaning, it doesn't solve this:
it involves me remembering to do it 12-18 months after setting it up; which is unlikely. I would rather find some solution which I can setup now, and not have to deal with ever again (short of nuke/pave the OS).
I know, I'm being picky, but I know myself, and I'll pull my hair out for hours trying to remember why it's not working next year, so I'd rather have no solution than face the hours of frustration of not remembering later
There's not a clean way to solve that. MC doesn't provide a non-version-specific launcher. I could, I suppose, code this to launch MC via COM (which wouldn't require the launcher) but that could have weird side effects when you are "between versions" and that seems to be a tough pill to swallow. Plus, it is a pain to do and I'm doing this for free (and already spent like 4 hours on it).
The issue is, if I do it via COM, then it'll launch whichever version of MC was last-used on the system. (Actually, technically, it would launch whichever version has the COM component registered, which is what it is doing that causes you to get the UAC prompt when you switch back and forth between versions of MC). This could certainly work, but it might make the script do "unexpected things" to you when the next big version of MC comes out.
Seems like it is better for you to write yourself a note.
EDIT: Immediately after posting this, I thought of something else. I bumped it to 1.0.1 and added a little feature to let you more easily change the mcXX.exe command it sends when it succeeds (defaults to /start) in the User Defined Variables section. The original is gone now never to be spoken of again. If you happened to grab it in the 10 minutes I had it up, then delete it and get the new one instead.