🐛 Fix ico copy problem under Windows

This commit is contained in:
Tw93
2025-08-22 10:02:57 +08:00
parent f5016da19d
commit 8a15e989b0
3 changed files with 15 additions and 4 deletions

View File

@@ -224,7 +224,13 @@ StartupNotify=true
} else {
const iconPath = path.join(npmDirectory, 'src-tauri/', iconInfo.path);
tauriConf.bundle.resources = [iconInfo.path];
await fsExtra.copy(options.icon, iconPath);
// Avoid copying if source and destination are the same
const absoluteIconPath = path.resolve(options.icon);
const absoluteDestPath = path.resolve(iconPath);
if (absoluteIconPath !== absoluteDestPath) {
await fsExtra.copy(options.icon, iconPath);
}
}
if (updateIconPath) {