fixed wix assets path (#3763)

This commit is contained in:
Klemen authored and GitHub committed 2025-02-24 12:08:48 -08:00
1 parent bdeedc13eb
commit eff2e5d18e
1 file changed
+11 -7
+11 -7
View File
@@ -3,6 +3,7 @@ use anyhow::{anyhow, Context};
use path_absolutize::Absolutize; use path_absolutize::Absolutize;
use std::collections::HashMap; use std::collections::HashMap;
use tauri_bundler::{BundleBinary, BundleSettings, PackageSettings, SettingsBuilder}; use tauri_bundler::{BundleBinary, BundleSettings, PackageSettings, SettingsBuilder};
use walkdir::WalkDir;
use super::*; use super::*;
@@ -187,16 +188,18 @@ impl Bundle {
let asset_dir = bundle.build.asset_dir(); let asset_dir = bundle.build.asset_dir();
if asset_dir.exists() { if asset_dir.exists() {
let asset_dir_entries = std::fs::read_dir(&asset_dir) for entry in WalkDir::new(&asset_dir) {
.with_context(|| format!("failed to read asset directory {:?}", asset_dir))?; let entry = entry.unwrap();
for entry in asset_dir_entries.flatten() { let path = entry.path();
let old = entry
.path() if path.is_file() {
let old = path
.canonicalize() .canonicalize()
.with_context(|| format!("Failed to canonicalize {entry:?}"))?; .with_context(|| format!("Failed to canonicalize {entry:?}"))?;
let new = PathBuf::from("assets").join(old.file_name().expect("Filename to exist")); let new =
tracing::debug!("Bundled asset: {old:?} -> {new:?}"); PathBuf::from("assets").join(path.strip_prefix(&asset_dir).unwrap_or(path));
tracing::debug!("Bundled asset: {old:?} -> {new:?}");
bundle_settings bundle_settings
.resources_map .resources_map
.as_mut() .as_mut()
@@ -204,6 +207,7 @@ impl Bundle {
.insert(old.display().to_string(), new.display().to_string()); .insert(old.display().to_string(), new.display().to_string());
} }
} }
}
for resource_path in bundle_settings.resources.take().into_iter().flatten() { for resource_path in bundle_settings.resources.take().into_iter().flatten() {
bundle_settings bundle_settings