This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: Postinstall for mintty fails when installing "just for me"

On 17 August 2010 02:26, Buchbinder, Barry wrote:
> $ bash --norc --noprofile /etc/postinstall/
> /bin/mkdir: cannot create directory `/c/Documents and Settings/All Users/Start Menu/Programs/Cygwin': Permission denied
> mkshortcut: Saving "C:\Documents and Settings\All Users\Start Menu\Programs\Cygwin\mintty.lnk" failed; does the target directory exist?
> /bin/chmod: cannot access `/c/Documents and Settings/All Users/Start Menu/Programs/Cygwin/mintty.lnk': No such file or directory
> echo $?
> 1

Hmm, the test at the top of the script is meant to avoid that, by
checking whether the 'All Users/Start Menu/Programs' folder is
writable. Any idea why that's saying yes when apparently it isn't

Is there a proper way for a postinstall script to find out whether
it's an install for all users or "Just Me"?

Here's the script for reference:

PROGS=$(/bin/cygpath -AP)
if [ -w "$PROGS" ]; then
  /bin/mkdir -p "$PROGS/Cygwin"
  /bin/mkshortcut -AP -n Cygwin/mintty -a - -d Terminal /bin/mintty.exe
  /bin/chmod a+r "$PROGS/Cygwin/mintty.lnk"
  /bin/mkdir -p "$(/bin/cygpath -P)/Cygwin"
  /bin/mkshortcut -P -n Cygwin/mintty -a - -d Terminal /bin/mintty.exe


Problem reports:
Unsubscribe info:

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