It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
diziet_sma: hi sude

this is a feature request:
i notice that my wallace and gromit adventures episodes are downloaded as separate games, if the gamespecific config could specify the download sub directory i could keep them and any other games that download like that in a single directory
avatar
Sude: Good idea. I'll try to work on this when I have some free time.
Does anyone know if this happens with all episodic games on GOG?
Well, sadly, yes.

Some games ( dashes are the folder names)
() American McGees Grimm
- american_mcgees_grimm_season_1
- american_mcgees_grimm_season_2
- american_mcgees_grimm_season_3

() Cognition - An Erica Reed game
- cognition_episode_1_the_hangman
- cognition_episode_2_the_wise_monkey
- cognition_episode_4_the_cain_killer

() Wallace & Gromit
- episode_1_fright_of_the_bumblebees (yes, the folder name starts with episode...)
- episode_2_the_last_resort
- episode_3_muzzled
- episode_4_the_bogey_man

() Blackwell series
- episode_1_the_blackwell_legacy (yes, the folder name starts with episode...)
- episode_2_blackwell_unbound
- episode_3_blackwell_convergence
- episode_4_blackwell_deception


() Heroes Chronicles (Heroes of Might & Magic Spin-Off)
- heroes_chronicles_chapter_1_warlords_of_the_wasteland
- heroes_chronicles_chapter_2_conquest_of_the_underworld
- heroes_chronicles_chapter_3_masters_of_the_elements
- heroes_chronicles_chapter_4_clash_of_the_dragons
- heroes_chronicles_chapter_5_the_world_tree
- heroes_chronicles_chapter_6_the_fiery_moon
- heroes_chronicles_chapter_7_revolt_of_the_beastmasters
- heroes_chronicles_chapter_8_the_sword_of_frost


() Supreme League of Patriots
- supreme_league_of_patriots_episode_1
- supreme_league_of_patriots_episode_2
- supreme_league_of_patriots_episode_3

It would be neat, if there is some sort of option and a configuration file like the blacklist, where one can bundle these games into one folder (don't forget to parse the configuration file not only on downloading).



btw CentOS 7.2 does not have CMake 3.14, only 2.98. The makefile won't even start if you don't compile cmake for yourself ... is 3.14 for compiling lgogdownloader really necessary?
avatar
Sude: It looks like the Mageia package for jsoncpp doesn't include pkg-config module.
http://sophie.zarb.org/rpms/bd101116f928b2ceb5c9a929b33f1ee3/files
And "pkg_check_modules" in FindJsoncpp.cmake is set to require it.

Try changing

pkg_check_modules(PC_JSONCPP REQUIRED jsoncpp)
avatar
Sude: in cmake/FindJsoncpp.cmake to

pkg_check_modules(PC_JSONCPP jsoncpp)
avatar
Sude: Does this fix the issue?
after making the change to CMakeLists.txt and the edit you suggest i get:

[diziet@localhost build]$ make
Scanning dependencies of target lgogdownloader
[ 11%] Building CXX object CMakeFiles/lgogdownloader.dir/main.cpp.o
In file included from /home/diziet/downloads/lgogdownloader-master/include/gamedetails.h:5:0,
from /home/diziet/downloads/lgogdownloader-master/include/api.h:11,
from /home/diziet/downloads/lgogdownloader-master/include/downloader.h:25,
from /home/diziet/downloads/lgogdownloader-master/main.cpp:7:
/home/diziet/downloads/lgogdownloader-master/include/gamefile.h:8:23: fatal error: json/json.h: No such file or directory
#include <json/json.h>

the previous cmake .. runs but in the output is listed:
-- Found PkgConfig: /bin/pkg-config (found version "0.28")
-- checking for module 'oauth'
-- found oauth, version 1.0.3
-- checking for module 'jsoncpp'
-- package 'jsoncpp' not found
-- checking for module 'htmlcxx'
-- found htmlcxx, version 0.84
-- checking for module 'tinyxml'
-- found tinyxml, version 2.6.2
-- Configuring done

perhaps i should put this as a bug in the mageia jsoncpp rpm?

diziet
avatar
Sude: Good idea. I'll try to work on this when I have some free time.
Does anyone know if this happens with all episodic games on GOG?
avatar
coffeecup: Well, sadly, yes.

It would be neat, if there is some sort of option and a configuration file like the blacklist, where one can bundle these games into one folder (don't forget to parse the configuration file not only on downloading).
Well that's annoying. I'll either make a separate config file to override it or just add it as an option in game specific config file.

avatar
coffeecup: btw CentOS 7.2 does not have CMake 3.14, only 2.98. The makefile won't even start if you don't compile cmake for yourself ... is 3.14 for compiling lgogdownloader really necessary?
Probably not. I've changed the minimum to 2.8.12 in e00bb4d. I haven't actually tested it yet to make sure that it works on that version but I looked at the cmake release notes and I didn't notice anything that would require newer than 2.8.12. So it should work unless I missed something in there.
avatar
Sude: Probably not. I've changed the minimum to 2.8.12 in e00bb4d. I haven't actually tested it yet to make sure that it works on that version but I looked at the cmake release notes and I didn't notice anything that would require newer than 2.8.12. So it should work unless I missed something in there.
hi sude,

after googling i played with making a /usr/lib64/pkgconfig/jsonccp.pc file by hand, i got some errors (though the cmake found jsoncpp apparently), so i decided to up to your latest version and got the following:

diziet@localhost build]$ cmake ..
CMake Error at CMakeLists.txt:2 (project):
VERSION not allowed unless CMP0048 is set to NEW

-- Configuring incomplete, errors occurred!

my version of cmake is cmake-3.0.2-1.1.mga5

diziet


edit:
after changing the version in CmakeLists.txt again that error went away, i did try reading the following:
https://cmake.org/cmake/help/v3.0/policy/CMP0048.html

and:
https://cmake.org/cmake/help/v3.0/manual/cmake-policies.7.html

but this is all over my head:)

