{"id":15422557,"url":"https://github.com/heaths/msica-rs","last_synced_at":"2025-07-14T04:04:49.230Z","repository":{"id":52917657,"uuid":"520809227","full_name":"heaths/msica-rs","owner":"heaths","description":"Rust for Windows Installer Custom Actions","archived":false,"fork":false,"pushed_at":"2024-06-18T22:04:21.000Z","size":73,"stargazers_count":3,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-29T12:43:10.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heaths.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-03T09:04:52.000Z","updated_at":"2025-04-14T17:54:16.000Z","dependencies_parsed_at":"2024-10-20T04:28:23.865Z","dependency_job_id":null,"html_url":"https://github.com/heaths/msica-rs","commit_stats":{"total_commits":30,"total_committers":3,"mean_commits":10.0,"dds":0.06666666666666665,"last_synced_commit":"5b7ce2fb5b15200e42404c5dbce9b13bd89bd24e"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/heaths/msica-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fmsica-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fmsica-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fmsica-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fmsica-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heaths","download_url":"https://codeload.github.com/heaths/msica-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fmsica-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265238315,"owners_count":23732602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T17:38:55.635Z","updated_at":"2025-07-14T04:04:49.178Z","avatar_url":"https://github.com/heaths.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust for Windows Installer Custom Actions\n\n[![latest version](https://img.shields.io/crates/v/msica?logo=rust)](https://crates.io/crates/msica)\n![build status](https://github.com/heaths/msica-rs/actions/workflows/ci.yml/badge.svg?event=push)\n\nWriting [custom actions] for [Windows Installer] (MSI) can be difficult enough already,\nbut using Rust can help mitigate some potential issues concerning memory and handle leaks.\n\nThese APIs roughly mimic the Windows Installer [automation interface] for those APIs\nthat can be called in immediate and deferred custom actions.\n\n## Example\n\nYou can define custom actions in Rust using its [foreign function interface][ffi] like:\n\n```rust\nuse msica::prelude::*;\n\nconst ERROR_SUCCESS: u32 = 0;\nconst ERROR_INSTALL_FAILURE: u32 = 1603;\n\n#[no_mangle]\npub extern \"C\" fn MyCustomAction(session: Session) -\u003e u32 {\n    match Record::with_fields(\n        Some(\"this is [1] [2]\"),\n        vec![\n            Field::IntegerData(1),\n            Field::StringData(\"example\".to_owned()),\n        ],\n    ) {\n        Ok(record) =\u003e {\n            session.message(MessageType::User, \u0026record);\n            ERROR_SUCCESS\n        }\n        _ =\u003e ERROR_INSTALL_FAILURE,\n    }\n}\n```\n\n### Using nightly feature\n\nIf you enable the `nightly` feature and use the nightly toolchain, you can use the question mark operator (`?`) to\npropagate errors:\n\n```rust\nuse msica::prelude::*;\n\n#[no_mangle]\npub extern \"C\" fn MyCustomAction(session: Session) -\u003e CustomActionResult {\n    let record = Record::with_fields(\n        Some(\"this is [1] [2]\"),\n        vec![Field::IntegerData(1), Field::StringData(\"example\".to_owned())],\n    )?;\n    session.message(MessageType::User, \u0026record);\n    Success\n}\n```\n\n## License\n\nThis project is licensed under the [MIT license](https://github.com/heaths/msica-rs/blob/main/LICENSE.txt).\n\n[automation interface]: https://docs.microsoft.com/windows/win32/msi/automation-interface\n[custom actions]: https://docs.microsoft.com/windows/win32/msi/custom-actions\n[ffi]: https://doc.rust-lang.org/nomicon/ffi.html\n[Windows Installer]: https://docs.microsoft.com/windows/win32/msi/about-windows-installer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheaths%2Fmsica-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheaths%2Fmsica-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheaths%2Fmsica-rs/lists"}