Kapiainen / Lauhdutin

A Rainmeter skin for launching games.
MIT License
67 stars 8 forks source link

init.lua error for GoG Galaxy ProgramData path #169

Closed humanspida closed 2 years ago

humanspida commented 2 years ago

Short description of the issue

Getting ProgramData path lua eror when enabling GoG Galaxy in the skin

Lauhdutin version

3.04 beta

Rainmeter version

4.5.13 - latest update

Python version

Version 3.9

Windows version

Windows 10 21H2 - Build No. 19044.1889

Error messages

init,lua:9: The path to GOG Galaxy's ProgramData directory is not valid.

Steps to reproduce the issue

Recently installed GoG Galaxy 2.0.51.86 client for Windows - first install, default location, no previous version to update from Enabled GoG Galaxy in Lauhdutin and got the above error - disabled it again Installed 1 free game (Stasis) through the GoG client hoping it might generate some essential files Tried enabling GoG Galaxy in Lauhdutin again but got the same error - disabled it again Game is installed to D:\GoG-Galaxy\Stasis

Also tried running the game once to see if that might generate some additional files, fill a config file with some data or help in some other way, being the first game I installed after the client itself... unfortunately, this did not make any difference either

Aditional Information

Having checked some other issues for similar things - these closed issues mention a similar error... issue #130 , issue #157 , & issue #83 But as I have only recently installed GoG Galaxy (after the 2.0 update) I have nothing to work with from a previously installed version. The files mentioned in these other threads do not exist for me having installed GoG Galaxy for the first time with the newest client installer.

In my ProgramData\storage folder I have the following files:

etags.db etags-updater.db galaxy-2.0.db galaxy-2.0.db-shm galaxy-2.0.db-wal jobs.db

Any information about whether this hiccup can be fixed for a new install using the latest GoG Galaxy client installer or not would be appreciated. Ta very much : )

BanCrash commented 2 years ago

@humanspida IIRC Lauhdutin search for galaxy.db instead galaxy-2.0.db, but I don't remember if there is any change on the gog database from 1.0 to 2.0. Since you already have it broken you can give it a try and check if renaming galaxy.db to galaxy-2.0.db in lines 9 and 43 of this file solves the issue:

https://github.com/Kapiainen/Lauhdutin/blob/development-v3/dist/%40Resources/main/platforms/gog_galaxy/init.lua

(This file is located on your Lauhdutin folder/@Resources/main/platforms/gog_galaxy/init.lua).

I didn't test this so I can't assure it will work, so make a backup of all your data before trying this to make sure you don't lose anything.

humanspida commented 2 years ago

Just changing the .db name in the lua file from "galaxy.db" to "galaxy-2.0.db" on the suggested lines yields the following error:

init.lua:11: SQLite3 CLI tool is missing. Expected the path to be C:\Users\korba\Documents\Rainmeter\Skins\Lauhdutin\ @Resources\sqlite3.exe

the sqlite3 bit is on line 10 & 11 in the lua file you indicated to try the change in

BanCrash commented 2 years ago

Just changing the .db name in the lua file from "galaxy.db" to "galaxy-2.0.db" on the suggested lines yields the following error:

init.lua:11: SQLite3 CLI tool is missing. Expected the path to be C:\Users\korba\Documents\Rainmeter\Skins\Lauhdutin@Resources\sqlite3.exe

the sqlite3 bit is on line 10 & 11 in the lua file you indicated to try the change in

Do you have sqlite3.exe placed on the folder the error says?

humanspida commented 2 years ago

There is no sqlite3.exe in the resources folder, no. Is this something that should be present already or is this something I need to install/add myself?

I have Microsoft SQL Server installed on the system but no SQLite3 though

BanCrash commented 2 years ago

There is no sqlite3.exe in the resources folder, no. Is this something that should be present already or is this something I need to install/add myself?

https://github.com/Kapiainen/Lauhdutin#requirements

You should add itself, since it's from a third party it can't be included with the release. Download from the readme and place on that folder.

But if you already have been using GOG on a previous version you already should have it added. Are you using a fresh install? if so, go to your previous folder and copy the sqlite3 executable from there to the new folder.

humanspida commented 2 years ago

