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

Getting supported languages with innoextract can fail silently #627

Open
sharkwouter opened this issue Dec 5, 2024 · 6 comments
Open

Getting supported languages with innoextract can fail silently #627

sharkwouter opened this issue Dec 5, 2024 · 6 comments

Comments

@sharkwouter
Copy link
Owner

sharkwouter commented Dec 5, 2024

The return code of the application is never checked and neither is the stderr:

def lang_install(installer: str, language: str):
languages = []
arg = ""
process = subprocess.Popen(["innoextract", installer, "--list-languages"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
output = stdout.decode("utf-8")
for line in output.split('\n'):
if not line.startswith(' -'):
continue
languages.append(line[3:])
for lang in languages:
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

@GB609
Copy link
Collaborator

GB609 commented Dec 10, 2024

I'll include this in my wine rework branch, since i have to touch this part of the code anyway to fix issues with innoextract.

@sharkwouter
Copy link
Owner Author

I think it would be better to have this in a separate PR.

@GB609
Copy link
Collaborator

GB609 commented Dec 10, 2024

OK. I'll leave it out. Might need another addition afterwards to get the automatic language selection during installation to work.

@sharkwouter
Copy link
Owner Author

Yeah, that is true, but it would be nice to merge the current MR as soon as possible. For that we need to keep it focused. Smaller PRs are much easier and faster to review.

@GB609
Copy link
Collaborator

GB609 commented Dec 10, 2024

I've only got 2 more failing test cases atm and these are related to innoextract and lang_install.

@sharkwouter
Copy link
Owner Author

Ah okay, let me know if you need any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants