Skip to content
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

[Restructuring] Add the Universal Thcrap Launcher #108

Open
brliron opened this issue Jun 17, 2019 · 12 comments
Open

[Restructuring] Add the Universal Thcrap Launcher #108

brliron opened this issue Jun 17, 2019 · 12 comments
Milestone

Comments

@brliron
Copy link
Member

brliron commented Jun 17, 2019

https://github.com/Tudi20/Universal-THCRAP-Launcher
Because it's a good alternative to the shortcuts hell.
It was also discussed in #100

We may need to install a .NET runtime from a wrapper.

@lilyremigia
Copy link
Contributor

If we want to add the existing UTL:
How about @thpatch forks my repo, and I archive mine, then put UTL in to the main project via a git submodule for starters?
If this happens this way, I should be added as a member of @thpatch while also this way keeping it clear that UTL isn't that tightly in the thpatch ecosystem.
If we don't want to add the existing UTL and instead create a new one ASAP by @Tudi20 :
In this case, I think a new project should be created with an UI in this repo (as long as it's an easy-to-learn C# UI toolkit). Of course in this case, I should be given.
Not C# UI ASAP:
In this case, I'm sorry but I can't help with this yet, but if everything goes right in my life I will be learning C soon.
Not C# UI by @Tudi20 :
Mentioned before, this means we have to wait, as I will be starting uni this year and I saw that we would be learning C sooner or later.

@brliron
Copy link
Member Author

brliron commented Jun 30, 2019

1st, the 3rd one isn't really an option. The 4rd one would probably be faster.
And the 4rd one isn't really an option either, you're doing it, you get to choose the techno. Moreover, I know some C#, I could help with it if needed.
And for the 1st or the 2nd one, well, you do want to create a new one, so I'll guess we'll see which comes 1st. If the restructuring is done before the new UTL, we'll take the old one (and switch when the new one is ready), and if the new UTL is done before the restructuring, we'll take the new one.
Btw, I prefer if we put the UTL source code directly in the thcrap repo. @mokou can you add Tudi20 to the devs in the thpatch organization?

@lilyremigia
Copy link
Contributor

Well... Either way one of these incentive is going to happen:
During the summer I might choose to dig deeper into WPF and do UTL with C# WPF...
Or if I do get into uni, the firs semester I will be learning C at uni, so the incentive might be to improve myself in that by doing GUI and upgrading my knowledge to C++.

@lilyremigia
Copy link
Contributor

@brliron What do you think of https://platform.uno/ ?
It's native* cross-platform, so we can support both Windows and Linux.

* Only caveat here is that for Windows it uses WinUI, so for Windows 7, if we do still intend to support it, it is done as WebAssembly. (Have to distribute it with PWA, WPF Shell, or Electron.) Don't worry for Linux it uses GTK.

Also, it's free and open-source.

@brliron
Copy link
Member Author

brliron commented Feb 19, 2024

Weirdly enough, the main downside seems to be that it doesn't require wine.
Our users WILL need wine. Because whatever we do, the games will require wine. The question is, when do we run wine?
And there is only one case where the user have a say in this: when they run the 1st program in the chain. In this case, when they run UTL. That's when they can install wine, setup their custom wineprefixes if they need to, and do whatever they need on their specific machine to keep wine happy.
On my Linux laptop, I can just run wine ./thcrap_loader.exe fr.js th14 or wine ./thcrap.exe and it works properly. If it could work like that for everyone, it would be great. But it doesn't, and because it doesn't, several of our power users do some tinkering with their wine invocation to make it work - and they need to be able to do this tinkering, which becomes harder or even impossible if they don't invoke wine themselves.

There are ways to work around that. We could make a setting called "Wine command line", that exists only on Linux, and that we would execute with bash instead of running either thcrap_loader or wine directly. But if we bury it in a settings menu, the users won't see it. IMO, we need either a popup at the 1st launch, which I'm not totally a fan of because hopefully just wine without parameters may work, or a way to detect whether the game successfully started (32th tried to implement something like that and it led to #251, it isn't as easy as it seems).

Outside of that, 2 questions:

  • Why this instead of .NET Core? I thought the point of .NET Core was to have .NET everywhere, or at least on every desktop (and we don't care about mobile or web). Seems like .NET Core doesn't include either WPF or WinUI on Linux, googling about these leads me to platform.uno. Thanks Microsoft for your big ".NET is now cross-platform" communication when the part that matters isn't actually cross-platform, I guess.
  • Do you have any binary sample for the Windows, Win7, and Linux versions? I'd like to see how big the Windows variants are (for user experience reasons, I don't think we'll want to ship 2 different versions of the Windows one, so we might drop Win7 for UTL), and how easy to use the Linux version is.

@lilyremigia
Copy link
Contributor

Most community-made launchers for windows games on linux, I have seen seem to auto-install wine, if not yet installed, and create their own wineprefix. For those needing to use custom parameters, I personally would expect them to be literate enough to check in the settings. However, I guess we can add-in a little tutorial / set-up for first launch.

Funnily, with a proper Linux version we could even aim for Steam Deck support, since that's just Linux with fancy coat as well.

Here are some Mediafire links for you to test out (they are obviously larger than 25MB):

Oh, and in case you're curious of the visual aspect, you can check out their gallery. It can do both Material and Fluent.

@lilyremigia
Copy link
Contributor

In short though, the Windows10-11 versions are roughly the same size as an empty WPF app, just with .dll file and folder spam. With some extra work that can be dealt with... or we just make UTL install into Program Files... There is https://github.com/Squirrel/Squirrel.Windows after all.

Hmm, if this really does work out, we could perhaps put the configuration in here as well, and have Squirrel solve #31 for us. (I have mentioned it there before.) I'm mainly only pushing it, because I have seen it used in a couple other C# repos here on GitHub, and it seems to work like a charm.

@brliron
Copy link
Member Author

brliron commented Feb 20, 2024

We'll discuss the question of installers later. Also, know that squirrels are banned here, they're evil creatures that only want to harm us (the th135 engine heavily uses a scripting language called Squirrel 3, I wrote a disassembler and patcher for its bytecode, and I tried to write a time-travel debugger for it in order to investigate some issues with the patch, but of course doing that is hard and I mostly gave up on that part of the patch until I randomly found a Squirrel 3 decompiler that helped me investigate these issues). If we use this, we'll just shove it in a subfolder and use a small wrapper to have just one executable from the root folder.

So, the Windows minimal version is 142MB, when the entire unzipped thcrap release, as of today, is 24MB (with 14MB just from the VC runtime installer). That's a huge increase, especially when the self updater does a blocking update check at start and still doesn't have a progress bar.

As for the Linux version, I couldn't understand how to run it. There's only one thing that looks runnable in there, UnoApp2.Skia.Gtk.exe , file tells me that it's a Windows executable, my file explorer refuses to execute it, running it from the command line gives me "exec: Failed to execute process: './UnoApp2.Skia.Gtk.exe' the file could not be run by the operating system.", and I tried just in case, I can't run either UnoApp2.Skia.Gtk.exe or UnoApp2.Skia.Gtk.dll with mono ("File does not contain a valid CIL image." for the exe, "The entry point method could not be loaded" for the DLL).

@lilyremigia
Copy link
Contributor

For running the app in Linux, after ensuring that dotnet8 and gtk3 is installed, you need to run dotnet UnoApp2.Skia.Gtk.dll. This works for me from default Ubuntu WSL under Win11.

To run the .exe for the gtk version on Windows, you need to have gtk3 downloaded and installed: https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases . As you can see from this, this is a portable release. It is possible to publish, only for linux, which gives this size: https://www.mediafire.com/file/yttslivv53li77x/linux-x64-dotnet8-super-lean.zip/file

Speaking of publishing, I'm given to remember, that I can make the Windows version framework-dependant as well, giving this size: https://www.mediafire.com/file/w3iq2541kr3ucgw/win-x64-super-lean.zip/file (This reduces the minimal size to 82.5 MB unzipped)

@lilyremigia
Copy link
Contributor

FYI, a blank WinUI3 app that's framework-dependant is 38.3 MB.

@lilyremigia
Copy link
Contributor

Also, could you check on UTL? Plus, if I remember right, UTL doesn't have any self-updating mechanism of sorts, so we can try Squirell on it.

@lilyremigia
Copy link
Contributor

@brliron I guess then, not just for the sake of keeping a small size, but for not mixing more u8 frameworks and etc.
UTL can also be WPF. Has the added benefit of allowing us to reuse UI code, if we want to.
In that case, though, I would like to keep the scope of what the launcher does to quite small as well, no need to reimplement configure features. (Although if configure would allow you to quick configure games or patches that would be nice, but that's going to be a seperate enhancement.)
And, if I or someone else wants to create a feature-rich one with a modern UI framework that can be a seperate app.
On another note, calling it Universal would feels a bit extraneous then, so how about calling it 'Official THCRAP Launcher' to also differentiate from UTL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants