Zagrios / bs-manager

An all-in-one tool that lets you easly manage BeatSaber versions, maps, mods, and even more.
GNU General Public License v3.0
572 stars 43 forks source link

[FEAT.] : make linux AppImage work out of the box #578

Closed silentrald closed 3 days ago

silentrald commented 1 month ago

Problem

Currently with the linux AppImage, to install mods properly in linux distros, there are hidden dependencies that aren't very well documented. Users need to install both screen and dotnet-3.1.426 version. screen package is very trivial for most distros however the specific version of dotnet is very hard for most users to get installed.

These are some of the dotnet installation process:

Solution

Add the linux executable binaries for screen and dotnet to the assets/scripts folder to properly run the IPA.exe executable. This is also feasible since I've got a working branch for this. Only downside here is that the dotnet binary is very big, around ~200mb. Will try to update this to get the final AppImage size if I include these changes.

Alternative solutions (if any)

Additional context

Feature suggestion is because of Steam Deck users since its very hard to install packages in the handheld console and most users of these are not technically adept to install these stuff.

Zagrios commented 1 month ago

Can't we get rid of the screen dependency ? 🤔 I know we need it because BSIPA tries to move the cursor, but I also had this problem on Windows because I absolutely wanted the app to run without a window... Now it opens a window when executing BSIPA on Windows and no problem

Can't we execute just a command like dotnet bsipa.exe in a way that it opens its own window and does not longer throw the cursor moving error?🤔

silentrald commented 1 month ago

I think the screen and dotnet combination might be harder to debug tbh since screen silently proceeds execution even if dotnet fails. Can't seem to make dotnet bsipa.exe to work in any case. Although, I got mono or wine to work and remove the cursor moving error. I've pasted the logs for each so that we can have a comparison.

mono logs ``` [1] 09:15:52.745 › executeBSIPA 1.29.1 [ '-n' ] [1] 09:15:52.746 › START IPA PROCESS mono "/home//BSManager/BSInstances//IPA.exe" -n [1] 09:15:52.788 › IPA process stdout Restoring old version... [1] [1] 09:15:52.792 › IPA process stdout Installing files... [1] [1] 09:15:52.793 › IPA process stdout Copying /home//BSManager/BSInstances//Beat Saber_Data/Managed/I18N.dll [1] Copying /home//BSManager/BSInstances//Beat Saber_Data/Managed/I18N.West.dll [1] 09:15:52.794 › IPA process stdout Copying /home//BSManager/BSInstances//Beat Saber_Data/Managed/IPA.Injector.dll [1] 09:15:52.794 › IPA process stdout Copying /home//BSManager/BSInstances//Beat Saber_Data/Managed/IPA.Injector.pdb [1] 09:15:52.794 › IPA process stdout Copying /home//BSManager/BSInstances//Beat Saber_Data/Managed/IPA.Loader.dll [1] 09:15:52.795 › IPA process stdout Copying /home//BSManager/BSInstances//Beat Saber_Data/Managed/IPA.Loader.pdb [1] 09:15:52.795 › IPA process stdout Copying /home//BSManager/BSInstances//Beat Saber_Data/Managed/IPA.Loader.xml [1] 09:15:52.795 › IPA process stdout Copying /home//BSManager/BSInstances//Beat Saber_Data/Managed/Microsoft.CSharp.dll [1] 09:15:52.796 › IPA process stdout Copying /home//BSManager/BSInstances//Beat Saber_Data/Managed/netstandard.dll [1] 09:15:52.796 › IPA process stdout Copying /home//BSManager/BSInstances//Beat Saber_Data/Managed/System.Runtime.Serialization.dll [1] 09:15:52.796 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/0Harmony.dll [1] 09:15:52.797 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/Hive.Versioning.dll [1] 09:15:52.797 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/Ionic.Zip.dll [1] 09:15:52.798 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/Mono.Cecil.dll [1] 09:15:52.798 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/Mono.Cecil.Mdb.dll [1] 09:15:52.798 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/Mono.Cecil.Pdb.dll [1] 09:15:52.799 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/Mono.Cecil.Rocks.dll [1] 09:15:52.799 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/MonoMod.RuntimeDetour.dll [1] 09:15:52.799 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/MonoMod.Utils.dll [1] 09:15:52.799 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/Newtonsoft.Json.dll [1] 09:15:52.800 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/SemVer.dll [1] 09:15:52.800 › IPA process stdout Copying /home//BSManager/BSInstances//Libs/SemVer.pdb [1] 09:15:52.800 › IPA process stdout Copying /home//BSManager/BSInstances//winhttp.dll [1] 09:15:52.801 › IPA process stdout [1] 09:15:52.801 › IPA process stdout Creating plugins folder... [1] [1] 09:15:52.806 › Ipa process exist with code 0 ```
wine logs ``` [1] 09:20:43.279 › executeBSIPA 1.29.1 [ '-n' ] [1] 09:20:43.279 › START IPA PROCESS wine "/home//BSManager/BSInstances//IPA.exe" -n [1] 09:20:43.957 › IPA process stderr 0124:fixme:mscoree:parse_supported_runtime sku=L".NETFramework,Version=v4.7.2" not implemented [1] [1] 09:20:43.958 › IPA process stderr 0124:fixme:mscoree:parse_supported_runtime sku=L".NETFramework,Version=v4.7.2" not implemented [1] [1] 09:20:43.966 › IPA process stderr 0124:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION [1] [1] 09:20:44.089 › IPA process stdout Restoring old version... [1] [1] 09:20:44.097 › IPA process stdout Installing files... [1] [1] 09:20:44.101 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Beat Saber_Data\Managed\I18N.dll [1] [1] 09:20:44.104 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.105 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Beat Saber_Data\Managed\I18N.West.dll [1] [1] 09:20:44.106 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.107 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Beat Saber_Data\Managed\IPA.Injector.dll [1] [1] 09:20:44.107 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.108 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Beat Saber_Data\Managed\IPA.Injector.pdb [1] [1] 09:20:44.108 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.109 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Beat Saber_Data\Managed\IPA.Loader.dll [1] [1] 09:20:44.109 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.111 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Beat Saber_Data\Managed\IPA.Loader.pdb [1] [1] 09:20:44.112 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.113 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Beat Saber_Data\Managed\IPA.Loader.xml [1] [1] 09:20:44.114 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.115 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Beat Saber_Data\Managed\Microsoft.CSharp.dll [1] [1] 09:20:44.116 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.117 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Beat Saber_Data\Managed\netstandard.dll [1] [1] 09:20:44.118 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.119 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Beat Saber_Data\Managed\System.Runtime.Serialization.dll [1] [1] 09:20:44.119 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.125 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\0Harmony.dll [1] [1] 09:20:44.125 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.128 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\Hive.Versioning.dll [1] [1] 09:20:44.128 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.129 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\Ionic.Zip.dll [1] [1] 09:20:44.129 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.131 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\Mono.Cecil.dll [1] [1] 09:20:44.132 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.135 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\Mono.Cecil.Mdb.dll [1] [1] 09:20:44.136 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.136 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\Mono.Cecil.Pdb.dll [1] [1] 09:20:44.137 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.138 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\Mono.Cecil.Rocks.dll [1] [1] 09:20:44.138 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.139 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\MonoMod.RuntimeDetour.dll [1] [1] 09:20:44.139 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.140 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\MonoMod.Utils.dll [1] [1] 09:20:44.141 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.142 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\Newtonsoft.Json.dll [1] [1] 09:20:44.143 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.147 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\SemVer.dll [1] [1] 09:20:44.147 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.148 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\Libs\SemVer.pdb [1] [1] 09:20:44.148 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.149 › IPA process stdout Copying Z:\home\\BSManager\BSInstances\\winhttp.dll [1] [1] 09:20:44.149 › IPA process stderr 0124:fixme:file:CopyFileExW cancel_ptr is not supported [1] [1] 09:20:44.150 › IPA process stdout Creating plugins folder... [1] [1] 09:20:44.154 › Ipa process exist with code 0 ```

