fix: create installer from resources executable

This commit is contained in:
Federico Terzi 2022-08-28 22:34:02 +02:00
parent c93b52e9a0
commit 6a5e3175e0

View File

@ -61,7 +61,7 @@ fn main() {
let espanso_toml = espanso_toml_str let espanso_toml = espanso_toml_str
.parse::<Value>() .parse::<Value>()
.expect("unable to parse Cargo.toml"); .expect("unable to parse Cargo.toml");
let arch = envmnt::get_or_panic("BUILD_ARCH"); let arch = envmnt::get_or_panic("BUILD_ARCH");
let arch = if arch == "current" { let arch = if arch == "current" {
std::env::consts::ARCH std::env::consts::ARCH
@ -111,13 +111,10 @@ fn main() {
.to_string_lossy() .to_string_lossy()
.to_string(), .to_string(),
); );
iss_setup = iss_setup.replace( iss_setup = iss_setup.replace("{{{output_name}}}", &format!("{}-{}", INSTALLER_NAME, arch));
"{{{output_name}}}",
&format!("{}-{}", INSTALLER_NAME, arch),
);
iss_setup = iss_setup.replace( iss_setup = iss_setup.replace(
"{{{executable_path}}}", "{{{executable_path}}}",
&dunce::canonicalize(&format!("{}.exe", envmnt::get_or_panic("EXEC_PATH"))) &dunce::canonicalize(&resources_dir.join("espansod.exe"))
.unwrap() .unwrap()
.to_string_lossy() .to_string_lossy()
.to_string(), .to_string(),