RPM build

This commit is contained in:
Mbucari 2023-05-17 15:08:24 -06:00
parent 7586f7a159
commit d6fe3013ab
12 changed files with 242 additions and 33 deletions

View file

@ -330,7 +330,18 @@ namespace AppScaffolding
//Download the release index
var bts = await gitHubClient.Repository.Content.GetRawContent(ownerAccount, repoName, ".releaseindex.json");
var releaseIndex = JObject.Parse(System.Text.Encoding.ASCII.GetString(bts));
var regexPattern = releaseIndex.Value<string>(ReleaseIdentifier.ToString());
string regexPattern;
try
{
regexPattern = releaseIndex.Value<string>(InteropFactory.Create().ReleaseIdentifier);
}
catch
{
regexPattern = releaseIndex.Value<string>(ReleaseIdentifier.ToString());
}
var regex = new System.Text.RegularExpressions.Regex(regexPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase);
//https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release

View file

@ -16,6 +16,7 @@ namespace LibationFileManager
Process RunAsRoot(string exe, string args);
void InstallUpgrade(string upgradeBundle);
bool CanUpgrade { get; }
string ReleaseIdentifier { get; }
}
public class WebViewNavigationEventArgs : EventArgs

View file

@ -15,6 +15,7 @@ namespace LibationFileManager
public void SetFolderIcon(string image, string directory) => throw new PlatformNotSupportedException();
public void DeleteFolderIcon(string directory) => throw new PlatformNotSupportedException();
public bool CanUpgrade => throw new PlatformNotSupportedException();
public string ReleaseIdentifier => throw new PlatformNotSupportedException();
public Process RunAsRoot(string exe, string args) => throw new PlatformNotSupportedException();
public void InstallUpgrade(string updateBundle) => throw new PlatformNotSupportedException();
}

View file

@ -1,4 +1,5 @@
using LibationFileManager;
using AppScaffolding;
using LibationFileManager;
using System.Diagnostics;
namespace LinuxConfigApp
@ -24,6 +25,8 @@ namespace LinuxConfigApp
public void SetFolderIcon(string image, string directory) => throw new PlatformNotSupportedException();
public void DeleteFolderIcon(string directory) => throw new PlatformNotSupportedException();
public string ReleaseIdentifier => LibationScaffolding.ReleaseIdentifier.ToString() + (File.Exists("/bin/yum") ? "_RPM" : "");
//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.
public bool CanUpgrade => Directory.Exists("/usr/lib/libation");

View file

@ -24,6 +24,8 @@ namespace MacOSConfigApp
//the running process, so don't upgrade unless it's "installed" in /Applications
public bool CanUpgrade => Directory.Exists(AppPath);
public string ReleaseIdentifier => AppScaffolding.LibationScaffolding.ReleaseIdentifier.ToString();
public void InstallUpgrade(string upgradeBundle)
{
Serilog.Log.Information($"Extracting upgrade bundle to {AppPath}");

View file

@ -25,6 +25,9 @@ namespace WindowsConfigApp
=> new DirectoryInfo(directory)?.DeleteIcon();
public bool CanUpgrade => true;
public string ReleaseIdentifier => AppScaffolding.LibationScaffolding.ReleaseIdentifier.ToString();
public void InstallUpgrade(string upgradeBundle)
{
var thisExe = Environment.ProcessPath;