Robert Collins wrote: > >>-----Original Message----- >>From: Jehan [mailto:[EMAIL PROTECTED]] >>Sent: Sunday, 14 July 2002 8:18 AM >>To: Robert Collins >>Subject: Re: Bug in startxwin.bat after installing with >>setup.exe in win98SE >> >> >>Robert Collins wrote: >> >>>Nope, it's also generated from mount information. Cygwin could be >>>z:\bar\foo\bar and it would still be correct. >> >>Is there a way then for a program to add (after asking the user) to >>create a shortcut on the desktop/start menu? Is there also way to get >>the information about the installing for "all users" or "just me"? >> >> Jehan > > > Yes to the first, it's a tool in cygutils - Chuck answered the same > question here less than a week ago.
Kool, thanks! I missed that thread. Harold, here is an updated install.sh that will ask the user if he wants a shortcut on the desktop and in the Start menu. Again, this script requires cygutils (for both u2d and mkshortcut now) Jehan
#!/bin/bash BATCH_FILE=/usr/X11R6/bin/startxwin.bat if [ ! -f "${BATCH_FILE}" ]; then ################################ # First part of the batch file cat << EOF > ${BATCH_FILE} @echo off SET DISPLAY=127.0.0.1:0.0 REM REM The path in the CYGWIN_ROOT environment variable assignment assume REM that Cygwin is installed in a directory called 'cygwin' in the root REM directory of the current drive. You will only need to modify REM CYGWIN_ROOT if you have installed Cygwin in another directory. For REM example, if you installed Cygwin in \foo\bar\baz\cygwin, you will need REM to change \cygwin to \foo\bar\baz\cygwin. REM REM This batch file will almost always be run from the same drive (and REM directory) as the drive that contains Cygwin/XFree86, therefore you will REM not need to add a drive letter to CYGWIN_ROOT. For example, you do REM not need to change \cygwin to c:\cygwin if you are running this REM batch file from the C drive. REM EOF ################################ # Get the DOS path to cygwin echo SET CYGWIN_ROOT=`cygpath -w /` >> ${BATCH_FILE} ################################ # Second part of the batch file cat << EOF >> ${BATCH_FILE} SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH% REM REM Cleanup after last run. REM if not exist %CYGWIN_ROOT%\tmp\.X11-unix\X0 goto CLEANUP-FINISH attrib -s %CYGWIN_ROOT%\tmp\.X11-unix\X0 del %CYGWIN_ROOT%\tmp\.X11-unix\X0 :CLEANUP-FINISH if exist %CYGWIN_ROOT%\tmp\.X11-unix rmdir %CYGWIN_ROOT%\tmp\.X11-unix REM REM Startup the X Server, the twm window manager, and an xterm. REM REM Notice that the window manager and the xterm will wait for REM the server to finish starting before trying to connect; the REM error "Cannot Open Display: 127.0.0.1:0.0" is not due to the REM clients attempting to connect before the server has started, rather REM that error is due to a bug in some versions of cygwin1.dll. Upgrade REM to the latest cygwin1.dll if you get the "Cannot Open Display" error. REM See the Cygwin/XFree86 FAQ for more information: REM http://xfree86.cygwin.com/docs/faq/ REM REM The error "Fatal server error: could not open default font 'fixed'" is REM caused by using a DOS mode mount for the mount that the Cygwin/XFree86 REM fonts are accessed through. See the Cygwin/XFree86 FAQ for more REM information: REM http://xfree86.cygwin.com/docs/faq/cygwin-xfree-faq.html#q-error-font-eof REM REM REM Use the /B switch only when we can positively confirm that the OS REM is Windows NT/2000. Do not use the switch in any other case. This REM should work fine, as it assumes we cannot use /B, except when a certain REM criterion is met. A previous version of this batch file assumed that REM we could use /B, except when some criterion was met; needless to say, REM that didn't work. REM if "%OS%" == "Windows_NT" goto USE-B-SWITCH REM Windows 95/98/Me echo startxwin.bat - Starting on Windows 95/98/Me REM Startup the X Server. start XWin REM Startup an xterm, using bash as the shell. run xterm -sl 1000 -sb -ms red -fg gray -bg black -e /usr/bin/bash REM Startup the twm window manager. run twm goto END REM REM Use the /B switch. This starts the specified process in the background; REM in other words, it does not cause a new Command Prompt window to be REM opened for each 'start' command. REM :USE-B-SWITCH REM Windows NT/2000 echo startxwin.bat - Starting on Windows NT/2000 REM Startup the X Server. start XWin REM Startup an xterm, using bash as the shell. run xterm -sl 10000 -sb -ms red -fg gray -bg black -e /usr/bin/bash REM Startup the twm window manager. run twm :END REM Set a background color to comply with FCC regulations :) run xsetroot -solid aquamarine4 EOF ################################ # Convert the file to dos format # and update the permission u2d ${BATCH_FILE} chmod 755 ${BATCH_FILE} fi ################################ # Create Desktop and Start menu icons while /bin/true; do read -p "Do you want to add an icon for Cygwin/Xfree on the Desktop? [y|n] " ANSWER case $ANSWER in y | Y) while /bin/true; do read -p "Do you want the desktop icon to be accessible to all users? [y|n] " ANSWER2 case $ANSWER2 in y | Y) OPTION=--allusers break ;; n | N) OPTION= break ;; esac done /usr/bin/mkshortcut.exe --icon /usr/X11R6/bin/X.ico --desktop --name "Cygwin XFree" ${OPTION} ${BATCH_FILE} break ;; n | N) break ;; esac done while /bin/true; do read -p "Do you want to add an icon for Cygwin/Xfree in the Start/Cygwin menu? [y|n] " ANSWER case $ANSWER in y | Y) while /bin/true; do read -p "Do you want the Start/Cygwin icon to be accessible to all users? [y|n] " ANSWER2 case $ANSWER2 in y | Y) OPTION=--allusers break ;; n | N) OPTION= break ;; esac done /usr/bin/mkshortcut.exe --icon /usr/X11R6/bin/X.ico --smprograms --name "Cygwin/Cygwin XFree" ${OPTION} ${BATCH_FILE} break ;; n | N) break ;; esac done