For their binaries,

mono - still looking if I can portably build this from https://gitlab.winehq.org/mono/mono.

wine - kinda bundled within Steam so we can path that from where the protonPath is. Or we can still use the currently stable release of wine and just put it in the repo with the same effect. Can download the builds from here https://github.com/Kron4ek/Wine-Builds/releases.

silentrald commented 1 month ago

@Zagrios

Got a build for mono although it's pretty big around 500mb so I might just drop it. I might just reuse the wine binary that is package with proton so that no additional installation is needed and no added file to the build is necessary.

So the implementation that I'm currently thinking of is:

What do you think with the implementation above?


Only error I've encountered with wine as well is where there is a mismatch with the versions. This just needs to kill the process for wine and exe.

pkill wine & pkill exe

But can still offer some support on this in Discord if anything breaks as well on this front.

kevin-wijnen commented 1 month ago

As requested by @silentrald in #585, I'm referring some issues from there in here:

002c:fixme:winediag:loader_init wine-staging 9.11 is a testing version containing experimental patches.
002c:fixme:winediag:loader_init Please mention your exact version when filing bug reports on winehq.org.
0120:fixme:mscoree:parse_supported_runtime sku=L".NETFramework,Version=v4.7.2" not implemented
0120:fixme:mscoree:parse_supported_runtime sku=L".NETFramework,Version=v4.7.2" not implemented
0120:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0120:fixme:nls:GetFileMUIPath stub: 0x10, L"C:\\windows\\system32\\tzres.dll", (null), 000000000011E7C0, 00000000013545B0, 000000000011E7C8, 000000000011E7B8
0120:fixme:nls:GetFileMUIPath stub: 0x10, L"C:\\windows\\system32\\tzres.dll", (null), 000000000011E7C0, 00000000013545B0, 000000000011E7C8, 000000000011E7B8
0120:fixme:nls:GetFileMUIPath stub: 0x10, L"C:\\windows\\system32\\tzres.dll", (null), 000000000011E7C0, 00000000013545B0, 000000000011E7C8, 000000000011E7B8
Restoring old version... 
Restoring Beat Saber_Data/Managed/Microsoft.CSharp.dll
Beat Saber_Data/Managed/netstandard.dll
Beat Saber_Data/Managed/IPA.Injector.dll
Beat Saber_Data/Managed/IPA.Loader.dll
Beat Saber_Data/Managed/I18N.West.dll
Beat Saber_Data/Managed/IPA.Loader.xml
Beat Saber_Data/Managed/System.Runtime.Serialization.dll
Beat Saber_Data/Managed/IPA.Injector.pdb
Beat Saber_Data/Managed/IPA.Loader.pdb
Beat Saber_Data/Managed/I18N.dll
Libs/MonoMod.RuntimeDetour.dll
Libs/Mono.Cecil.Rocks.dll
Libs/Mono.Cecil.Pdb.dll
Libs/Mono.Cecil.Mdb.dll
Libs/Ionic.Zip.dll
Libs/0Harmony.dll
Libs/Hive.Versioning.dll
Libs/Mono.Cecil.dll
Libs/SemVer.pdb
Libs/SemVer.dll
Libs/MonoMod.Utils.dll
Libs/Newtonsoft.Json.dll
winhttp.dll
Beat Saber_Data\Managed\UnityEngine.CoreModule.dll
ERROR: Oops! This should not have happened.

