msica 0.2.0

Rust for Windows Installer Custom Actions
docs.rs failed to build msica-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: msica-0.4.1

Rust for Windows Installer Custom Actions

latest version build status

Writing custom actions for Windows Installer can be difficult enough already, but using Rust can help mitigate some potential issues concerning memory and handle leaks.

These APIs roughly mimic the Windows Installer automation interface for those APIs that can be called in immediate and deferred custom actions.

Example

You can define custom actions in Rust using its foreign function interface like:

use msica::*;

const ERROR_SUCCESS: u32 = 0;

#[no_mangle]
pub extern "C" fn MyCustomAction(h: MSIHANDLE) -> u32 {

    let session = Session::from(h);
    let record = Record::with_fields(
        Some("this is [1] [2]"),
        vec![Field::IntegerData(1), Field::StringData("example".to_owned())],
    );
    session.message(MessageType::User, &record);

    ERROR_SUCCESS
}

License

This project is licensed under the MIT license.