Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GOG compatability archive not applied correctly #162

Closed
drojf opened this issue Aug 18, 2021 · 1 comment
Closed

GOG compatability archive not applied correctly #162

drojf opened this issue Aug 18, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@drojf
Copy link
Collaborator

drojf commented Aug 18, 2021

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 drojf added the bug Something isn't working label Aug 18, 2021
drojf added a commit that referenced this issue Sep 18, 2021
 - move any files in archives which are not in the "Higurashi_Ep0X" into the game directory, keeping the same folder structure as in the archive file
drojf added a commit that referenced this issue Sep 19, 2021
 - move any files in archives which are not in the "Higurashi_Ep0X" into the game directory, keeping the same folder structure as in the archive file
@drojf
Copy link
Collaborator Author

drojf commented Sep 19, 2021

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.

@drojf drojf closed this as completed Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant