Schema-Manifest For Your EXE


The example below uses VirtualDub.exe (from here), it is a good example since it uses VC (9.0) so the example below is accurate.

You can make any modifications in the “human-readable” code below,
then click the “minify” button and get the minified version
and download both versions (regular and minifed) as manifest files to your computer.
(if you have a warning at Chrome click “keep”, it is a XML file, completely safe! but it uses the .manifest extension so you could easily uses it, even as a side-by-side-file to your exe or dll…)

You can have it ASCII or UTF-8 encoded (without BOM),
but always uses CR+LF (aka. “\r\n”) end-of-lines,
otherwise you’ll break your exe/dll if it is a resource 24,
and it will do nothing if it is a side-by-side file.
Such a little thing, but with a major impact…

Also, I try my best to make the buttons below help you
download a Windows-compatible (CR+LF EOL) version,
but you’re probably best to open it with Notepad2 or Notepad++
and check to see it is indeed a Windows EOL.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
 Important Notes You Should Read.
 - This file may be encoded as plain-ASCII or UTF-8 (Without a BOM!)
 - This file should be alway using Windows' end-of-line of CR+LF (aka. "\r\n").
   Even if you minify it! If you see an error with "side-by-side" as the cause, this is why!

 - Check http://icompile.eladkarako.com/schema-manifest-for-your-exe/ for the latest version.

 Last updated at August 6, 2017.
-->
<asmv1:assembly xmlns="urn:schemas-microsoft-com:asm.v2" manifestVersion="1.0"
                xmlns:cmpv1="urn:schemas-microsoft-com:compatibility.v1"
                xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
                xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
                xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"
                xmlns:winset2005="http://schemas.microsoft.com/SMI/2005/WindowsSettings"
                xmlns:winset2011="http://schemas.microsoft.com/SMI/2011/WindowsSettings"
                xmlns:winset2016="http://schemas.microsoft.com/SMI/2016/WindowsSettings"
                xmlns:winset2017="http://schemas.microsoft.com/SMI/2017/WindowsSettings"
                xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1"
                xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2"
                xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
                xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd">
<!-- ############################################################################################################################################################## -->
  <!--  name:                   choose to either use a 4-places name such as "Microsoft.Windows.Shell.calc" or simply the file-name such as "calc.exe" (Required).
        processorArchitecture:  choose either one of x86,ia64,amd64 you can also place "*" or remove it, but you can also put (similar to "*"): "msil" which means that the application will "try" to run anyway. It is probably better than any other option. (Optional).
        version:                mmmmm.nnnnn.ooooo.ppppp format, 0-65535 inclusive (Required).
        publicKeyToken:         "0000000000000000" or remove it or use a "16 times Hex-letters (range 0-F)", which is the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed. The public key used to sign the catalog must be 2048 bits or greater. Required for all shared side-by-side assemblies, for the application itself (you can always use "0000000000000000" for the application...)  - (optional).
   -->
  <asmv1:assemblyIdentity type="win32" language="*" culture="*" processorArchitecture="*"
                          name="VirtualDub.exe" version="1.10.4.0"/>
<!-- ############################################################################################################################################################## -->  <!-- good if the "name" in "assemblyIdentity" is class-like, instead of file-name-like. -->
  <entryPoint>
    <assemblyIdentity language="*" culture="*" processorArchitecture="*"
                      name="VirtualDub" version="1.10.4.0" />
    <commandLine file="VirtualDub.exe" parameters="" />
  </entryPoint>

  <file name="VirtualDub.exe" />
<!-- ############################################################################################################################################################## -->
  <asmv1:description asmv2:publisher="Avery Lee"
                     asmv2:product="VirtualDub FilterMod (VirtualDub.exe)"
                     asmv2:supportUrl="https://sourceforge.net/projects/vdfiltermod/">VirtualDub FilterMod (VirtualDub.exe)</asmv1:description>  <!-- can be self closing tag if you don't want to include inside-content for legacy asmv1 -->
