]> Pileus Git - ~andy/gtk/commitdiff
Create and install gtk-update-icon-cache.exe.manifest to avoid UAC
authorTor Lillqvist <tml@iki.fi>
Thu, 8 Oct 2009 12:40:45 +0000 (15:40 +0300)
committerTor Lillqvist <tml@iki.fi>
Fri, 9 Oct 2009 12:13:39 +0000 (15:13 +0300)
gtk/Makefile.am

index 62d5352eea304cb3d14d79ea2ec6cb05e91bd6f8..b6e32cf6a986bada6921d943e794c0b5be1b5418 100644 (file)
@@ -947,8 +947,42 @@ LDADDS =                                                           \
 bin_PROGRAMS = \
        gtk-query-immodules-2.0 \
        gtk-update-icon-cache
+
 bin_SCRIPTS = gtk-builder-convert
 
+if OS_WIN32
+
+# Workaround for UAC silliness: programs with "update" in their name
+# are believed to be installers and require elevated privileges to be
+# used... Use a manifest file to tell Windows that
+# gtk-update-icon-cache.exe doesn't require any special privileges.
+
+GTK_UPDATE_ICON_CACHE_MANIFEST = gtk-update-icon-cache.exe.manifest
+
+bin_SCRIPTS += \
+       $(GTK_UPDATE_ICON_CACHE_MANIFEST)
+
+gtk-update-icon-cache.exe.manifest:
+       (echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' ; \
+        echo '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">' ; \
+        echo '  <assemblyIdentity version="1.0.0.0"' ; \
+        echo '     processorArchitecture="'$(LIB_EXE_MACHINE_FLAG)'"' ; \
+        echo '     name="gtk-update-icon-cache.exe"' ; \
+        echo '     type="win32"/>' ; \
+        echo '  <!-- Identify the application security requirements. -->' ; \
+        echo '  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">' ; \
+        echo '    <security>' ; \
+        echo '      <requestedPrivileges>' ; \
+        echo '        <requestedExecutionLevel' ; \
+        echo '          level="asInvoker"' ; \
+        echo '          uiAccess="false"/>' ; \
+        echo '        </requestedPrivileges>' ; \
+        echo '       </security>' ; \
+        echo '  </trustInfo>' ; \
+        echo '</assembly>' ) >$@
+
+endif
+
 gtk_query_immodules_2_0_DEPENDENCIES = $(DEPS)
 gtk_query_immodules_2_0_LDADD = $(LDADDS)
 
@@ -1267,7 +1301,7 @@ gtk_update_icon_cache_program =                                                   \
 endif
 
 gtkbuiltincache.h: @REBUILD@ stamp-icons
-       $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
+       $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT) $(GTK_UPDATE_ICON_CACHE_MANIFEST)
        $(gtk_update_icon_cache_program) --force --ignore-theme-index           \
           --source builtin_icons stock-icons > gtkbuiltincache.h.tmp &&        \
        mv gtkbuiltincache.h.tmp gtkbuiltincache.h