Skip to content

Commit

Permalink
fix integration test on Linux finally
Browse files Browse the repository at this point in the history
  • Loading branch information
amr-crabnebula committed Nov 17, 2023
1 parent 61eb846 commit 522ef21
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions crates/updater/tests/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,35 @@ fn main() {
..Default::default()
},
);
if std::env::var("UPDATER_FORMAT").unwrap_or_default() == "nsis" {
// /D sets the default installation directory ($INSTDIR),
// overriding InstallDir and InstallDirRegKey.
// It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.
// Only absolute paths are supported.
// NOTE: we only need this because this is an integration test and we don't want to install the app in the programs folder
builder = builder.installer_args(vec![format!(
"/D={}",
std::env::current_exe().unwrap().parent().unwrap().display()
)]);
let format = std::env::var("UPDATER_FORMAT").unwrap_or_default();

match format.as_str() {
"nsis" => {
// /D sets the default installation directory ($INSTDIR),
// overriding InstallDir and InstallDirRegKey.
// It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.
// Only absolute paths are supported.
// NOTE: we only need this because this is an integration test and we don't want to install the app in the programs folder
builder = builder.installer_args(vec![format!(
"/D={}",
std::env::current_exe().unwrap().parent().unwrap().display()
)]);
}
#[cfg(any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
"appimage" => {
if let Some(p) = std::env::var_os("APPIMAGE") {
builder = builder.executable_path(p);
}
}
_ => {}
}

let updater = builder.build().unwrap();

println!("{version}");
Expand Down

0 comments on commit 522ef21

Please sign in to comment.