<!-- ############################################################################################################################################################## -->
  <asmv3:application>  <!-- see https://msdn.microsoft.com/en-us/library/windows/desktop/aa374191(v=vs.85).aspx -->
    <!-- DPI related -->
    <asmv3:windowsSettings> <winset2005:dpiAware                          >true/PM</winset2005:dpiAware>                        </asmv3:windowsSettings>  <!-- screen's DPI aware (legacy) -->
    <asmv3:windowsSettings> <winset2016:dpiAwareness                      >PerMonitorV2,PerMonitor</winset2016:dpiAwareness>    </asmv3:windowsSettings>  <!-- screen's DPI aware (new with fallback: "PerMonitorePerV2,PerMonitor" to "PerMonitorV2" to "PerMonitor") -->
    <asmv3:windowsSettings> <winset2017:gdiScaling                        >true</winset2017:gdiScaling>                         </asmv3:windowsSettings>  <!-- improve text scaling, adds support for scalling/DPI-awareness for old apps too. -->
    <asmv3:windowsSettings> <winset2011:highResolutionScrollingAware      >false</winset2011:highResolutionScrollingAware>      </asmv3:windowsSettings>
    <asmv3:windowsSettings> <winset2011:ultraHighResolutionScrollingAware >false</winset2011:ultraHighResolutionScrollingAware> </asmv3:windowsSettings>

    <!-- useful+will not break your app - better keep -->
    <asmv3:windowsSettings> <winset2011:printerDriverIsolation            >true</winset2011:printerDriverIsolation>             </asmv3:windowsSettings>  <!-- keep this true, it will make applications more stable if there is any error with printer-driver/spooler. -->
    <asmv3:windowsSettings> <winset2011:disableTheming                    >false</winset2011:disableTheming>                    </asmv3:windowsSettings>
    <asmv3:windowsSettings> <winset2011:magicFutureSetting                >false</winset2011:magicFutureSetting>                </asmv3:windowsSettings>  <!-- undocumented, since it does absolutly nothing (YEP!) you can make it true/false for now by it may apply a different behavior some other time, so just keep it explicitly false unless you'll like your app to stop working some day.  similar to "forbid publisher future policy yes/no". -->

    <!-- mostly not very useful, better keep those false.   most malwares have those "true"... :/  -->
    <asmv3:windowsSettings> <winset2011:autoElevate                       >false</winset2011:autoElevate>                       </asmv3:windowsSettings>
    <asmv3:windowsSettings> <winset2011:disableWindowFiltering            >false</winset2011:disableWindowFiltering>            </asmv3:windowsSettings>  <!-- keep "false", unless this is a remote-desktop or a malware :/ -->
  </asmv3:application>
<!-- ############################################################################################################################################################## -->
  <!-- Limit execution to a minimal-version of the Windows operation-system -->
  <dependency>
    <dependentOS>
      <osVersionInfo supportUrl="https://www.microsoft.com/" description="Microsoft Windows Operating System">
        <os majorVersion="6" minorVersion="1" buildNumber="0" servicePackMajor="0" /> <!-- minimum requirement is OS running Win7 (https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions) -->
      </osVersionInfo>
    </dependentOS>
  </dependency>
<!-- ############################################################################################################################################################## -->
  <!-- allow support for advanced features for future versions. if not used the max is current os-version. -->
  <cmpv1:compatibility>
    <application>
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS> <!-- Windows 10 and Windows Server 2016      -->
      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS> <!-- Windows 8.1 and Windows Server 2012 R2  -->
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS> <!-- Windows 8 and Windows Server 2012       -->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS> <!-- Windows 7 and Windows Server 2008 R2    -->
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS> <!-- Windows Vista and Windows Server 2008   -->
    </application>
  </cmpv1:compatibility>
