Skip to content

Commit 25d191e

Browse files
authored
Merge pull request #131 from Kapiainen/galaxy-database-merger
Updated GOG Galaxy support
2 parents 92c5482 + 8e4797e commit 25d191e

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
**Version 3.0.2 - 2018/05/30:**
2+
- Updated to support the latest version of GOG Galaxy.
3+
14
**Version 3.0.1 - 2018/05/26:**
25
- Fixed the manner in which arguments of Windows shortcuts are parsed.
36

dist/@Resources/main/platforms/gog_galaxy/dumpDatabases.bat

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ set "galaxy="%cd%\galaxy.txt""
1313
if exist %galaxy% del %galaxy%
1414
cd ..\..\
1515
set "sqlite="%cd%\sqlite3.exe""
16-
start /B "" %sqlite% %1 "select productId, localpath from Products;" > %index%
16+
:: index.db has been removed and the data has been moved into galaxy.db.
17+
:: This is just to support the scenarios where the client has not been
18+
:: updated and where the client has been updated.
19+
if exist %1 (
20+
start /B "" %sqlite% %1 "select productId, localpath from Products;" > %index%
21+
) else (
22+
start /B "" %sqlite% %2 "select productId, installationPath from InstalledBaseProducts;" > %index%
23+
)
1724
start /B "" %sqlite% %2 "select productId, title, images from LimitedDetails;" > %galaxy%
1825
echo "" > %completed%
1926
::pause

dist/@Resources/main/platforms/gog_galaxy/init.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ do
77
local _parent_0 = Platform
88
local _base_0 = {
99
validate = function(self)
10-
assert(io.fileExists(io.joinPaths(self.programDataPath, 'storage\\index.db'), false), 'The path to GOG Galaxy\'s ProgramData directory is not valid.')
11-
assert(io.fileExists(io.joinPaths(self.programDataPath, 'storage\\index.db'), false), 'The path to GOG Galaxy\'s ProgramData directory is not valid.')
10+
assert(io.fileExists(io.joinPaths(self.programDataPath, 'storage\\galaxy.db'), false), 'The path to GOG Galaxy\'s ProgramData directory is not valid.')
1211
if self.clientPath ~= nil then
1312
self.clientPath = io.joinPaths(self.clientPath, 'GalaxyClient.exe')
1413
if self.indirectLaunch then
@@ -28,7 +27,6 @@ do
2827
assert(self.programDataPath ~= nil, 'The path to GOG Galaxy\'s ProgramData path has not been defined.')
2928
local indexDBPath = io.joinPaths(self.programDataPath, 'storage\\index.db')
3029
local galaxyDBPath = io.joinPaths(self.programDataPath, 'storage\\galaxy.db')
31-
assert(io.fileExists(indexDBPath, false) == true, ('"%s" does not exist.'):format(indexDBPath))
3230
assert(io.fileExists(galaxyDBPath, false) == true, ('"%s" does not exist.'):format(galaxyDBPath))
3331
local sqlitePath = io.joinPaths(STATE.PATHS.RESOURCES, 'sqlite3.exe')
3432
assert(io.fileExists(sqlitePath, false) == true, ('SQLite3 CLI tool is missing. Expected the path to be "%s".'):format(sqlitePath))

dist/Main.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Name=Lauhdutin
33
Author=Kapiainen
44
Information=A game launcher with support for various digital distribution platforms.
5-
Version=3.0.1
5+
Version=3.0.2
66
License=MIT
77

88
[Rainmeter]

src/main/platforms/gog_galaxy/init.moon

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ Platform = require('main.platforms.platform')
22
Game = require('main.game')
33
json = require('lib.json')
44

5-
-- Dump "productId" and "localpath" columns from the "Products" table of "index.db":
6-
-- - productId: Unique ID associated with a game.
7-
-- - localpath: The absolute path to the folder containing the game.
5+
-- New version
6+
-- Dump "productId" and "installationPath" columns from the "InstalledBaseProducts" table of "galaxy.db":
7+
-- - productId: Unique ID associated with a game.
8+
-- - installationPath: The absolute path to the folder containing the game.
9+
-- Old version
10+
-- Dump "productId" and "localpath" columns from the "Products" table of "index.db":
11+
-- - productId: Unique ID associated with a game.
12+
-- - localpath: The absolute path to the folder containing the game.
813
--
914
-- Dump "productId", "title", and "images" columns from the "LimitedDetails" table of "galaxy.db"
1015
-- - productId: Same as above.
@@ -31,8 +36,7 @@ class GOGGalaxy extends Platform
3136
@games = {}
3237

3338
validate: () =>
34-
assert(io.fileExists(io.joinPaths(@programDataPath, 'storage\\index.db'), false), 'The path to GOG Galaxy\'s ProgramData directory is not valid.')
35-
assert(io.fileExists(io.joinPaths(@programDataPath, 'storage\\index.db'), false), 'The path to GOG Galaxy\'s ProgramData directory is not valid.')
39+
assert(io.fileExists(io.joinPaths(@programDataPath, 'storage\\galaxy.db'), false), 'The path to GOG Galaxy\'s ProgramData directory is not valid.')
3640
if @clientPath ~= nil
3741
@clientPath = io.joinPaths(@clientPath, 'GalaxyClient.exe')
3842
if @indirectLaunch
@@ -48,7 +52,6 @@ class GOGGalaxy extends Platform
4852
assert(@programDataPath ~= nil, 'The path to GOG Galaxy\'s ProgramData path has not been defined.')
4953
indexDBPath = io.joinPaths(@programDataPath, 'storage\\index.db')
5054
galaxyDBPath = io.joinPaths(@programDataPath, 'storage\\galaxy.db')
51-
assert(io.fileExists(indexDBPath, false) == true, ('"%s" does not exist.')\format(indexDBPath))
5255
assert(io.fileExists(galaxyDBPath, false) == true, ('"%s" does not exist.')\format(galaxyDBPath))
5356
sqlitePath = io.joinPaths(STATE.PATHS.RESOURCES, 'sqlite3.exe')
5457
assert(io.fileExists(sqlitePath, false) == true, ('SQLite3 CLI tool is missing. Expected the path to be "%s".')\format(sqlitePath))

0 commit comments

Comments
 (0)