ostp/ostp-gui/src-tauri/build.rs

31 lines
1.2 KiB
Rust

fn main() {
let mut windows = tauri_build::WindowsAttributes::new();
// Define the manifest with requireAdministrator to allow TUN mode without terminal
// and include Common-Controls v6 for modern UI elements/dialogs.
let 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>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>
"#;
windows = windows.app_manifest(manifest);
tauri_build::try_build(
tauri_build::Attributes::new()
.windows_attributes(windows)
)
.expect("failed to run build script");
}