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: Compiled executables requiring admin rights - different results between MinGW host type


You won't believe it, but yes!  Welcome to the wonderful world of
UAC installer detection!!!1!11

I get the impression you've been frustrated by this one before...

See http://msdn.microsoft.com/en-us/library/bb530410.aspx
and scroll down to the section called "Installer Detection".

I'll wait while you read...

[..."whistling while you work"...]

Finished?  Fine.  So, the only fault of your application is it's name.
It's called "something-with-patch-in-it".  As everybody knows, an
application which is called "something-with-patch-in-it" is an
installer and needs elevation.  But only if it's a 32 bit application.

Wow. Thank you tremendously for this explanation Corinna. How bizarre.

- Take one of the manifest files you find in Cygwin's /usr/bin dir,
  and copy it alongside your binary, for instance:

    $ cp /usr/bin/patch.exe.manifest ./stringpatch.exe.manifest

That did the trick. In 64 bit Cygwin the only .manifest file I found in
/usr/bin was install-info.exe.manifest (apparently from texinfo package),
but that worked. Makes sense that 64 bit Cygwin wouldn't need as
many of these, but my primary use case where I'm running into this
issue is cross-compiling from 64 bit Cygwin to i686-w64-mingw32.

- Wait until the next binutils version is released (should be in the
  next couple of days), and link your executable with the new linker.
  This will give you a default manifest integrated in your executable
  by default, which doesn't only claim compatibility with all existing
  WIndows versions, but also sets the RequestedExecutionLevel to
  "asInvoker", which avoids the elevation for this executable entirely.

Don't the various MinGW cross compilers have their own binutils? I look
forward to this being the most convenient long-term solution, (renaming
could also work, but that pull request is going to result in some confused
looks and/or raised eyebrows) but will this need to come from upstream
(MinGW.org for i686-pc, or MinGW-w64 for i686-w64) to change the default
no-manifest-file behavior for any of the hosts besides 32 bit Cygwin?

-Tony


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      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]