the jsoncpp.pc i created in /usr/lib64/pkgconfig is:
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: Jsoncpp
Description: Development files for jsoncpp
Version: 1.6.5
Libs: -L${libdir} -ljsoncpp
Cflags: -I${includedir}/jsoncpp

and now i get a lot of errors which may or may not be due to my making a jsoncpp.pc, not sure what constitutes error versus warning so i have put the output of make into pastebin:
http://pastebin.com/Z3QLa3eU

(hope i used that right:) )
Post edited February 15, 2016 by diziet_sma
avatar
Sude: Probably not. I've changed the minimum to 2.8.12 in e00bb4d. I haven't actually tested it yet to make sure that it works on that version but I looked at the cmake release notes and I didn't notice anything that would require newer than 2.8.12. So it should work unless I missed something in there.
avatar
diziet_sma: hi sude,

after googling i played with making a /usr/lib64/pkgconfig/jsonccp.pc file by hand, i got some errors (though the cmake found jsoncpp apparently), so i decided to up to your latest version and got the following:

diziet@localhost build]$ cmake ..
CMake Error at CMakeLists.txt:2 (project):
VERSION not allowed unless CMP0048 is set to NEW

-- Configuring incomplete, errors occurred!

my version of cmake is cmake-3.0.2-1.1.mga5

diziet
Apparently I missed a few things when I read the CMake changes and 3.1.0 is the minimum required version because CXX_STANDARD property was introduced in that version.
I think I could lower the minimum required version to 3.0.0 by not using the CXX_STANDARD property and adding -std=c++11 to CFLAGS.

avatar
diziet_sma: edit:
after changing the version in CmakeLists.txt again that error went away, i did try reading the following:
https://cmake.org/cmake/help/v3.0/policy/CMP0048.html

and:
https://cmake.org/cmake/help/v3.0/manual/cmake-policies.7.html

but this is all over my head:)

the jsoncpp.pc i created in /usr/lib64/pkgconfig is:
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: Jsoncpp
Description: Development files for jsoncpp
Version: 1.6.5
Libs: -L${libdir} -ljsoncpp
Cflags: -I${includedir}/jsoncpp

and now i get a lot of errors which may or may not be due to my making a jsoncpp.pc, not sure what constitutes error versus warning so i have put the output of make into pastebin:
http://pastebin.com/Z3QLa3eU

