pub struct WindowsAttributes { /* private fields */ }
Expand description
Attributes used on Windows.
Implementations§
Source§impl WindowsAttributes
impl WindowsAttributes
Sourcepub fn new_without_app_manifest() -> Self
pub fn new_without_app_manifest() -> Self
Creates the default attriute set wihtou the default app manifest.
Sourcepub fn window_icon_path<P: AsRef<Path>>(self, window_icon_path: P) -> Self
pub fn window_icon_path<P: AsRef<Path>>(self, window_icon_path: P) -> Self
Sets the icon to use on the window. Currently only used on Windows.
It must be in ico
format. Defaults to icons/icon.ico
.
Sourcepub fn app_manifest<S: AsRef<str>>(self, manifest: S) -> Self
pub fn app_manifest<S: AsRef<str>>(self, manifest: S) -> Self
Sets the [application manifest] to be included with the application on Windows.
Defaults to:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
§Warning
if you are using tauri’s dialog APIs, you need to specify a dependency on Common Control v6 by adding the following to your custom manifest:
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
§Example
The following manifest will brand the exe as requesting administrator privileges. Thus, every time it is executed, a Windows UAC dialog will appear.
let mut windows = tauri_build::WindowsAttributes::new();
windows = windows.app_manifest(r#"
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
"#);
let attrs = tauri_build::Attributes::new().windows_attributes(windows);
tauri_build::try_build(attrs).expect("failed to run build script");
Note that you can move the manifest contents to a separate file and use include_str!("manifest.xml")
instead of the inline string.
Trait Implementations§
Source§impl Debug for WindowsAttributes
impl Debug for WindowsAttributes
Auto Trait Implementations§
impl Freeze for WindowsAttributes
impl RefUnwindSafe for WindowsAttributes
impl Send for WindowsAttributes
impl Sync for WindowsAttributes
impl Unpin for WindowsAttributes
impl UnwindSafe for WindowsAttributes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more