mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-09-11 07:55:34 +03:00
This commit is contained in:
parent
261d1bc9d4
commit
597c98203c
5
.changes/sidecar-wix-ids.md
Normal file
5
.changes/sidecar-wix-ids.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": patch
|
||||
---
|
||||
|
||||
Use `Bin_${sidecarFilename}` as the `Id` of sidecar file on WiX so you can reference it in your WiX fragments.
|
@ -853,6 +853,7 @@ fn generate_binaries_data(settings: &Settings) -> crate::Result<Vec<Binary>> {
|
||||
let mut binaries = Vec::new();
|
||||
let cwd = std::env::current_dir()?;
|
||||
let tmp_dir = std::env::temp_dir();
|
||||
let regex = Regex::new(r"[^\w\d\.]")?;
|
||||
for src in settings.external_binaries() {
|
||||
let src = src?;
|
||||
let binary_path = cwd.join(&src);
|
||||
@ -861,7 +862,7 @@ fn generate_binaries_data(settings: &Settings) -> crate::Result<Vec<Binary>> {
|
||||
.expect("failed to extract external binary filename")
|
||||
.to_string_lossy()
|
||||
.replace(&format!("-{}", settings.target()), "");
|
||||
let dest = tmp_dir.join(dest_filename);
|
||||
let dest = tmp_dir.join(&dest_filename);
|
||||
std::fs::copy(binary_path, &dest)?;
|
||||
|
||||
binaries.push(Binary {
|
||||
@ -870,7 +871,9 @@ fn generate_binaries_data(settings: &Settings) -> crate::Result<Vec<Binary>> {
|
||||
.into_os_string()
|
||||
.into_string()
|
||||
.expect("failed to read external binary path"),
|
||||
id: format!("I{}", Uuid::new_v4().as_simple()),
|
||||
id: regex
|
||||
.replace_all(&dest_filename.replace('-', "_"), "")
|
||||
.to_string(),
|
||||
});
|
||||
}
|
||||
|
||||
@ -883,7 +886,9 @@ fn generate_binaries_data(settings: &Settings) -> crate::Result<Vec<Binary>> {
|
||||
.into_os_string()
|
||||
.into_string()
|
||||
.expect("failed to read binary path"),
|
||||
id: format!("I{}", Uuid::new_v4().as_simple()),
|
||||
id: regex
|
||||
.replace_all(&bin.name().replace('-', "_"), "")
|
||||
.to_string(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,7 @@
|
||||
</Component>
|
||||
{{#each binaries as |bin| ~}}
|
||||
<Component Id="{{ bin.id }}" Guid="{{bin.guid}}" Win64="$(var.Win64)">
|
||||
<File Id="Path_{{ bin.id }}" Source="{{bin.path}}" KeyPath="yes"/>
|
||||
<File Id="Bin_{{ bin.id }}" Source="{{bin.path}}" KeyPath="yes"/>
|
||||
</Component>
|
||||
{{/each~}}
|
||||
{{#if enable_elevated_update_task}}
|
||||
|
Loading…
Reference in New Issue
Block a user