JuneStepp / OneLauncher

Launcher and Addons Manager for LOTRO and DDO
Other
45 stars 11 forks source link

OneLauncher does not correctly locate the Plugins directory on a Linux Steam install #57

Closed Git-Forked closed 1 month ago

Git-Forked commented 1 month ago

OneLauncher does not correctly locate the Plugins directory on a Linux Steam install. There also seems to be no option to manually set the correct directory.

Git-Forked commented 1 month ago

The directory it created and attempted to use is:
/home/user/Documents/The Lord of the Rings Online/Plugins

The actual directory for the plugins is: /home/user/.local/share/Steam/steamapps/compatdata/212500/pfx/drive_c/users/steamuser/Documents/The Lord of the Rings Online/Plugins

NOTE: user (italicized) will be the name of the account logged in.

JuneStepp commented 1 month ago

OneLauncher uses its own WINE prefix along with the system documents folder by default. Steam uses its own Proton (WINE) prefix and a documents folder within that prefix by default. To change the documents folder used by OneLauncher, you can enable advanced options in the settings menu and change the value of "Settings Directory" under the "Game" tab.

Git-Forked commented 1 month ago

"Settings Directory" is "Plugins Directory"? That is unclear. If this is true, perhaps that can be made more clear to the user.

Git-Forked commented 1 month ago

Is this the folder it should be pointing to? /home/user/.local/share/Steam/steamapps/compatdata/212500/pfx/drive_c/users/steamuser/Documents/The Lord of the Rings Online/ Also tried pointing it to: /home/user/.local/share/Steam/steamapps/compatdata/212500/pfx/drive_c/users/steamuser/Documents/The Lord of the Rings Online/Plugins It still does not display the plugins.

JuneStepp commented 1 month ago

"Settings Directory" is "Plugins Directory"? That is unclear. If this is true, perhaps that can be made more clear to the user.

The plugins directory among other things is in the game settings directory. I specify what all in the tooltip, but if you have a better name idea, I'd be open to it. I'm not a fan of how the current name can be confused with the game's OneLaucher config directory.

JuneStepp commented 1 month ago

Is this the folder it should be pointing to? /home/user/.local/share/Steam/steamapps/compatdata/212500/pfx/drive_c/users/steamuser/Documents/The Lord of the Rings Online/ Also tried pointing it to: /home/user/.local/share/Steam/steamapps/compatdata/212500/pfx/drive_c/users/steamuser/Documents/The Lord of the Rings Online/Plugins It still does not display the plugins.

The first one should be correct where it's set to the parent of the Plugins directory. The one with "UserPreferences.ini". Have you closed and reopened the addons manager?

Git-Forked commented 1 month ago

I did think it was referring to the OneLauncher's config directory.
I will try to think of a better name for you.

Also as a side mention, a small cosmetic issue, on the settings (gear icon), OneLauncher (tab): The name for the tickbox "Always Use Default Language For UI" doesn't fit in the space provided.
Both the top and the bottom of the words are being cut off. I can provide a screenshot if requested, and also could open a separate issue for this if you would like, but I am not trying to purposely flood you with too many issues at once.

Git-Forked commented 1 month ago

Have you closed and reopened the addons manager?

Yes, multiple times. I have closed and reopened the OneLauncher also.

JuneStepp commented 1 month ago

I did think it was referring to the OneLauncher's config directory. I will try to think of a better name for you.

Also as a side mention, a small cosmetic issue, on the settings (gear icon), OneLauncher (tab): The name for the tickbox "Always Use Default Language For UI" doesn't fit in the space provided. Both the top and the bottom of the words are being cut off. I can provide a screenshot if requested, and also could open a separate issue for this if you would like, but I am not trying to purposely flood you with too many issues at once.

Seems like with some theme setups it's not resizing like it should. I'd appreciate it if you could open another issue. Don't worry about opening too many. I appreciate the feedback!

JuneStepp commented 1 month ago

Have you closed and reopened the addons manager?

Yes, multiple times. I have closed and reopened the OneLauncher also.

From the addons manager you can open the folder OneLauncher is using for plugins from the dropdown on the big top right button. Does that folder have all your plugins in it or is it somewhere else?

Git-Forked commented 1 month ago

I just noticed I have the directory listed as "The Lord of the Rings" and it should be "The Lord of the Rings Online". After fixing that, I receive another error: /home/user/.steam/steam/steamapps/compatdata/212500/pfx/drive_c/users/steamuser/Documents/The Lord of the Rings Online/Plugins/DU_81/Palantir.plugincompendium has misconfigured descriptors

JuneStepp commented 1 month ago

I just noticed I have the directory listed as "The Lord of the Rings" and it should be "The Lord of the Rings Online". After fixing that, I receive another error: /home/user/.steam/steam/steamapps/compatdata/212500/pfx/drive_c/users/steamuser/Documents/The Lord of the Rings Online/Plugins/DU_81/Palantir.plugincompendium has misconfigured descriptors

It's not terribly uncommon for plugins to have misconfigured .plugincompendium files. OneLauncher generates them itself to get around that, but that doesn't help with plugins installed from somewhere else. This error means that the descriptors for what .plugin files are included are wrong.

