Use correct package manager

This commit is contained in:
Mbucari 2023-05-19 11:30:09 -06:00
parent fd510861c6
commit 64d080336c

View File

@ -28,10 +28,13 @@ namespace LinuxConfigApp
public string ReleaseIdentifier => LibationScaffolding.ReleaseIdentifier.ToString() + (File.Exists("/bin/yum") ? "_RPM" : ""); public string ReleaseIdentifier => LibationScaffolding.ReleaseIdentifier.ToString() + (File.Exists("/bin/yum") ? "_RPM" : "");
//only run the auto upgrader if the current app was installed from the //only run the auto upgrader if the current app was installed from the
//.deb package. Try to detect this by checking if the symlink exists. //.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 => Directory.Exists("/usr/lib/libation");
public void InstallUpgrade(string upgradeBundle) public void InstallUpgrade(string upgradeBundle)
{ {
if (File.Exists("/bin/yum"))
RunAsRoot("yum", $"install '{upgradeBundle}'");
else
RunAsRoot("apt", $"install '{upgradeBundle}'"); RunAsRoot("apt", $"install '{upgradeBundle}'");
} }