07th-mod/python-patcher

GOG compatability archive not applied correctly

drojf opened this issue · 1 comments

drojf commented

We had an issue here: 07th-mod/matsuribayashi#32 whose root cause was that the GOG compatability archive was not properly applied to the game (the files were not copied over/into the game folder)

The issue seems to be the moveFilesIntoPlace function. This function is mainly used on MacOS and Linux, as on those OSs we first extract all the archives to a temporary folder, then we "move files into place" from that temporary folder to the game folder.

The way we do this is as below:

def moveFilesIntoPlace(self):
"""
Moves files from the directory they were extracted to
to the game data folder
"""
self._moveDirectoryIntoPlace(
fromDir = os.path.join(self.extractDir, self.info.subModConfig.dataName),
toDir = self.dataDirectory
)
if common.Globals.IS_WINDOWS:
exePath = self.info.subModConfig.dataName[:-5] + ".exe"
self._moveFileIntoPlace(
fromPath = os.path.join(self.extractDir, exePath),
toPath = os.path.join(self.directory, exePath),
)
elif common.Globals.IS_MAC:
self._moveFileIntoPlace(
fromPath = os.path.join(self.extractDir, "Contents/Resources/PlayerIcon.icns"),
toPath = os.path.join(self.directory, "Contents/Resources/PlayerIcon.icns")
)

We first move the contents of the data directory (the HigurashiEp08_Data folder), then if there is anything outside the data directory that we need to move, we take care of that manually. This is because the data directory is different on MacOS, and some special handling is done for the data directory, while the other files are copied "as is".

The problem is that the GOG compatibility archive has some files outside of the data directory - the executables and some .so files. These files wouldn't be copied.

There is also no sanity check that the temp folder is empty before it is deleted, which would have made the install fail more obviously.

This can probably be fixed by copying any files that remain directly into the game root.

drojf commented

Had a user with this problem test the latest release https://github.com/07th-mod/python-patcher/releases/tag/v1.1.91-force-build, and it fixed the issue.