Fix rpm upgrade

This commit is contained in:
Mbucari 2023-05-19 15:05:19 -06:00
parent 9372a7318b
commit 824f65baae
2 changed files with 22 additions and 17 deletions

View file

@ -29,11 +29,11 @@ namespace LinuxConfigApp
//only run the auto upgrader if the current app was installed from the
//.deb or .rpm package. Try to detect this by checking if the symlink exists.
public bool CanUpgrade => Directory.Exists("/usr/lib/libation");
public bool CanUpgrade => File.Exists("/bin/libation");
public void InstallUpgrade(string upgradeBundle)
{
if (File.Exists("/bin/yum"))
RunAsRoot("yum", $"install '{upgradeBundle}'");
RunAsRoot("yum", $"install -y '{upgradeBundle}'");
else
RunAsRoot("apt", $"install '{upgradeBundle}'");
}