This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in startxwin.bat after installing with setup.exe in win98SE


Nicholas Wourms wrote:
You still have the chicken-and-the egg issue. How is a user going to
startxwin from a console window if /usr/X11R6/bin is not in their path?
Two things:
- For what I understood of the problem, Michael already found the batch file but then, CYGWIN_ROOT was pointing to the wrong drive (or more exactly didn't point to any drive at all) with the end result that cygwin application couldn't find the dll.
My shell script, once run by the installation, create a batch file with an absolute path to cygwin. So when someone runs it, the dll will be found => Michael's problem fixed.
- Correct me if I'm wrong but the batch file is to be run from Explorer or the like, not from a console. If you want to use the console, then use startxwin.sh (assuming that your console is Bash, which, from the rest of your message, seems to be the case)


Obviously, if the user installs these packages, they want to be able to
access them. The answer to this is to make 2 scripts that get installed
in the /etc/profile.d directory by the XFree86-base package. One is for
the tcsh/csh users and the other is for the bash/ash/zsh users. In these
two scripts we establish the following:

1)Add /usr/X11R6/bin to the $PATH
2)Resolve the new environmental CYGWIN_X_ROOT by using the method you
specified above.

Then have the various startxwin scripts employ CYGWIN_X_ROOT, but strip
the PATH setting from them. This way you avoid multiple instances of the
XFree directories in your path. So what about the .bat file you say? Easy, just have it run bash - which then executes the xfree script in
/etc/profile.d, followed by the script startxwin.sh. So my recommendation
is to examine the openssl.csh and openssl.sh scripts in /etc/profile.d for
some examples. You can also look in /etc/profile.d on linux.
Ok, Harold, find attached the two scripts that will add the X path to the PATH environment variable when one starts a shell. That way he/she doesn't have to use the full path for startxwin.sh. The "export PATH" in startxwin.sh can then be removed.

As to have the batch file running Bash which will execute startxwin.sh, two things:
1) that doesn't fix your chicken-and-egg problem, you still have to find the batch file.
2) once you have the batch file, it still have to find Bash!

My little install.sh script fixes 2).

For 1), I know of three solutions:
- what we have currently: have the guy search for the batch, and create a shortcut if he wants to, in a more accesible place (desktop, start menu, whatever). Not ideal, but works ok if documented.
- modify the windows path environment (I'm not found of that) and ask the user to run a command prompt and then startxwin.bat. No better than starting Bash and running startwin.sh (actually worse because we have to globally change the Windows path).
- Create a shortcut to the batch file in the start menu. That would be the best solution except that I don't know how to do it. Cygwin does something like that for cygwin.bat but IIRC it has the cygwin path hardcoded to "C:\cygwin" even if you installed cygwin in "t:\foo\bar".


However, since it is your idea, I don't want to steal your show.
I like to defend my ideas, it satisfies my ego when their chosen over someone else's. But that doesn't mean I don't like people helping me out. Participating to a project/idea doesn't make it your own so have no fear.

Jehan
if ( $?PATH ) then
  setenv PATH "${PATH}:/usr/X11R6/bin"
else
  setenv PATH ":/usr/X11R6/bin"
endif
export PATH="${PATH}:/usr/X11R6/bin"

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