Gotcha, which of the options on that download page do I need to grab and plonk in place? Just the CLI Tools win32 zip right?

I had no previous version of GoG installed - this was a fresh, new install using the latest client installer obtained yesterday and the game installed today.

BanCrash commented 2 years ago

Gotcha, which of the options on that download page do I need to grab and plonk in place? I had no previous version of GoG installed - this was a fresh, new install using the latest client installer obtained yesterday and the game installed today.

From the readme:

NOTE: GOG Galaxy support requires the command-line tool sqlite3.exe, which can be downloaded [here](http://www.sqlite.org/download.html) as part of the sqlite-tools-win*.zip archive. The executable must be placed in Lauhdutin's @Resources folder.

humanspida commented 2 years ago

Perfect... fixed it up good and proper. Thanks very much for the assist. Much appreciated.

Plonk the SQLite3.exe in the @Resources folder and make the suggested change from "galaxy.db" to "galaxy-2.0.db" on line 9 and line 43 of the lua file in Documents\Rainmeter\Skins\Lauhdutin\@Resources\main\platforms\gog_galaxy\ - refresh skin and all is well.

It seems to always open the GoG Galaxy client window when I launch the game from Lauhdutin though, whether I have the "launch via client" option checked or not, kinda defeats the purpose of having a skin to launch the game if its just going to open the client window everytime regardless of my choice... It also resets the "launch via client" to checked when I restart lauhdutin.

Does this setting actually have anything to do with opening the client window (is it just how GoG operates, having the client open to launch the games, and is doing that on it's own, separate from lauhdutin?... I'm unfamiliar with the GoG client tbh) or is it just about allowing access to the client so things like the overlay work and time played can be kept track of... is it possible that can be fixed to stop the client window opening everytime a game is launched?

BanCrash commented 2 years ago

Perfect... fixed it up good and proper. Thanks very much for the assist. Much appreciated.

Glad it worked! Keep in mind that you will only have GOG games imported to Lauhdutin. Whatever other game that belongs to another platform added to GOG Galaxy 2.0 using an extension (Origin, Ubisoft, etc) will not get imported to Lauhdutin.

It seems to always open the GoG Galaxy client window when I launch the game from Lauhdutin though, whether I have the "launch via client" option checked or not, kinda defeats the purpose of having a skin to launch the game if its just going to open the client window everytime regardless of my choice... It also resets the "launch via client" to checked when I restart lauhdutin.

Could you confirm that you click on the Save button after changing the setting? If so, could you go to taskbar, right click on Rainmeter icon -> About -> and check the log tab to see if there is anything related to Settings.ini?

Does this setting actually have anything to do with opening the client window (is it just how GoG operates, having the client open to launch the games, and is doing that on it's own, separate from lauhdutin?... I'm unfamiliar with the GoG client tbh) or is it just about allowing access to the client so things like the overlay work and time played can be kept track of... is it possible that can be fixed to stop the client window opening everytime a game is launched?

Yes, if you have that setting disabled GOG client should not be launched.

humanspida commented 2 years ago

Yep, the other extension options I wont be using as I like to keep things like this separate from each other for some reason, brains says it must be so... and so it is : )

Can confirm I clicked save after unchecking the "launch via client" box before exiting Rainmeter and re-launching it - have repeated this process 3 or 4 times just to be sure. Always resets to enabled. The log doesn't show anything other than any refreshes of the skin unfortunately.

I did think that was the case, and should not be opening the client window before launching the game... yet it's persisting in opening the client before launching the game.

BanCrash commented 2 years ago

Can confirm I clicked save after unchecking the "launch via client" box before exiting Rainmeter and re-launching it - have repeated this process 3 or 4 times just to be sure. Always resets to enabled. The log doesn't show anything other than any refreshes of the skin unfortunately.

I don't understand why are you having such issue, so let's try to modificate setting.json directly. First unload all your Lauhdutin related skins, then go to your Lauhdutin skin folder -> @Resources -> Open settings.json with notepad++ or another editor and replace: "indirectLaunch":true with: "indirectLaunch":false

Save and close the file. After that, open Settings.ini, right click on it and click "Rebuild main slots": image

