DSPaul / COMPASS

TTRPG resource manager, bringing all your books, maps, etc. in one place.
https://www.compassapp.info
GNU General Public License v3.0
83 stars 9 forks source link

No webdrivers when you change compass data path #60

Closed lucastucious closed 11 months ago

lucastucious commented 11 months ago

Describe the bug After changing path for Compass data, webdrivers can't download .

So I cannot download homebrewery cover, for example

To Reproduce Steps to reproduce the behavior:

  1. Change data path, maybe on another hard drive
  2. Relaunch
  3. See the error message "chrome webdriver could not be initialised"

Screenshots/files Screenshot_2023-10-28-00-00-52-63_fc90557b4939f0bdf6f556efb0a965c9.jpg

System info (please complete the following information):

DSPaul commented 11 months ago

I looked into it. I think the changed data path is a red herring, I tried it myself and it works fine, everything in the code also looks good on that front.

The error you get however can only occur when COMPASS detects that you have chrome installed but you said that you don't so the issue is most likely related to that. So I have taken the following steps to mitigate this issue:

lucastucious commented 11 months ago

After manys verifications :

lucastucious commented 11 months ago

Here is an error, i think related to this issue, when i try to renew cover from an homebrewery item : image

and here is the log all.log

DSPaul commented 11 months ago
lucastucious commented 11 months ago

Here is what i found :

On app menu after uninstall pressed
image image

the log from F:/COMPASS is here all.log

DSPaul commented 11 months ago

Windows still think i have chromium, but when i want to uninstall it, it cant find the exe

Seems like windows has exactly the same problem COMPASS has, something must have gone wrong while uninstalling so the files are deleted but there is still a registry entry in windows indicating that the program is still there, not much I can do about it. But with the new code it will now just move on from this problem and use firefox so all good.

I have also solved the crash, it was trying to take the most recent webdriver but because you didn't have a webdriver due to your problem, it was trying to take the last out of an empty list, hence the error "sequence contains no elements".

lucastucious commented 11 months ago

Still, why compass can't find the chrome folder ?

DSPaul commented 11 months ago

It doesn't search for it, that would take way too long. Imagine if COMPASS was running on a PC with 16TB hard drive full of data, good luck finding that one chrome.exe file.

So instead of doing that, it looks at the windows registry where windows keeps a table of installed programs and where they are installed. It's the same list windows uses when you go to Apps in the windows settings or when you search for apps using Windows search. It's specifically designed so that you don't have to hunt down the right exe file every time you want to start an app.

So if that registry entry is wrong or outdated, neither Windows nor COMPASS will find it.

lucastucious commented 11 months ago

I understand, but since I have a registry entry for chromium, chrome and Firefox, you could have fallback when the first isn't found

DSPaul commented 11 months ago

That is exactly what I have done in the first commit that references this issue, the fix will be part of the next update.

lucastucious commented 11 months ago

More info : I've COMPASS installed on another computer. No data path changed, fresh install, chrome as main browser but still this message. here is the log all.log

DSPaul commented 11 months ago

Looked at the log and despite it being the same error, the problem is different.

In this case it does detect your chrome install correctly but fails to download the webdriver itself. Seems like chrome changed download url for their webdrivers starting with with version 115 so if you have an up to date version of chrome (118 at the time of writing) it will indeed fail.

The package I use (WebDriverManager.NET) has released a update that fixes this which will be included in the next release of COMPASS.