This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cygwin OpenSSH ssh-agent on Win2000


Dear David,
	I haven't tried to do what you're doing, but possibly what I've
done will be of use to you.  I wanted a script to start explorer.exe on a
Windows 95 machine.  Here's what I did:

1. edit system.ini, and change the shell= line under the [boot] section.
This will probably be "explorer.exe".  You could set this to whatever you
want to run instead of explorer.exe (which can then start explorer.exe
itself), but there's one catch: explorer.exe checks this line to see if
it's the login shell.  It does this by seeing if the basename of the first
word is "explorer.exe", and if it is, it will bring up the task bar,
desktop, etc., otherwise it'll just show your "Windows Explorer" window.
My solution to this problem is to make a copy of start.exe called
"explorer.exe".  Explorer doesn't check the parameters, so here's my line:

shell=d:\usr\local\lib\winlogin\explorer.exe d:\usr\local\bin\winlogin.pif

winlogin.pif runs a batch file.  It'd be nice if it was a bash script, but
if you run the real Explorer from a cygwin app, that tty stays associated
with Explorer, and if you have any console apps that are run via context
menus in Explorer (e.g. a "Command Prompt Here" option when you
right-click a folder), most of the output from 16-bit and all of the
output from 32-bit apps will go to the tty you launched Explorer from, not
the console that was opened for the app.  I tried all sorts of ways to
dissociate the tty from Explorer: both 16 and 32-bit console and GUI apps
that execute Explorer, but I still couldn't get around this problem.  For
some strange reason, console apps run any other way (i.e. by opening them
in a folder or selecting them from the Start Menu) weren't affected.
Shame I'm so used to being able to right-click and pick "MS-DOS" or
"bash"..

2. Now you have to make the batch file.  You can run bash scripts from
here if you like, but it has to be the batch file that executes Explorer.
If you want to set environment variables, you have to use "winset" (came
with the Windows 95 resource kit) or else (off the top of my head) all
console apps won't see the variables.  However, if you use winset,
Explorer won't see the variables, and neither will non-console apps, so
the easiest solution is to use winset and then start explorer in this way:

start /m %COMSPEC% /c c:\windows\explorer.exe

Doing that creates a new console window with new environment variables set
by winset (the console you use winset in won't see the effects of winset)
so that Explorer can see them.

I guess that's about it.  As I said, this was for Windows 95, so it might
be easier, or be done completely differently, on NT/2000.  I've never
looked for a system.ini on an NT machine, so I don't even know if they
have them.  Even if this does work, I guess you'd have to do a bit of work
to adapt ssh-agent to work with the batch file and use winset to set
environment variables.

Good luck!
DOS

> Does anyone know how to start the explorer.exe process from ssh-agent when
> you log into an NT/2000 system?
> 
> I'm trying to do the same as "ssh-agent /etc/X11/xinit/xclients" to make the
> ssh agent available to all programs through the environment variables.
> 
> >From within a cygwin bash shell I can do "exec ssh-agent bash" (followed by
> ssh-add) and have everything work from that shell, but of course the
> variables don't exist in any other shells.
> 
> It would seem like having ssh-agent launch explorer when you log in would
> work, but I don't know what to tweak where in the registry.


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]