Last, open Main.ini, right click, "custom skin actions" and click on "Detect games". image

humanspida commented 2 years ago

OK, I've closed Rainmeter entirely and opened the settings json and made the change, and I've tried just unloading the skin and making the change - took me a minute to find the required bit coz my eyes aren't great and its all on a single line which makes things especially hard but I got there in the end...

You meant replace "false" with "true" for indirect launch, right?... coz we want it to be indirect. Made the change, saved and exited. Not that it matters an ocean-going-fur-lined-flying-fuck (technical term) because it ALWAYS gets overwritten and reset to "launch via client" or indirect launch:"false" for wotever reason when I reload the skin and open the settings or launch Rainmeter again and go to the settings.

I don't know what's going on here or how to stop that setting from being overwritten... I got nothin XD

BanCrash commented 2 years ago

OK, I've closed Rainmeter entirely and opened the settings json and made the change, and I've tried just unloading the skin and making the change - took me a minute to find the required bit coz my eyes aren't great and its all on a single line which makes things especially hard but I got there in the end...

You meant replace "false" with "true" for indirect launch, right?... coz we want it to be indirect. Made the change, saved and exited. Not that it matters an ocean-going-fur-lined-flying-fuck (technical term) because it ALWAYS gets overwritten and reset to "launch via client" or indirect launch:"false" for wotever reason when I reload the skin and open the settings or launch Rainmeter again and go to the settings.

I don't know what's going on here or how to stop that setting from being overwritten... I got nothin XD

Indirect launch should be false, if I understand you properly, you already have it set to false but when you open the skin it shows as enabled, is that right?

humanspida commented 2 years ago

Doesn't seem to matter what I do... have the "launch via client" checked or not, or the json set to false or not - it always launches the client window, kinda frustrating really. Currently have overcome the issue of it re-enabling the "launch via client" checkbox everytime I restart Rainmeter somewhow... And the json shows false when I open it in notepad++ but it's still opening the client window when I click on the game in the skin to launch it, s'weird to say the least.

Could it be the games launch process calling the client?... Although the game doesn't require the client to remain running. It's an indie game, and if I had to guess - one that probably isn't very well optimised with a somewhat limited development - theres no in game settings, it refuses to display if I force bordeless gaming upon it with Borderles Gaming app, and HATES not being focused while running (screens flicker when you alt+tab either from or to it, and it disappears/reappears, etc)

Unfortunately I dont currently have any other games on GoG to test so that will have to wait until something takes my fancy enough to want to install it first.

humanspida commented 2 years ago

So, I was poking about doing some googling and found something on a gog forum that says if you install via the client - it configures shortcuts to launch the game to always open the client first but I'm not 100% sure thats true in all situations...

I tried moving the original shortcut out of the game folder (leaving no shortcut in there), renaming it and creating a new shortcut to replace it... but lauhdutin still launches the client window. The shortcut in the game folder doesn't launch the client (unless my renaming and moving and then moving it back and reversing the rename broke that function somehow... I may uninstall the game and reinstall to double check this)... and running the Stasis.exe file from the game folder doesn't launch the GoG client either... is a pretty douchey thing to do if theyre configuring things to launch the client by default. The skin must be using some other method to access the game when it launches it that causes the client to be opened.

Is there any way to point the launcher tiles in lauhdutin for GoG Galaxy games to the .exe file instead of whatever it currently uses to launch the game thats forcing the client to be opened as well? The current call method even forces the client to start, connect, and open the window if you havent even got it running already in the background.

Sure you can download offline installers from either the website or the client and install without using the client - but then you're going to have to add each game to the skin individually instead of having it detect and add them by itself.

BanCrash commented 2 years ago

Hi again @humanspida , I think that Lauhdutin automatically detects the paths of the game and choose if it has to launch gog client using that setting I've told you, so I think it's just an issue with the setting at hand. I will test with the game that you said because I also had it.

But since this program is outdated and a lot of bugs are expected why don't you use something like Playnite?

BanCrash commented 2 years ago

@humanspida as I said, all the issue comes from your settings:

With the setting disabled: image

With the setting enabled: image

It seems that for some reason your skin is failing to write settings.json, maybe because some kind of antivirus/firewall?

