-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
electron-updater rpm, unable to automatically update #7569
Comments
I wan to contribute to this project, can I have any issue assigned ? |
if you do take this up, please change the ordering of prompts since pkexec is guaranteed on any distro where flatpak is present unlike kdesudo and gksudo which can't be found on most distros eg opensuse & arch has neither |
@Lunarequest That's awesome you're trying out the Beta autoupdate feature for rpm! I've never seen that error before. Why is the output coming out to @msaad7777 I assigned the ticket to you. Let me know if you need any help getting set up. |
I have no idea, not sure what its trying to call afaik spawnsync should run some command. (Note I am running OpenSuse which uses zypper which may affect this, there are some things if it could be done would be cool. RPMs currently hardcode deps to fedora names considering Opensuse/SLE is the biggest distro that uses rpm outside of the RHEL ecosystem would it be possible to also create rpms for it?) |
Have the same issue on ubuntu 22.04 |
It seems releted to stdio: "inherit" Removing this parameter fixes the problem |
@bukharin would you be willing to open a PR with that change? |
I've patched my downstream electron-updater to test the proposed change and can confirm it works |
Thanks @mmaietta, now update is working. But we also need ability to relaunch app after update. Now user need to start app manully after update is installed |
I'm not sure if there's a way to just restart the app via command line. In my other project, I was just calling this after the update completed
But that was because I couldn't tap into electron-updater events/callbacks with that project and still needed to use a C++ module for handling dmg installations. Can you give this a
|
Yes, it works! (tested on Ubuntu). As a workaround for that may handle Chould you make a PR for this fix also? |
@bukharin released 24.5.2 (electron-updater@6.1.3) |
I've tested that auto-update functions correctly with both .appimage and .deb formats. However, I'm encountering issues with .rpm files. When a new version is available, it gets downloaded, but it doesn't seem to install correctly. As a result, the application restarts using the old version and notifies me that a new version has been downloaded again and again. Any suggestions will be really appreciated. I'm using
code snippet import { app, dialog } from "electron";
import { autoUpdater as electronAutoUpdater } from "electron-updater";
import * as log from "electron-log";
export const autoUpdater = electronAutoUpdater;
export const initializeAutoUpdater = () => {
console.log("Initialize auto updater")
autoUpdater.on("checking-for-update", () => {
log.info("Checking for updates...");
});
autoUpdater.on("update-not-available", (info: any) => {
log.info("You are on the latest version.");
});
autoUpdater.on("error", (err) => {
log.info("An error occurred. Error details: " + err);
});
autoUpdater.on("update-available", (info: any) => {
const dialogOpts = {
type: "info",
buttons: ["Ok"],
title: "Update Available",
message: "A new version download started.\nThe app will be restarted to install the update.",
};
dialog.showMessageBox(dialogOpts);
});
autoUpdater.on("download-progress", (progressObj: any) => {
let log_message = "Download speed: " + progressObj.bytesPerSecond;
log_message = log_message + ' - Downloaded ' + progressObj.percent + '%';
log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')'
log.info(log_message);
});
autoUpdater.on("update-downloaded", (info: any) => {
const dialogOpts = {
type: "info",
buttons: ["Restart", "Later"],
title: "Application Update",
message: "A new version has been downloaded.\nRestart the application to apply the updates.",
};
dialog.showMessageBox(dialogOpts).then((returnValue) => {
log.info("LOG: " + returnValue.response);
if (returnValue.response === 0) autoUpdater.quitAndInstall();
});
});
}; |
electron-updater: 6.1.0
When i run the outputted app it has a notification like expected, when you close the app it crashes with this output
I would also like to request the order of the gui elevation prompt order to use pkexec first. This command is what i used based on the log
which gksudo || which kdesudo || which pkexec || which beesu
pkexec should come first as gksudo and kdesudo are not present in most distros as the linux world has moved towards pkexec due to standardization across desktop environments. (pkexec also uses de specific prompts meaning it doesn't look out of place on whatever de you are using)The text was updated successfully, but these errors were encountered: