GameLib.NET icon indicating copy to clipboard operation
GameLib.NET copied to clipboard

Fix ArgumentException when GOG game has no EXE path specified

Open Tudzer opened this issue 2 years ago • 1 comments

I've encountered a case when GOG game registry entry (Cyberpank 2077 - EP1) has no executable path specified, as it's not a base game. The plugin uses string.Empty as default values when some registry value is not specified, but string.Empty is not a valid argument for Path.GetDirectoryName and will lead to unhandled ArgumentException being thrown by NormalizePath method.

Tudzer avatar Nov 11 '23 08:11 Tudzer

Here is a full dump of that registry entry in case you are interested:

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GOG.com\Games\1256837418]
"gameName"="Cyberpunk 2077 - EP1"
"gameID"="1256837418"
"productID"="1256837418"
"language"="english"
"lang_code"="en-US"
"path"="C:\\Games\\Cyberpunk 2077"
"startMenu"="Cyberpunk 2077 - EP1"
"ver"="2.0_PhL"
"uninstallCommand"="C:\\Games\\Cyberpunk 2077\\unins001.exe"
"dependsOn"="1423049311"
"supportLink"=""
"BUILDID"="56896837368890911"
"INSTALLDATE"="2023-09-27 15:18:00"

Tudzer avatar Nov 11 '23 08:11 Tudzer