(hope i used that right:) )
Most of the errors seem to be caused by c++11 features.
You can try to fix it by changing

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic -fexceptions")
to
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-long-long -pedantic -fexceptions")
I'll install Mageia to VM and see if I can make it work. In the meantime you should be able to compile it by using the old Makefile
https://raw.githubusercontent.com/Sude-/lgogdownloader/8780b9c53cf7e5cfb6f4d2f66aa42131fb66d0e1/Makefile
avatar
Sude: Most of the errors seem to be caused by c++11 features.
You can try to fix it by changing

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic -fexceptions")
avatar
Sude: to

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-long-long -pedantic -fexceptions")
avatar
Sude:
ok, that last change seems to have done the trick so i never tried the old makefile

diziet
4d4aaa1 Improve game specific config options

"platform" and "language" options allow using string to set them.
This allows user to set them more easily without needing to calculate the sum of integer values and makes the config easier to understand later.
For example: this allows setting "language" to English, German and French with "en+de+fr" which is much easier to understand than setting it to "7".

Directory options can be overridden using game specific config file
New options in game specific config file:
- "subdirectories" - <bool>
- "directory" - <string>
- "subdir-game" - <string>
- "subdir-installers" - <string>
- "subdir-extras" - <string>
- "subdir-patches" - <string>
- "subdir-language-packs" - <string>
- "subdir-dlc" - <string>




I don't have any episodic games so I haven't been able to test this

Downloading all episodes of Cognition to "cognition/episode_name"

Create game specific config file for each episode to "$XDG_CONFIG_HOME/lgogdownloader/gamespecific/"
cognition_episode_1_the_hangman.conf
cognition_episode_2_the_wise_monkey.conf
cognition_episode_4_the_cain_killer.conf

All of them should contain

{
"subdir-game": "cognition/%gamename%"
}
avatar
Sude: Apparently I missed a few things when I read the CMake changes and 3.1.0 is the minimum required version because CXX_STANDARD property was introduced in that version.
I think I could lower the minimum required version to 3.0.0 by not using the CXX_STANDARD property and adding -std=c++11 to CFLAGS.
Lowering the required CMake version to 3.0.0 would be nice as Debian stable also only has CMake 3.0.2 and building lgogdownloader out of the box fails on it now.

Changing the cmake minimum required version to 3.0.0 and adding "-std=c++11" to CMAKE_CXX_FLAGS fixes the build on Debian stable for me. The build succeeds but still gives me several warnings about forbidden variable length arrays like:

lgogdownloader/src/util.cpp:61:56: warning: ISO C++ forbids variable length array ‘digest’ [-Wvla]
unsigned char digest[rhash_get_digest_size(hash_id)];

and about extra semicolons after braces like:

In file included from lgogdownloader/include/api.h:10:0,
from lgogdownloader/src/api.cpp:7:
lgogdownloader/include/globalconstants.h:77:2: warning: extra ‘;’ [-Wpedantic]
};

I haven't tested the resulting binary yet.

Versions:
lgogdownloader 4d4aaa1792c52b665235e7c1f0538f8cc63d6981
cmake 3.0.2
g++ 4.9.2
Post edited February 16, 2016 by eiii
avatar
eiii: Lowering the required CMake version to 3.0.0 would be nice as Debian stable also only has CMake 3.0.2 and building lgogdownloader out of the box fails on it now.

Changing the cmake minimum required version to 3.0.0 and adding "-std=c++11" to CMAKE_CXX_FLAGS fixes the build on Debian stable for me. The build succeeds but still gives me several warnings about forbidden variable length arrays like:

lgogdownloader/src/util.cpp:61:56: warning: ISO C++ forbids variable length array ‘digest’ [-Wvla]
unsigned char digest[rhash_get_digest_size(hash_id)];

and about extra semicolons after braces like:

In file included from lgogdownloader/include/api.h:10:0,
from lgogdownloader/src/api.cpp:7:
lgogdownloader/include/globalconstants.h:77:2: warning: extra ‘;’ [-Wpedantic]
};

I haven't tested the resulting binary yet.

Versions:
lgogdownloader 4d4aaa1792c52b665235e7c1f0538f8cc63d6981
cmake 3.0.2
g++ 4.9.2
Those warnings are caused by -Wpedantic, I've removed that from CXX_FLAGS now.
lgogdownloader/src/util.cpp:61:56: warning: ISO C++ forbids variable length array ‘digest’ [-Wvla]
This looks like it could cause some issues but seems to work fine for now.

84aeaa6 CMake: lower the required version to 3.0.0
avatar
Sude: Good idea. I'll try to work on this when I have some free time.
Does anyone know if this happens with all episodic games on GOG?
avatar
coffeecup: Well, sadly, yes.

