Linux Beta#321
Conversation
|
OK, the problem was with standalone builds. They must be for very specific linux kernels, but they don't say which ones. So we'll have to redistribute it as a framework-dependent build and users will need to install the runtime. I've updated the publish profiles and added more instructions for installing. https://github.com/Mbucari/Libation/blob/master/Source/LibationAvalonia/README.md |
|
Did someone say Linux build? :D Just tried the Test 5 release, seems to be fine here on Ubuntu 21.10. Thanks to both of you for your hard work! |
Woohoo! I only made that release for my own testing purposes and didn't intend for anyone else to use it, but I'm thrilled it worked for you! Did it add Libation to your applications list with the icon? |
You're quite welcome. I'm not shy about taking credit for the vision, the years of work, and the literally thousands of hours I put into Libation before anyone took notice. A lot of though went into this and I'm very proud of this program. In the last 1 to 1 1/2 years though, depending on the month in question, @Mbucari 's contributions have been somewhere on the spectrum of 'small meaningful improvements' to 'damn near every new change.' And this cross platform effort has been 1,000% Mbucari . If anything, I've had brief moments of input -- and even that's probably giving myself too much credit. My man's been a beast! |
|
@Mbucari I see this is no longer in |
Go for it. I just updated the install script to make LibationCli executable and to add a sym link for it.
I just added it.
Pfft. I'm faking it over here. I just wrote my first bash anything today, and that is it lol. |
Oops, sorry! I was being lazy and didn't want to build it and just happened to notice the package 😆. It didn't but that's because I unzipped and ran it directly. My bad, again. I just installed it with your script and it worked perfectly, icon and all! Great job on the scripting! |
|
Southern summer thunder storm keeps making my power blink. Since I still haven’t gotten around to putting my router on a UPS, it means my wifi keeps going away. Typing this on my phone. Tomorrow I have pointless work meetings all day so I should have plenty of time to do a final review while I pretend I’m listening to those. |
|
I guess this is still the best place to keep discussing before release. I have several questions. Instead of vomiting them all at once like I usually do, let's go one at a time. If we're going to maintain both UIs anyway, there no reason not to let windows people have access to avalonia if they want to. I agree that the beta flag isn't the right way to do it anymore. New setting? I'm especially imagining people who use windows and linux who would appreciate it looking the same on both. |
|
I don't think you need a new setting, you just need to make and post a Windows build of avalonia. Do it the same way you already do it for winforms. We'll end up with 3 bin zips Libation.#.#.#-win.zip A better way would be to have different version numbers for the avalonia betas, but since the version number is housed in app scaffolding which is shared by all packages, that's not possible. Edit: well of course it's possible, but it seems like it's a pain in the ass changed to make for a very little benefit. |
|
Interesting. Sure, I guess it could be separate builds instead of hot-swappable. This would make smaller downloads. Win = winform, hangover, CLI. Win-beta (needs a better name) = avalonia, hangover, CLI. Linux-beta = avalonia, CLI Next item:
I didn't want to hold up this enormous PR just for this. We can't release with this part as-is though. It's enormously popular. More importantly though is that people rely on it now. Minimally winforms needs a way to autoupdate. Ideally avalonia needs a way. Super ideal would also be to add a CLI action. I'm not married to autoupdater.net specifically; it's just easy to use. |
|
I've been thinking about the updater, and I've come to the conclusion that this is a hard problem lol. I sketched out a potential solution. Take a look and tell me what you think. public static void Main2(string[] args)
{
//Don't look at this if block until you've read and understand what comes after it.
//Then come back and take a look.
if (args?.Length == 2 && int.TryParse(args[0], out var processId) && Directory.Exists(args[1]))
{
//This Libation instance is running in a temp location for the purpose of updating
var programFilesDir = args[1];
//Wait for the calling Libation process to exit
var lingeringProc = Process.GetProcesses().SingleOrDefault(p => p.Id == processId && !p.HasExited);
if (lingeringProc is not null)
lingeringProc.WaitForExit();
var thisUpdateDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
//Copy all files from this temp directory to the program files directory
foreach (var file in Directory.EnumerateFiles(thisUpdateDir))
{
var relFile = Path.GetRelativePath(thisUpdateDir, file);
var dest = Path.Combine(programFilesDir, relFile);
if (!Directory.Exists(Path.GetDirectoryName(dest)))
Directory.CreateDirectory(dest);
File.Copy(file, dest);
}
//All update files have been coppied. Start Libation in the program files directory, then exit.
//Let the system take care of cleaning up these temp files.
var libationExe = Path.Combine(programFilesDir, "Libation") + (islinux ? "" : ".exe");
StartProcess(libationExe);
return;
}
//This is where the existing Libation program starts
var config = AppScaffolding.LibationScaffolding.RunPreConfigMigrations();
var proc = Process.GetCurrentProcess();
if (!string.IsNullOrEmpty(config?.UpdateFile) && File.Exists(config.UpdateFile))
{
//A previous Libation instance downloaded an update zip file, so we run the installer now.
var updateExtractionDir = Path.Combine(Path.GetTempPath(), "libationupdate");
ExtractUpdateFilesToTempLocation(updateExtractionDir);
var libationTempExe = Path.Combine(updateExtractionDir, "Libation") + (islinux ? "" : ".exe");
var thisProcID = Process.GetCurrentProcess().Id.ToString();
var libationProgramFilesDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
//Run the Libation executable in the temp location with this instance's
//process ID and directory as arguments, then exit.
StartProcessWithArgs(libationTempExe, thisProcID, libationProgramFilesDir);
return;
}
} |
|
This would be great: Except it appears it requires a setup exe (or msi) on windows systems. |
|
Sorry for being so absent today; today's meetings weren't as hands-off as I'd hoped.
Yes. Yes sir it is. Although I couldn't respond today, I did lots of thinking. In order of preference:
|
It's a GUI built on winforms (or WPF).
Right near the top: Built-in supported update download types: |
I'll look into it further. Surely this is just a tiny bit of UI around core components. We could probably even use whatever his wpf is for avalonia. This feels like less work than homegrown. I assume you discovered the incompatibility when you tried to use it with avalonia. Did it not compile?
I saw that many times and thought: yeah, we do have exe. It's only now noticing macos that they don't include zip as a windows option. |
Nope and here's why (lines 6-8) Converting that to Avalonia is non-trivial. It has two pieces: the update form and downloader, and the zip extractor. They are both GUIs and would need to be ported to Avalonia. IMHO, forking, replacing winforms with Avalonia, and repackaging for our use is more work and is more error-prone than using my upgrader program (rember that from way back? It looks like I deleted the repo, but I'm sure I still have the source files somewhere). upgrader was basically the AutoUpdater.NET's ZipExtractor utility, except that you would pass the download URL and it would do the downloading. |
|
My opinion is we need to roll our own. It does not need to be complicated, and most (if not all) of the work can be done within Libation. At a minimum, an audo-updater need to be able to:
The way I see this working on the GUIs is:
For CLI:
EDIT: If you want to copy AutoUpdater.Net, then just port ZipExtractor to Avalonia: The problem is going to be finding suitable xplat ways of detecting file locks. And really, there is no xplat way of doing that. You'd just have to define how you detect and handle file locking for all systems you're deploying on. |
|
Works for me. You won't begin to believe how much time I've wasted today. I thought all this time you'd removed it entirely, including from winforms and frankly I was pretty wtf. I saw your PR comment and searched the new code to see if you'd just commented it out. And it was entirely gone. Ok, he must have fully removed it -- that sucks. So I've been testing old versions of code via detached git branches and digging through which points we touch in autoupdater etc. All this because I'd previously done a directory search from within VS when I working on a different project. And when I searched Libation code, I'd forgotten to change search back to 'current solution'. So I was really searching for autoupdater within the directory of an unrelated project. @#$%^! !! |
|
I'd still like updating to be an available feature for linux and CLI but it's not a priority like winform is -- since all of those users have come to rely on it. For now, do you want to push this into an issue/ticket and one of us can tackle it later? I like your ideas above. I'm still on the fence about extending autoupdater. I see what you mean about non-trivial, but they also have really battle-tested code. |
Whoops! 😂
Yes please. I'm anxious to start getting feedback from Linux users. I had one more thought for adding updating to avalonia. What if we make 2 new libation dlls devoted to updating, one for Windows and one for linux. The windows one will use Autoupdater.net, and the Linux one will use something else. Inside libation, dynamically load the correct dll based on environment than execute the update routine. |
That could work. Can you make a new issue-ticket and dump and/or link you ideas there? We can hash that out on another day. Like you said: we're anxious to push this out so users can quickly ignore us :) How should I be doing publishes now so we can get our 3 builds?
My usual way is: My last attempt at the other way was: |
Libation.#.#.#-windotnet build -c Release -o bin\Release-win LibationWinForms\LibationWinForms.csproj
dotnet build -c Release -o bin\Release-win LibationCli\LibationCli.csproj
dotnet build -c Release -o bin\Release-win Hangover\Hangover.csprojFiles are in bin-Avalonia\Release-win Libation.#.#.#-linuxdotnet publish -c Release LibationAvalonia\LibationAvalonia.csproj -p:PublishProfile=LibationAvalonia\Properties\PublishProfiles\LinuxProfile.pubxml
dotnet publish -c Release LibationCli\LibationCli.csproj -p:PublishProfile=LibationCli\Properties\PublishProfiles\LinuxProfile.pubxmlFiles are in bin-Avalonia\publish\linux-x64 Libation.#.#.#-win-PrettyNewUIbutBuggyAndUnstabledotnet build -c Release -o bin-Avalonia\Release-win LibationAvalonia\LibationAvalonia.csproj
dotnet build -c Release -o bin-Avalonia\Release-win LibationCli\LibationCli.csproj
dotnet build -c Release -o bin-Avalonia\Release-win Hangover\Hangover.csprojTYou must build Hangover last else it won't run for some reason. Files are in bin-Avalonia\Release-win |
Notable changes in this PR are:
I found 1 backslash and replaced it. The setup routines have been fixed and thoroughly tested. I've tested both Libation and LibationCli on a fresh Ubuntu install using the instructions I wrote. It all works. I think it's ready for beta release.
EDIT* I changed the publish profile to standalone, and now users do not need to install the dotnet runtime on their machines.