Git-Forked commented 1 month ago

I believe I saw you comment about a plan of better handling of misconfigured .plugincompendium files on the lotrointerface.com

JuneStepp commented 1 month ago

I believe I saw you comment about a plan of better handling of misconfigured .plugincompendium files on the lotrointerface.com

That's for when the XML itself is wrong rather than the content. When the addons aren't downloaded with OneLauncher, about the best that can be done is telling the user about the misconfiguration. I can't detect the plugin files once everything's already installed and mashed together into the same folders.

Git-Forked commented 1 month ago

This is the file that your program reports has an issue:

<PluginConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Id>1111</Id>
  <Name>Palantir III</Name>
  <Version>3.3.2</Version>
  <Author>Loikki</Author>
  <InfoUrl>https://gitlab.com/loikki/palantir3</InfoUrl>
  <DownloadUrl>https://gitlab.com/loikki/palantir3/-/archive/master/palantir3-master.zip</DownloadUrl>
  <Descriptors>
    <descriptor>DU_81.Palantir.plugin</descriptor>
  </Descriptors>
  <Dependencies />
</PluginConfig>

What I see: InfoUrl and DownloadUrl point to gitlab rather than lotrointerface. And I don't believe this tag is needed at all: <Dependencies />

What do you notice that might be causing your program to reject it?

JuneStepp commented 1 month ago

I'll have to double check if those URLs can cause other issues, but the error is from the plugin descriptor. <descriptor>DU_81.Palantir.plugin</descriptor> should be <descriptor>DU_81\Palantir.plugin</descriptor>

They used a period instead of a backslash to separate the path.

JuneStepp commented 1 month ago

This is the format if you're curious.

The reason OneLauncher cares about the descriptors being correct is so that plugins can be uninstalled.

Git-Forked commented 1 month ago

Fixing that in both the .plugin and the .plugincompendium files yields another error:

logs - CRITICAL - Uncaught exception:
Traceback (most recent call last):
  File "/tmp/onefile_150574_1721883221_660790/onelauncher/main_window.py", line 339, in btnAddonManagerSelected
  File "/tmp/onefile_150574_1721883221_660790/onelauncher/addon_manager.py", line 336, in __init__
  File "/tmp/onefile_150574_1721883221_660790/onelauncher/addon_manager.py", line 1674, in tabBarInstalledIndexChanged
  File "/tmp/onefile_150574_1721883221_660790/onelauncher/addon_manager.py", line 1688, in loadPluginsIfNotDone
  File "/tmp/onefile_150574_1721883221_660790/onelauncher/addon_manager.py", line 483, in getInstalledPlugins
  File "/tmp/onefile_150574_1721883221_660790/onelauncher/addon_manager.py", line 494, in removeManagedPluginsFromList
  File "/tmp/onefile_150574_1721883221_660790/defusedxml/minidom.py", line 22, in parse
  File "/tmp/onefile_150574_1721883221_660790/defusedxml/expatbuilder.py", line 86, in parse
  File "/tmp/onefile_150574_1721883221_660790/xml/dom/expatbuilder.py", line 207, in parseFile
xml.parsers.expat.ExpatError: mismatched tag: line 13, column 2
JuneStepp commented 1 month ago

.plugin files are diferent though similar to compendium files. They do use .. It's a bit more like a programming language import than a file path. That error suggests you just accidentally didn't close an XML tag properly, though. That causing the addons manager to crash is the error talked about on lotrointerface.

Git-Forked commented 1 month ago

The error does not specify which file it has the issue with as far as I can tell.

Git-Forked commented 1 month ago

I have 17 plugins installed, including two I wrote myself.
I checked the formatting of mine, and they appear to be correct.
That leaves 15 other plugins that could have an issue.

JuneStepp commented 1 month ago
from pathlib import Path
from xml.dom import minidom

plugins_folder = Path("YOUR_PATH_HERE")

for plugin_file in plugins_folder.glob("**/*.plugin*"):
    if plugin_file.suffix.lower() == ".plugindata":
        continue

    try:
        minidom.parseString(plugin_file.read_text())
    except:
        print(plugin_file)

That should do it for you

Git-Forked commented 1 month ago

I fixed the file your script reported to me, but I am still getting the error I posted a few message ago..

logs - CRITICAL - Uncaught exception:
...
xml.parsers.expat.ExpatError: mismatched tag: line 13, column 2
Git-Forked commented 1 month ago

I spotted a second mistake in the file. I will be trying again.

Git-Forked commented 1 month ago

Success, the plugin list is now showing.

JuneStepp commented 1 month ago

Hope it works well for you!

btw, your LOTRO store codes script could be combined with a plugin similar to this and used as a startup script to automate everything. Almost did that myself in the past.

Git-Forked commented 1 month ago

I currently have a slightly modified version of LOTRO-Weekly-Code that copies the code to my clipboard instead of printing it out to terminal. And I have the script set to a hotkey for easy usage.

https://github.com/Git-Forked/LOTRO-Weekly-Code