<snip>
Even worse, it's actually not all episodic games. Dreamfall Chapters is one example where there is only a single installer that gets updated with each new chapter. There may be others.
avatar
Sude: Those warnings are caused by -Wpedantic, I've removed that from CXX_FLAGS now.

lgogdownloader/src/util.cpp:61:56: warning: ISO C++ forbids variable length array ‘digest’ [-Wvla]
avatar
Sude: This looks like it could cause some issues but seems to work fine for now.
I wasn't concerned about the extra semicolons, but wasn't sure about the variable length arrays.

avatar
Sude: 84aeaa6 CMake: lower the required version to 3.0.0
That was fast. Thanks!
fast work sude!

is it worth compiling a list of episodic games that don't install into one folder and including a set of game specific confs for them in the source?

i'm afraid the only ones i think i have are the ones others have mentioned which are the wallace and gromit ones

diziet
EDIT 2018/09/23:
for new and current building instructions (and less library compiling) see
https://gist.github.com/shakeyourbunny/33e228844bd04e5ca6ce750cc287c24d#file-building_and_compiling_lgogdownloader_on_centos_7-txt


------------------

Thank for your work, sude.

BTW, if anyone wants to compile lgogdownloader on CentOS, a small recipe:

Get a binary distribution (or compile it for yourself) of CMake 3 at https://cmake.org/download/; put it somewhere distinct from the rest of the OS, like in /opt or /usr/local

(based on http://xmodulo.com/download-gog-games-command-line-linux.html, for more detailed instructions see the web page)

Get prerequisites:

- Packages:
yum install tinyxml-devel jsoncpp-devel liboauth-devel libcurl-devel boost-devel help2man

- Libraries:
rhash: https://sourceforge.net/projects/rhash/files/rhash/
htmlcxx: https://sourceforge.net/projects/htmlcxx/

- Build rhash:
make; make lib-shared lib-static; sudo make install-lib-shared install-lib-static

- Build htmlcxx:
./configure
vi html/tree.h -- add #include "<cstddef>" at about line 53, if it's not present
make
-- as root --
make install
vi /etc/ld.so.conf.d/usrlocal.conf -- add the lines /usr/local/lib and /usr/local/lib64
ldconfig
ln -s /usr/local/lib/pkgconfig/htmlcxx.pc /usr/lib64/pkgconfig/htmlcxx.pc

go in the build directory of lgogdownloader and follow the build instructions for lgogdownloader (use the full path for cmake 3).
Post edited September 23, 2018 by coffeecup
avatar
Sude: Directory options can be overridden using game specific config file
New options in game specific config file:
- "subdirectories" - <bool>
- "directory" - <string>
- "subdir-game" - <string>
- "subdir-installers" - <string>
- "subdir-extras" - <string>
- "subdir-patches" - <string>
- "subdir-language-packs" - <string>
- "subdir-dlc" - <string>
Is it possible to tweak the game specific settings to completely rename a game base directory, eg "an_elder_scrolls_legend_battlespire_game" -> "elder_scrolls_battlespire", so that the game files (installer, extra directory) are created under the new renamed folder?

an_elder_scrolls_legend_battlespire_game.conf
{
"directory": "elder_scrolls_battlespire"
"subdir-game": "."
}

This configuration creates the desired download folder, but in addition, another subfolder with the original folder name is also created? How can I suppress that?
avatar
coffeecup: Is it possible to tweak the game specific settings to completely rename a game base directory, eg "an_elder_scrolls_legend_battlespire_game" -> "elder_scrolls_battlespire", so that the game files (installer, extra directory) are created under the new renamed folder?

an_elder_scrolls_legend_battlespire_game.conf
{
"directory": "elder_scrolls_battlespire"
"subdir-game": "."
}

This configuration creates the desired download folder, but in addition, another subfolder with the original folder name is also created? How can I suppress that?
That seems to be missing a comma after the directory line. The downloader should give a json parsing error on that.
This should work. Or at least this worked for me when I tested it with another game.

an_elder_scrolls_legend_battlespire_game.conf
{
"directory": "elder_scrolls_battlespire",
"subdir-game": "."
}


Alternatively you can just use the "subdir-game" option.

an_elder_scrolls_legend_battlespire_game.conf
{
"subdir-game": "elder_scrolls_battlespire"
}