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

critical bug fix in installer #629

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions minigalaxy/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,17 @@ def _exe_cmd(cmd, print_output=False):
print(data, end='')
time.sleep(0.01)

# there might some lines left in the buffer, get them all
data = process.stdout.readlines()
std_out += ''.join(data)
if print_output:
print(data, end='')

data = process.stderr.readlines()
std_err += ''.join(data)
if print_output:
print(data, end='')

process.stdout.close()
process.stderr.close()

Expand All @@ -425,20 +436,17 @@ def _mv(source_dir, target_dir):
# "--list-languages" option returns "en-US", "fr-FR" etc... for these games.
# Others installers return "French : Français" but disallow to choose game's language before installation
def lang_install(installer: str, language: str):
languages = []
arg = ""
arg = "--language=en-US"
stdout, stderr, ret_code = _exe_cmd(["innoextract", installer, "--list-languages"])

for line in stdout.split('\n'):
if not line.startswith(' -'):
continue
languages.append(line[3:])
for lang in languages:

lang = line[3:]
if "-" in lang: # lang must be like "en-US" only.
if language == lang[0:2]:
arg = "--language={}".format(lang)
break
else:
arg = "--language=en-US"
break

return arg
Loading