Skip to content

Inscribe Windows resource & manifest files onto your executables

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

AmionSky/winscribe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Winscribe

A build script to create, compile and include Windows resource and manifest files in your executables.

This crate is in early stages of development.

Usage

Add it as a build dependency to your Cargo.toml.

[build-dependencies]
winscribe = "0.1.0"

In your build.rs use ResBuilder to customize your resource file then call .compile() on it to link it to your binary.

use winscribe::icon::Icon;
use winscribe::manifest::{DpiMode, Feature, Manifest};
use winscribe::{ResBuilder, ResError};

fn main() {
    // Only run it if the target is Windows
    if std::env::var("CARGO_CFG_WINDOWS").is_ok() {
        resource().expect("Failed to include resource!");
    }
}

fn resource() -> Result<(), ResError> {
    // Use Cargo's environment variables to fill in some file details
    ResBuilder::from_env()?
        // Add an application icon as a resource
        .push(Icon::app("./assets/application.ico"))
        // Compose a new manifest with DPI awareness and usage of Controls DLL v6
        .push(Manifest::from([
            Feature::DpiAware(DpiMode::PerMonitorV2),
            Feature::ControlsV6,
        ]))
        // Compile and link the resource to the binary
        .compile()
}

Requirements

To compile the resource file a Windows SDK version 10 or later needs to be installed.

Special Thanks

Winscribe started out as a heavily modifed version of:

License

Licensed under either of

at your option.

About

Inscribe Windows resource & manifest files onto your executables

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages