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
每月500次下载
用于 2 crates
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");
在《a href="https://github.com/krypt0nn/wincompatlib/blob/dd180fbc222579eb557e48feb1ca8ac5f6bb2e6a/LICENSE" rel="noopener ugc nofollow">MIT 下许可
依赖关系
~2–13MB
~158K SLoC