System.ArgumentException: Illegal characters in path.
  at System.IO.Path.Combine (System.String path1, System.String path2) [0x00057] in <f1249a148cfb4110b9a02139
e12e4308>:0 
  at IPA.Patcher.BackupUnit.Restore () [0x0002f] in <92182438d24544498e9ffe99332cb29f>:0 
  at IPA.Patcher.BackupManager.Restore (IPA.PatchContext context) [0x0000a] in <92182438d24544498e9ffe99332cb
29f>:0 
  at IPA.Program.Install (IPA.PatchContext context) [0x0005f] in <92182438d24544498e9ffe99332cb29f>:0 
silentrald commented 1 month ago

That's very weird, every dll is expected except for the last one (UnityEngine.CoreModule.dll). Also I have warning on cancel_ptr but it still copied the files correctly. Although it failed somewhere in BSIPA where the path is not correctly created, still thinking if this has something to do with the slashes since looking at UnityEngine.CoreModule.dll has a different slashes from the previous dll filepaths.

But here's the logs of a successful wine execution with IPA.exe.

Logs ```bash wine ./IPA.exe "Beat Saber.exe" -n 0120:fixme:mscoree:parse_supported_runtime sku=L".NETFramework,Version=v4.7.2" not implemented 0120:fixme:mscoree:parse_supported_runtime sku=L".NETFramework,Version=v4.7.2" not implemented 0120:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION Restoring old version... Installing files... 0120:fixme:nls:GetFileMUIPath stub: 0x10, L"C:\\windows\\system32\\tzres.dll", (null), 00007FFFFE1FE450, 00007FFFFF265070, 00007FFFFE1FE458, 00007FFFFE1FE448 0120:fixme:nls:GetFileMUIPath stub: 0x10, L"C:\\windows\\system32\\tzres.dll", (null), 00007FFFFE1FE450, 00007FFFFF265070, 00007FFFFE1FE458, 00007FFFFE1FE448 Copying Z:\home\\BSManager\BSInstances\1.37.1\Beat Saber_Data\Managed\I18N.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Beat Saber_Data\Managed\I18N.West.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Beat Saber_Data\Managed\IPA.Injector.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Beat Saber_Data\Managed\IPA.Injector.pdb 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Beat Saber_Data\Managed\IPA.Loader.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Beat Saber_Data\Managed\IPA.Loader.pdb 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Beat Saber_Data\Managed\IPA.Loader.xml 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Beat Saber_Data\Managed\Microsoft.CSharp.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Beat Saber_Data\Managed\netstandard.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Beat Saber_Data\Managed\System.Runtime.Serialization.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\0Harmony.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\0Harmony.xml 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\Hive.Versioning.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\Hive.Versioning.xml 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\Ionic.Zip.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\Mono.Cecil.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\Mono.Cecil.Mdb.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\Mono.Cecil.Pdb.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\Mono.Cecil.Rocks.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\MonoMod.RuntimeDetour.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\MonoMod.RuntimeDetour.xml 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\MonoMod.Utils.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\MonoMod.Utils.xml 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\Newtonsoft.Json.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\Newtonsoft.Json.xml 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\SemVer.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\Libs\SemVer.pdb 0120:fixme:file:CopyFileExW cancel_ptr is not supported Copying Z:\home\\BSManager\BSInstances\1.37.1\winhttp.dll 0120:fixme:file:CopyFileExW cancel_ptr is not supported 0120:fixme:file:CopyFileExW cancel_ptr is not supported Creating plugins folder... ```

Can you post the dotnet logs and compare what's your successful execution with dotnet.