humanspida commented 2 years ago

I dont use Playnite because by the looks of it from those screenshots, it is nothing like lauhdutin. Just another window based launcher, which is exactly what I'm trying to avoid - I just wanna have all my games installed and accessible from a single desktop embedded Rainmeter skin: Lauhdutin. There's nothing else that looks and behaves like lauhdutin.

All launchers become redundant when using Lauhdutin.

There is no indication that my AV / FW is preventing Rainmeter and Lauhdutin from doing anything, not showing any blocked or contained actions else it would block Lauhdutins ability to interact with my steam account and launch those games and choose settings for that as well.

So, your games run without launching the client when started from Lauhdutin no problem then?

If the issue is with my settings... and I have those set to NOT use the client both with the GUI, unchecked "launch via client" and in the JSON, indirect launch: false - why is it forcing the client still?

BanCrash commented 2 years ago

I dont use Playnite because by the looks of it from those screenshots, it is nothing like lauhdutin. Just another window based launcher, which is exactly what I'm trying to avoid - I just wanna have all my games installed and accessible from a single desktop embedded Rainmeter skin: Lauhdutin. There's nothing else that looks and behaves like lauhdutin.

I see, just saying because the original Lauhdutin have a lot of issues and is pretty outdated without support for other platforms. I liked it a lot and even I modified it to adapt to my liking but IMO it can't compite with other options that have a lot of support and features.

If the issue is with my settings... and I have those set to NOT use the client both with the GUI, unchecked "launch via client" and in the JSON, indirect launch: false - why is it forcing the client still?

If you json says "indirect launch: false" then you have to go to Lauhdutin Main.ini, right click, custom actions and detect games. It should launch the game without launching GOG after that.

humanspida commented 2 years ago

Yea, I like Lauhdutin a lot myself... despite the occasional issue that crops up. Its just so pretty and unobtrusive and (mostly) functional, aside from the odd hiccup/glitch... Thankfully, us die hard users have wonderful people like you still providing support and helping us work out which sort of stupid we were exhibiting and guide us to circumventing our idiocy, at least temporarily :D

You Sir, are a genius gentleman and scholar... THAT, was the crucial missing step to unfuck the final conundrum that was stumping me and persisting with launching the client, re-detecting the games AFTER doing all the other suggested things FINALLY got it doing things the way it oughta be.

Thankyou for being patient with me and for assisting me with facilitating the fix to get it working smooth-like.

Have you got a more up to date fork, with all your adjustments and fixes implemented in your repo list that you're maintaining?... Obviously your updates and fixes cant be added to the original unless the owner chooses to merge them into their build and these days it's had the feel of an abandoned project.

Now I've got it all fixed up and working properly again, with all me stuff added - I think I'll bundle the whole Rainmeter folder with everything contained inside into an archive (and keep it updated) so if I need to, I can just install Steam & GoG Galaxy + games, Rainmeter, and Python... then dump the contents of my archive into the fresh install folder, launch Rainmeter and redetect games to save screwing around in future.

BanCrash commented 2 years ago

Yea, I like Lauhdutin a lot myself... despite the occasional issue that crops up. Its just so pretty and unobtrusive and (mostly) functional, aside from the odd hiccup/glitch... Thankfully, us die hard users have wonderful people like you still providing support and helping us work out which sort of stupid we were exhibiting and guide us to circumventing our idiocy, at least temporarily :D

You Sir, are a genius gentleman and scholar... THAT, was the crucial missing step to unfuck the final conundrum that was stumping me and persisting with launching the client, re-detecting the games AFTER doing all the other suggested things FINALLY got it doing things the way it oughta be.

No problem, it's normal that on the beginning you don't have any idea of how things works, if you continue using Lauhdutin you will eventually know it :)

Glad to help!

About my fork, all I can offer is the open PR #166 , I focused more on adding features than on stability and because of that my mod is not very functional, and also is already abandoned since I'm on process of migrating myself to Playnite. Also I can't release in its actual state because it has some dependencies that shouldn't be included directly, and other stuff that must be removed before releasing. I should figure it out what stuff needs to go to the gitignore but I don't remember. I was reckless at the begining and now I'm paying the price :/