#wine #interface #unix #applications #run #systems #dxvk

wincompatlib

在类Unix系统上使用Wine运行Windows应用程序的接口集合

20个版本 (6个重大更新)

0.7.4 2023年10月20日
0.7.3 2023年6月14日
0.6.1 2023年6月6日
0.4.1 2023年3月18日
0.1.2 2022年9月29日

#197 in Unix APIs

Download history 517/week @ 2024-04-22 88/week @ 2024-04-29 108/week @ 2024-05-06 66/week @ 2024-05-13 147/week @ 2024-05-20 146/week @ 2024-05-27 124/week @ 2024-06-03 78/week @ 2024-06-10 136/week @ 2024-06-17 161/week @ 2024-06-24 270/week @ 2024-07-01 110/week @ 2024-07-08 131/week @ 2024-07-15 123/week @ 2024-07-22 150/week @ 2024-07-29 78/week @ 2024-08-05

每月500次下载
用于 2 crates

MIT 许可证

87KB
1.5K SLoC

🦀 wincompatlib

Rust库,包含一组在类Unix系统上使用Wine运行Windows应用程序的接口

特性

  • 不同的Wine构建版本
  • 可以创建wine前缀并运行应用程序
  • 支持DXVK安装、卸载、应用版本解析(《code>dxvk
  • 具有用于特殊wine构建的包系统(《txt-plain>wine-bundles
  • 支持Proton(《txt-plain>wine-proton
  • 与《code>winetricks集成(同称特性)
  • 可以安装Microsoft Corefonts(《txt-plain>wine-fonts特性)

示例

使用系统wine运行cmd.exe

use wincompatlib::prelude::*;

// Run cmd.exe using system wine
Wine::default().run("cmd");

// Ask for cmd's help
let child = Wine::default().run_args(["cmd", "/c", "help"]).unwrap();

println!("Help: {}", &String::from_utf8_lossy(&child.wait_with_output().unwrap()));

打印wine版本

use wincompatlib::prelude::*;

// Print wine version
println!("Wine version: {:?}", Wine::default().version().unwrap());

使用自定义wine运行cmd.exe,然后停止它

use wincompatlib::prelude::*;

let wine = Wine::from_binary("/path/to/wine");

// Run cmd.exe using custom wine
// and then stop it
wine.run("cmd");
wine.stop_processes(true);

打印DXVK版本

// Requires "dxvk" feature (enabled by default)
use wincompatlib::prelude::*;

match Dxvk::get_version("/path/to/prefix") {
    Ok(Some(version)) => println!("DXVK applied: {}", version),
    Ok(None) => println!("DXVK is not applied"),
    Err(err) => eprintln!("Failed to get DXVK version: {}", err)
}

安装DXVK

// Requires "dxvk" feature (enabled by default)
use wincompatlib::prelude::*;

Wine::default()
    .install_dxvk("/path/to/dxvk-x.y.z", InstallParams::default())
    .expect("Failed to install DXVK");

作者:Nikita Podvirnyy

在《a href="https://github.com/krypt0nn/wincompatlib/blob/dd180fbc222579eb557e48feb1ca8ac5f6bb2e6a/LICENSE" rel="noopener ugc nofollow">MIT 下许可

依赖关系

~2–13MB
~158K SLoC