delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/06/03/20:26:29

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: "Yaakov (Cygwin/X)" <yselkowitz AT users DOT sourceforge DOT net>
Subject: Re: UAC .manifest files
Date: Wed, 03 Jun 2009 19:25:13 -0500
Lines: 152
Message-ID: <h074af$kjd$1@ger.gmane.org>
References: <4A25FA67 DOT 4050805 AT users DOT sourceforge DOT net> <20090603081102 DOT GI23519 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2
In-Reply-To: <20090603081102.GI23519@calimero.vinschen.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------090404020901070308070808
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 03/06/2009 03:11, Corinna Vinschen wrote:
> I never saw more than exactly this list.

Got it (and with "instal" with one L).

> I don't know if it matters, but it certainly doesn't hurt either.  As a
> suggestion, when automating this, the name could be constructed like
> this:
>
>    Organization=Cygwin
>    Division=<packagename>
>    Name=<executable>

As for why, IIRC you mentioned[1] before that the manifests are cached; 
I suppose the name= attribute would be used in the cached data, hence 
the requirement to be unique.

Some additional googling revealed that you also mentioned that the 
manifests need to be executable[2].

The attached patch is what I have in mind.  It won't apply to SVN trunk 
yet due to other uncommitted patches in the queue, but I need to fix 
that soon to get a long-overdue release out the door.  Anything else 
that I may not be aware of before I commit this?

[1] http://www.cygwin.com/ml/cygwin/2008-11/msg00163.html
[2] http://www.cygwin.com/ml/cygwin-apps/2008-08/msg00148.html


Yaakov

--------------090404020901070308070808
Content-Type: text/plain;
 name="0.9.6-uac-manifest.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0.9.6-uac-manifest.patch"

Index: bin/cygport.in
===================================================================
--- bin/cygport.in	(revision 6306)
+++ bin/cygport.in	(working copy)
@@ -1123,6 +1156,7 @@
 #	__prepinfo
 #	__prepman
 #	__prepstrip
+#	__prepuac
 #	__prepvargames
 #	__prep_empty_dirs
 #	__prep_libtool_modules
@@ -1371,13 +1419,8 @@
 
 	# *.so: Apache2 modules, OCaml stublibs, Ruby modules
 	# *.oct: Octave modules
-	for exe in $(find * -type f -name '*.dll' -o -name '*.exe' -o -name '*.so' -o -name '*.oct')
+	for exe in $(find * -type f -writable -a \( -name '*.dll' -o -name '*.exe' -o -name '*.so' -o -name '*.oct' \))
 	do
-		if [ ! -w ${exe} ]
-		then
-			continue
-		fi
-
 		# OCaml bytecode must not be stripped
 		# this test generates false positives with the ocaml core and
 		# compilers, but should otherwise be accurate
@@ -1404,6 +1447,29 @@
 	done
 }
 
+__prepuac() {
+	local exe exename;
+
+	cd ${D};
+
+	echo "Preparing executables for UAC:";
+
+	for exe in $(find * -type f -executable -a \( -name '*instal*.exe' -o -name '*patch*.exe' -o -name '*setup*.exe' -o -name '*update*.exe' \))
+	do
+		exename=${exe##*/};
+
+		# Mono assemblies may already include .manifest files.
+		if [ ! -e ${exe}.manifest ]
+		then
+			echo "        ${exe}";
+			sed -e "s|@PKGNAME@|${PN//.}|" \
+				-e "s|@APPNAME@|${exename%.exe}|" \
+				${_privdatadir}/uac-manifest.in > ${exe}.manifest
+			chmod +x ${exe}.manifest
+		fi
+	done
+}
+
 __prep_symlinks() {
 	local l l_src
 
@@ -1443,12 +1504,13 @@
 	__prepvargames;
 	__prep_empty_dirs;
 	__prepstrip;
+	__prepuac;
 	__prep_libtool_modules;
 }
 
 # protect functions
 readonly -f __prepdoc __prepetc __prepman __prepinfo __prepvargames __prep_empty_dirs \
-            __prepstrip __prep_symlinks __prep_libtool_modules __src_postinst
+            __prepstrip __prepuac __prep_symlinks __prep_libtool_modules __src_postinst
 
 
 ################################################################################
Index: data/Makefile.am
===================================================================
--- data/Makefile.am	(revision 6446)
+++ data/Makefile.am	(working copy)
@@ -1,4 +1,8 @@
-dist_pkgdata_DATA = cygport.nanorc mirrors sample.cygport
+dist_pkgdata_DATA = \
+	cygport.nanorc	\
+	mirrors			\
+	sample.cygport	\
+	uac-manifest.in
 
 bashcompletiondir = /etc/bash_completion.d
 dist_bashcompletion_DATA = cygport-bash-completion
Index: data/uac-manifest.in
===================================================================
--- data/uac-manifest.in	(revision 0)
+++ data/uac-manifest.in	(revision 0)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+  <assemblyIdentity version="1.0.0.0"
+     processorArchitecture="X86"
+     name="Cygwin DOT  AT PKGNAME@.@APPNAME@"
+     type="win32"/>
+
+  <!-- Identify the application security requirements. -->
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+    <security>
+      <requestedPrivileges>
+        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+</assembly>


--------------090404020901070308070808
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--------------090404020901070308070808--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019