X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:message-id:from:to:subject:date:mime-version
	:content-type:content-transfer-encoding; q=dns; s=default; b=don
	Jj/u2hJgsmGSVTSgtonKn6lt1qe1nAILNuEJmuAgv2lrbNLNJ6MT7W8V3PaSfmDU
	tE3JTb6WYlBTADtdHRqocUNV457eFBu6EG5gPSx0hxhrJEPUdmjMH10m6Dme1gat
	CPTLLNK5qqhl+KOC/7GolF3xPpKDSUlKN5tSviK8=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:message-id:from:to:subject:date:mime-version
	:content-type:content-transfer-encoding; s=default; bh=PDWA3lEkC
	hM+N26WCvWzn0gLhfY=; b=l7/4HhPQ8WXjaGV9IrRz5CMUAdL4LYXqvzQme0jvi
	ixvOOR+abcKTYbNV34RGQCERtxiRJWZvO7Apy0QHN0AB81ACirpcPf16UKYGdXa1
	i1ADeZvn2l+dpuKw9CYQHMYF0NBq8XX0IYo1SQMrsj7FLcALo4CIE0nilE1T54D8
	tc=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-pb0-f53.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20130820;        h=x-gm-message-state:message-id:from:to:subject:date:mime-version         :content-type:content-transfer-encoding:importance;        bh=5QvOoAB9/iwzwdisrHTIMYzMb58bFJBuMFGT7iHaJSw=;        b=dFRllkLj7uTERSg/gk6D2hLUGzT1sUQ+eavY5f9WDKlc9u6yM/w91k6rFrsVb3DNyP         zoPGujx6yPbkeEEDGMTnLpwGKLa8huwgYTSE46f++YFJ69fmMhSmCZBENh70+08jrKbo         7SrZo9Yrxu5E+g1Ja9bVPnoWw4w9/kSql5KsyCzbZlAKeMFapGMgapC2ZVgiowullx3e         5ev4pejVvCUZ1mhvWOhUT2IfHDeHEO+0Lqk+Tw9djNWLVlpnXNsQdx1o10EqNCxVUrQ8         t6AsskoHgtN2EBpVU3Mq1acXQYX7OHOzix1UUXB8mErrim1I3p4fSU+Sxs1TxLyVd/cJ         /mHQ==
X-Gm-Message-State: ALoCoQlY+KpTqbzBMd/kxKrmatI94fakX7zUDqo5MepP7AEEhT8lRxmm3aadgUe7h0b/6FBBHflp
X-Received: by 10.68.196.168 with SMTP id in8mr6662676pbc.132.1394647210432;        Wed, 12 Mar 2014 11:00:10 -0700 (PDT)
Message-ID: <E29840B52F804D728672875F0A8D534E@TKsamsung>
From: "Tony Kelman" <kelman@berkeley.edu>
To: <cygwin@cygwin.com>
Subject: Re: Compiled executables requiring admin rights - different results between MinGW host type
Date: Wed, 12 Mar 2014 11:00:07 -0700
MIME-Version: 1.0
Content-Type: text/plain;	format=flowed;	charset="iso-8859-1";	reply-type=original
Content-Transfer-Encoding: 7bit

> 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

