mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[core] Fix pre-installation warnings
- Make errors unique - FNA/XNA games don't seem to really work with WINE.
This commit is contained in:
parent
209ba2dd81
commit
6e5e281c82
|
@ -441,23 +441,23 @@ class LegendaryCore:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_installation_conditions(analysis: AnalysisResult, install: InstalledGame) -> ConditionCheckResult:
|
def check_installation_conditions(analysis: AnalysisResult, install: InstalledGame) -> ConditionCheckResult:
|
||||||
# ToDo add more checks in the future
|
# ToDo add more checks in the future
|
||||||
results = ConditionCheckResult(failures=list(), warnings=list())
|
results = ConditionCheckResult(failures=set(), warnings=set())
|
||||||
|
|
||||||
# if on linux, check for eac in the files
|
# if on linux, check for eac in the files
|
||||||
if os.name != 'nt':
|
if os.name != 'nt':
|
||||||
for f in analysis.manifest_comparison.added:
|
for f in analysis.manifest_comparison.added:
|
||||||
flower = f.lower()
|
flower = f.lower()
|
||||||
if 'easyanticheat' in flower:
|
if 'easyanticheat' in flower:
|
||||||
results.warnings.append('(Linux) The game uses EasyAntiCheat and may not run on linux')
|
results.warnings.add('(Linux) This game uses EasyAntiCheat and may not run on linux')
|
||||||
elif 'beclient' in flower:
|
elif 'beclient' in flower:
|
||||||
results.warnings.append('(Linux) The game uses BattlEye and may not run on linux')
|
results.warnings.add('(Linux) This game uses BattlEye and may not run on linux')
|
||||||
elif 'beclient' in flower:
|
elif flower == 'fna.dll' or flower == 'xna.dll':
|
||||||
results.warnings.append('(Linux) The game uses BattlEye and may not run on linux')
|
results.warnings.add('(Linux) This game is using XNA/FNA and may not run through WINE')
|
||||||
|
|
||||||
if install.requires_ot:
|
if install.requires_ot:
|
||||||
results.warnings.append('This game requires an ownership verification token and likely uses Denuvo DRM.')
|
results.warnings.add('This game requires an ownership verification token and likely uses Denuvo DRM.')
|
||||||
if not install.can_run_offline:
|
if not install.can_run_offline:
|
||||||
results.warnings.append('This game is not marked for offline use (may still work).')
|
results.warnings.add('This game is not marked for offline use (may still work).')
|
||||||
|
|
||||||
# check if enough disk space is free (dl size is the approximate amount the installation will grow)
|
# check if enough disk space is free (dl size is the approximate amount the installation will grow)
|
||||||
min_disk_space = analysis.uncompressed_dl_size + analysis.biggest_file_size
|
min_disk_space = analysis.uncompressed_dl_size + analysis.biggest_file_size
|
||||||
|
@ -465,7 +465,7 @@ class LegendaryCore:
|
||||||
if free < min_disk_space:
|
if free < min_disk_space:
|
||||||
free_mib = free / 1024 / 1024
|
free_mib = free / 1024 / 1024
|
||||||
required_mib = min_disk_space / 1024 / 1024
|
required_mib = min_disk_space / 1024 / 1024
|
||||||
results.failures.append(f'Not enough available disk space! {free_mib:.02f} MiB < {required_mib:.02f} MiB')
|
results.failures.add(f'Not enough available disk space! {free_mib:.02f} MiB < {required_mib:.02f} MiB')
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue