Skip to content

Commit 944bf20

Browse files
committed
Potential path fix
1 parent 7a4e2a8 commit 944bf20

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/renutil.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,21 @@ pub async fn install(
703703
);
704704
fs::write(&interface_path, lines.join("\n"))?;
705705

706+
#[cfg(target_family = "windows")]
707+
{
708+
println!("Patching extended path issue in RAPT on Windows");
709+
// On Windows, the RAPT plat.py file has an issue with using extended paths by default.
710+
// This is a problem because Java's classpath does not support them.
711+
// This leads to it not finding the CheckJDK class, leading to an installation failure.
712+
// We crudely patch this by replacing the __file__ variable with a version that removes the extended path prefix.
713+
let plat_path = base_path.join("rapt/buildlib/rapt/plat.py");
714+
let content = fs::read_to_string(&plat_path)?;
715+
fs::write(
716+
&plat_path,
717+
content.replace("__file__", "__file__.replace('\\\\?\\', '')"),
718+
)?;
719+
}
720+
706721
println!("Installing RAPT");
707722
// in versions above 7.5.0, the RAPT installer tries to import renpy.compat
708723
// this is not in the path by default, and since PYTHONPATH is ignored, we

0 commit comments

Comments
 (0)