mod.rs |
A builder for Windows application manifest XML files.
This module allows the construction of application manifests from code with the
[`ManifestBuilder`], for use from a Cargo build script. Once configured, the builder
should be passed to [`embed_manifest()`][crate::embed_manifest] to generate the
correct instructions for Cargo. For any other use, the builder will output the XML
when formatted for [`Display`], or with [`to_string()`][ToString]. For more
information about the different elements of an application manifest, see
[Application Manifests][1] in the Microsoft Windows App Development documentation.
[1]: https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests
To generate the manifest XML separately, the XML can be output with `write!` or
copied to a string with [`to_string()`][ToString]. To produce the manifest XML with
extra whitespace for formatting, format it with the ‘alternate’ flag:
```
# use embed_manifest::new_manifest;
let builder = new_manifest("Company.OrgUnit.Program");
assert_eq!(format!("{:#}", builder), r#"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
<assemblyIdentity name="Company.OrgUnit.Program" type="win32" version="1.4.0.0"/>
<dependency>
<dependentAssembly>
<assemblyIdentity language="*" name="Microsoft.Windows.Common-Controls" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" type="win32" version="6.0.0.0"/>
</dependentAssembly>
</dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<maxversiontested Id="10.0.18362.1"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<asmv3:application>
<asmv3:windowsSettings>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2</dpiAwareness>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
<printerDriverIsolation xmlns="http://schemas.microsoft.com/SMI/2011/WindowsSettings">true</printerDriverIsolation>
</asmv3:windowsSettings>
</asmv3:application>
<asmv3:trustInfo>
<asmv3:security>
<asmv3:requestedPrivileges>
<asmv3:requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</asmv3:requestedPrivileges>
</asmv3:security>
</asmv3:trustInfo>
</assembly>"#.replace("\n", "\r\n"))
``` |
34245 |
test.rs |
|
4076 |
xml.rs |
|
4464 |