<!-- ############################################################################################################################################################## -->
  <!-- keep this (will allow window-themes in older applications) -->
  <dependency optional="yes">
    <dependentAssembly dependencyType="preRequisite" allowDelayedBinding="false">
      <assemblyIdentity type="win32" processorArchitecture="*" language="*"
                        name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
<!-- ############################################################################################################################################################## -->
  <!-- remove this, unless the app is a C++ applications. Best set the minimal version or ship the execute with the dll files (get whatever VC-libs from https://github.com/eladkarako/vc-archive/). for production:"CRT"/"MFC", for debug optionally change to: "DebugCRT"/"DebugMFC" .  -->
  <dependency>
    <dependentAssembly dependencyType="preRequisite" allowDelayedBinding="false">
      <assemblyIdentity type="win32" processorArchitecture="*" language="*"
                        name="Microsoft.VC90.CRT" version="9.0.30729.6161" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>

  <dependency>
    <dependentAssembly dependencyType="preRequisite" allowDelayedBinding="false">
      <assemblyIdentity type="win32" processorArchitecture="*" language="*"
                        name="Microsoft.VC90.MFC" version="9.0.30729.6161" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
<!-- ############################################################################################################################################################## -->
  <!-- remove this, example for 'allowDelayedBinding' used for .Net modules to improve loading time. -->
  <dependency>
    <dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
      <assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="4.0.30319.0" />
    </dependentAssembly>
  </dependency>
<!-- ############################################################################################################################################################## -->
  <co.v1:useManifestForTrust xmlns="urn:schemas-microsoft-com:asm.v1" />

  <asmv2:trustInfo>
    <security>
      <asmv3:requestedPrivileges>
        <requestedExecutionLevel level="asInvoker" uiAccess="false" /> <!-- initial request permissions. keep "asInvoker" unless you're a malware.. (requireAdministrator|highestAvailable are preserved for installers and malwares. oneclick-schema only supports starting as "asInvoker". Available values:  asInvoker|requireAdministrator|highestAvailable  -   adding requestedExecutionLevel node will also remove the file/registry-virtualization used for backward-compatibility. -->
      </asmv3:requestedPrivileges>

      <!-- this whole "applicationRequestMinimum" block can be removed, it should allow running/web-access to local intra-net and web without limitations of the new code-execution limit.. -->
      <applicationRequestMinimum>
        <PermissionSet id="FullTrust" Unrestricted="true" />
        <defaultAssemblyRequest permissionSetReference="FullTrust" /> <!-- grant access to run as in the "FullTrust security zone". -->
      </applicationRequestMinimum>
    </security>
  </asmv2:trustInfo>
<!-- ############################################################################################################################################################## -->
</asmv1:assembly>

<!--
#################################################################################################################################
# References                                                                                                                    #
#################################################################################################################################
# "Schema-Manifest For Your EXE": (*check periodically for latest version)                                                      #
#   http://icompile.eladkarako.com/schema-manifest-for-your-exe/                                                                #
# "Application Manifests":                                                                                                      #
#   https://msdn.microsoft.com/en-us/library/windows/desktop/aa374191(v=vs.85).aspx                                             #
# "Schema For Your EXE":                                                                                                        #
#   http://icompile.eladkarako.com/schema-for-your-exe/                                                                         #
# "Manifest Generation in Visual Studio":                                                                                       #
#   https://msdn.microsoft.com/en-us/library/ms235229.aspx                                                                      #
# "Targeting your application for Windows"                                                                                      #
#   https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx                                             #
# "Manifest File Schema"                                                                                                        #
#   https://msdn.microsoft.com/en-us/library/windows/desktop/aa375635(v=vs.85).aspx                                             #
# "Assembly Manifests"                                                                                                          #
#   https://msdn.microsoft.com/en-us/library/windows/desktop/aa374219(v=vs.85).aspx                                             #
# "ClickOnce Application Manifest"                                                                                              #
#   https://msdn.microsoft.com/en-us/library/ws1c2fch.aspx                                                                      #
# "ProcessorArchitecture Enumeration"                                                                                           #
#   https://msdn.microsoft.com/en-us/library/system.reflection.processorarchitecture(v=vs.110).aspx                             #
# "XAML Namespaces and Namespace Mapping for WPF XAML"                                                                          #
#   https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/xaml-namespaces-and-namespace-mapping-for-wpf-xaml           #
#     '..Within the namespace declarations in the root tag of many XAML files,                                                  #
#        you will see that there are typically two XML namespace declarations.                                                  #
#        The first declaration maps the overall WPF client / framework XAML namespace as the default:                           #
#        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"                                                      #
#        The second declaration maps a separate XAML namespace, mapping it (typically) to the x: prefix.                        #
#        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"                                                                 #
#        The relationship between these declarations is that the x: prefix mapping                                              #
#        supports the intrinsics that are part of the XAML language definition,                                                 #
#        and WPF is one implementation that uses XAML as a language and defines a vocabulary                                    #
#        of its objects for XAML. Because the WPF vocabulary's usages will be far more common than                              #
#        the XAML intrinsics usages, the WPF vocabulary is mapped as the default..'                                             #
#     so, "xmlns" vs. "prefix:" are the same! xmlns will override/merge/adds (..more powerful) than "prefix:"                       #
# "<trustInfo> Element (ClickOnce Application)"                                                                                 #
#   https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx                                                                      #
# "Code Access Security"                                                                                                        #
#   https://msdn.microsoft.com/en-us/library/930b76w0(v=vs.90).aspx                                                             #
#   https://msdn.microsoft.com/en-us/library/930b76w0(VS.71).aspx (older for reference..)                                       #
# "Writing DPI-Aware Desktop and Win32 Applications"                                                                            #
#   https://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx                                             #
# "<assemblyIdentity> Element for <runtime>"                                                                                    #
#   https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/assemblyidentity-element-for-runtime   #
# "Runtime Settings Schema"                                                                                                     #
#   https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/index                                  #
# "<assembly> Element (ClickOnce Deployment)"                                                                                   #
#   https://msdn.microsoft.com/en-us/library/b44eddkw.aspx                                                                      #
# "ClickOnce Deployment Manifest"                                                                                               #
#   https://msdn.microsoft.com/en-us/library/k26e96zf.aspx                                                                      #
# "Publishing ClickOnce Applications"                                                                                           #
#   https://msdn.microsoft.com/en-us/library/748fh114.aspx                                                                      #
# "Troubleshooting C/C++ Isolated Applications and Side-by-side Assemblies"                                                     #
#   https://msdn.microsoft.com/en-us/library/ms235342.aspx                                                                      #
# "Scenarios for Deployment Examples"                                                                                           #
#   https://msdn.microsoft.com/en-us/library/aa985617(v=vs.90).aspx                                                             #
#################################################################################################################################
-->

minify…

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><asmv1:assembly xmlns="urn:schemas-microsoft-com:asm.v2" manifestVersion="1.0" xmlns:cmpv1="urn:schemas-microsoft-com:compatibility.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:winset2005="http://schemas.microsoft.com/SMI/2005/WindowsSettings" xmlns:winset2011="http://schemas.microsoft.com/SMI/2011/WindowsSettings" xmlns:winset2016="http://schemas.microsoft.com/SMI/2016/WindowsSettings" xmlns:winset2017="http://schemas.microsoft.com/SMI/2017/WindowsSettings" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd"><asmv1:assemblyIdentity type="win32" language="*" culture="*" processorArchitecture="*" name="VirtualDub.exe" version="1.10.4.0"/><entryPoint><assemblyIdentity language="*" culture="*" processorArchitecture="*" name="VirtualDub" version="1.10.4.0"/><commandLine file="VirtualDub.exe" parameters=""/></entryPoint><file name="VirtualDub.exe"/><asmv1:description asmv2:publisher="Avery Lee" asmv2:product="VirtualDub FilterMod (VirtualDub.exe)" asmv2:supportUrl="https://sourceforge.net/projects/vdfiltermod/">VirtualDub FilterMod (VirtualDub.exe)</asmv1:description><asmv3:application><asmv3:windowsSettings><winset2005:dpiAware >true/PM</winset2005:dpiAware></asmv3:windowsSettings><asmv3:windowsSettings><winset2016:dpiAwareness >PerMonitorV2,PerMonitor</winset2016:dpiAwareness></asmv3:windowsSettings><asmv3:windowsSettings><winset2017:gdiScaling >true</winset2017:gdiScaling></asmv3:windowsSettings><asmv3:windowsSettings><winset2011:highResolutionScrollingAware >false</winset2011:highResolutionScrollingAware></asmv3:windowsSettings><asmv3:windowsSettings><winset2011:ultraHighResolutionScrollingAware >false</winset2011:ultraHighResolutionScrollingAware></asmv3:windowsSettings><asmv3:windowsSettings><winset2011:printerDriverIsolation >true</winset2011:printerDriverIsolation></asmv3:windowsSettings><asmv3:windowsSettings><winset2011:disableTheming >false</winset2011:disableTheming></asmv3:windowsSettings><asmv3:windowsSettings><winset2011:magicFutureSetting >false</winset2011:magicFutureSetting></asmv3:windowsSettings><asmv3:windowsSettings><winset2011:autoElevate >false</winset2011:autoElevate></asmv3:windowsSettings><asmv3:windowsSettings><winset2011:disableWindowFiltering >false</winset2011:disableWindowFiltering></asmv3:windowsSettings></asmv3:application><dependency><dependentOS><osVersionInfo supportUrl="https://www.microsoft.com/" description="Microsoft Windows Operating System"><os majorVersion="6" minorVersion="1" buildNumber="0" servicePackMajor="0"/></osVersionInfo></dependentOS></dependency><cmpv1:compatibility><application><supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS><supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS><supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS><supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS><supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS></application></cmpv1:compatibility><dependency optional="yes"><dependentAssembly dependencyType="preRequisite" allowDelayedBinding="false"><assemblyIdentity type="win32" processorArchitecture="*" language="*" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df"></assemblyIdentity></dependentAssembly></dependency><dependency><dependentAssembly dependencyType="preRequisite" allowDelayedBinding="false"><assemblyIdentity type="win32" processorArchitecture="*" language="*" name="Microsoft.VC90.CRT" version="9.0.30729.6161" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity></dependentAssembly></dependency><dependency><dependentAssembly dependencyType="preRequisite" allowDelayedBinding="false"><assemblyIdentity type="win32" processorArchitecture="*" language="*" name="Microsoft.VC90.MFC" version="9.0.30729.6161" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity></dependentAssembly></dependency><dependency><dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true"><assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="4.0.30319.0"/></dependentAssembly></dependency><co.v1:useManifestForTrust xmlns="urn:schemas-microsoft-com:asm.v1"/><asmv2:trustInfo><security><asmv3:requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"/></asmv3:requestedPrivileges><applicationRequestMinimum><PermissionSet id="FullTrust" Unrestricted="true"/><defaultAssemblyRequest permissionSetReference="FullTrust"/></applicationRequestMinimum></security></asmv2:trustInfo></asmv1:assembly>

Using the manifest can be “side-by-side” or embedding it as resource-24 into the exe or dll,
for more information see: Compile Schema-Manifest For EXE, it includes a trick to update the resources without the need to recompile, or even use any of the official tool.


Download:
manifest_readable.manifest

manifest_minified.manifest

Here is another, more sensible example:
VirtualDub.exe.manifest.

Leave a Reply

  1. Pingback: Manifest