Add a way to explicitly specify RC toolkit path (#18402)

Closes #18393 

Release Notes:

- Added a `ZED_RC_TOOLKIT_PATH` env variable so `winresource` crate can fetch the RC executable path correctly on some configurations
This commit is contained in:
0hDEADBEAF 2024-09-30 10:34:44 +02:00 committed by GitHub
parent 707ccb04d2
commit 57ad5778fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 0 deletions

View file

@ -56,6 +56,13 @@ fn main() {
println!("cargo:rerun-if-changed={}", icon.display());
let mut res = winresource::WindowsResource::new();
// Depending on the security applied to the computer, winresource might fail
// fetching the RC path. Therefore, we add a way to explicitly specify the
// toolkit path, allowing winresource to use a valid RC path.
if let Some(explicit_rc_toolkit_path) = std::env::var("ZED_RC_TOOLKIT_PATH").ok() {
res.set_toolkit_path(explicit_rc_toolkit_path.as_str());
}
res.set_icon(icon.to_str().unwrap());
res.set("FileDescription", "Zed");
res.set("ProductName", "Zed");