fix(updater): linux not retaining AppImage permissions, enhance tests (#1636)

* fix(updater): linux not retaining AppImage permissions, enhance tests

- adds a test for migration from v1 to v2
- extends the existing integration test to actually verify if the app was updated

* remove test framework

* fix macos test

* fix windows

* wait on windows

* fix wix

* typo

* fmt

* install webkit2gtk-4.0 on ci

* fix npm command on windows

* fix test on windows

* ubuntu-22.04

---------

Co-authored-by: Tillmann <28728469+tweidinger@users.noreply.github.com>
This commit is contained in:
Lucas Fernandes Nogueira
2024-08-12 14:59:53 -03:00
committed by GitHub
parent e4e19e001b
commit 7701392500
27 changed files with 5129 additions and 69 deletions
+5 -1
View File
@@ -784,6 +784,8 @@ impl Update {
let tmp_app_image = &tmp_dir.path().join("current_app.AppImage");
let permissions = std::fs::metadata(&self.extract_path)?.permissions();
// create a backup of our current app image
std::fs::rename(&self.extract_path, tmp_app_image)?;
@@ -812,7 +814,9 @@ impl Update {
return Err(Error::BinaryNotFoundInArchive);
}
return match std::fs::write(&self.extract_path, bytes) {
return match std::fs::write(&self.extract_path, bytes)
.and_then(|_| std::fs::set_permissions(&self.extract_path, permissions))
{
Err(err) => {
// if something went wrong during the extraction, we should restore previous app
std::fs::rename(tmp_app_image, &self.extract_path)?;