Okay, here goes nothing.
I am to figure out a way to get the a game install path from the libraryfolder.vdf and appmanifest_xxx.acf files from Steam.
How it's supposed to work is
1) I get the install folder for Steam itself from the registry,
2) I get the libraryfolder.vdf file based off of that folder, read it and get a list of the steam library folders, which also has a list of the apps installed for those folders.
3) try to match app number such and such, and then try and see the steam library folder where the manifest is to
4) open it, get the installdir of the game from it and then
5) put the entire thing into the $INSTALLDIR of the installer.
I am stuck on part 3) where I try to get the path of the where the game is installed based on the app number.
Get steam library path from libraryfolders.vdf
4 posts
The libraryfolder file looks something like this:
e.g. What I want to do is find the path of the app number 34567"0"
{"path" "path to library here"...
...
"apps" {"12345" "some numbers"
"23456" "some numbers"}}
"1"
{"path" "path to library here"
...
...
"apps" {"34567" "some numbers"
"45678" "some numbers"}}
There is a JSON plug-in but the text you posted is not quite JSON format so I doubt it will work (apparently it's called Valve Data Format). You can use the basic nsis file functions but that is a lot of work, perhaps it would be better to execute an external tool with ExecWait or nsExec (perhaps convert the python vdf thing to a .exe)...
- developer.valvesoftware.com/wiki/KeyValues
- pypi.org/project/vdf/
- github.com/constup/vdf-converter-powershell
- developer.valvesoftware.com/wiki/KeyValues
- pypi.org/project/vdf/
- github.com/constup/vdf-converter-powershell
I tried to use this
https://nsis.sourceforge.io/Get_Text...es_(VDF)_Files
like so:
${ReadVDFStr} $R0 "$SteamLibraryfoldersPath" "1>path"
but it doesn't seem to do anything.
I got it kinda working by using this instead
${ReadVDFStr} $R0 "$SteamLibraryfoldersPath" "libraryfolders>1>path"
https://nsis.sourceforge.io/Get_Text...es_(VDF)_Files
like so:
${ReadVDFStr} $R0 "$SteamLibraryfoldersPath" "1>path"
but it doesn't seem to do anything.
I got it kinda working by using this instead
${ReadVDFStr} $R0 "$SteamLibraryfoldersPath" "libraryfolders>1>path"