On 10/4/06, Phillip J. Eby
Ah crap. I wonder if there's any way to tell whether you're the only process on a particular console? That would fix this, I guess. There's a GetConsoleProcessList() API, but it doesn't even work on Win2K as far as I can tell; a minimum of XP is required. :(
Further Googling shows that many other people with more Windows savvy than me have tried going this path and failed -- apparently the only way to find out who your parent process is is an undocumented function in ntdll. :(
Yes, I've seen a lot of people attempt to do this sort of thing, and they have always, in my experience, fallen short of their goals in some way. Ultimately, you're trying to fight a fundamental behaviour of the OS (the basic distinction between console-mode and GUI-mode executables). I've come to the conclusion long ago that you should always work *with* the system, rather than fighting it, whether that's Unix, Windows, or something else entirely. You can get very close sometimes (witness cygwin, for example) but you'll never paper over all the cracks.
Why not just have the second executable with a simple to type name (easy_installw, say) and suggest people type *that* in the Run window? Keep it simple!
That doesn't solve the problem for other Python console scripts; It'd be ideal if I could solve this in the .exe launcher itself.
You see this as a problem to be solved, I see it as a behaviour to be understood, accepted, and worked with :-) Paul.