Strip \\?\ extended-length prefix from Windows resource paths
Node.js module resolver can't handle the \\?\ prefix that Tauri's resource_dir() returns on Windows, causing EISDIR errors. Use dunce to simplify paths before passing them to Node.
This commit is contained in:
Generated
+1
@@ -2633,6 +2633,7 @@ version = "0.1.25"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"dirs",
|
||||
"dunce",
|
||||
"futures-util",
|
||||
"http",
|
||||
"log",
|
||||
|
||||
@@ -24,6 +24,7 @@ tauri-build = { version = "2.5.3", features = [] }
|
||||
[dependencies]
|
||||
base64 = "0.22"
|
||||
dirs = "6"
|
||||
dunce = "1"
|
||||
futures-util = "0.3"
|
||||
http = "1"
|
||||
serde_json = "1.0"
|
||||
|
||||
@@ -560,7 +560,8 @@ fn dev_resource_root() -> PathBuf {
|
||||
}
|
||||
|
||||
fn bundled_runtime_root(app: &AppHandle) -> Result<PathBuf, String> {
|
||||
if let Ok(resource_dir) = app.path().resource_dir() {
|
||||
if let Ok(raw_resource_dir) = app.path().resource_dir() {
|
||||
let resource_dir = dunce::simplified(&raw_resource_dir).to_path_buf();
|
||||
// Tauri's bundle.resources preserves the source directory structure, so
|
||||
// "resources/**/*" in tauri.conf.json places files at
|
||||
// $RESOURCE/resources/managed-runtime/. Try the nested path first (installed
|
||||
|
||||
Reference in New Issue
Block a user