mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[core/models] Add uninstaller to game model
This commit is contained in:
parent
0e35b70941
commit
6d7909c311
|
@ -1472,6 +1472,11 @@ class LegendaryCore:
|
|||
prereq = dict(ids=new_manifest.meta.prereq_ids, name=new_manifest.meta.prereq_name,
|
||||
path=new_manifest.meta.prereq_path, args=new_manifest.meta.prereq_args)
|
||||
|
||||
uninstaller = None
|
||||
if new_manifest.meta.uninstall_action_path:
|
||||
uninstaller = dict(path=new_manifest.meta.uninstall_action_path,
|
||||
args=new_manifest.meta.uninstall_action_args)
|
||||
|
||||
offline = game.metadata.get('customAttributes', {}).get('CanRunOffline', {}).get('value', 'true')
|
||||
ot = game.metadata.get('customAttributes', {}).get('OwnershipToken', {}).get('value', 'false')
|
||||
|
||||
|
@ -1495,7 +1500,7 @@ class LegendaryCore:
|
|||
can_run_offline=offline == 'true', requires_ot=ot == 'true',
|
||||
is_dlc=base_game is not None, install_size=anlres.install_size,
|
||||
egl_guid=egl_guid, install_tags=file_install_tag,
|
||||
platform=platform)
|
||||
platform=platform, uninstaller=uninstaller)
|
||||
|
||||
return dlm, anlres, igame
|
||||
|
||||
|
|
|
@ -149,6 +149,7 @@ class InstalledGame:
|
|||
needs_verification: bool = False
|
||||
platform: str = 'Windows'
|
||||
prereq_info: Optional[Dict] = None
|
||||
uninstaller: Optional[Dict] = None
|
||||
requires_ot: bool = False
|
||||
save_path: Optional[str] = None
|
||||
|
||||
|
@ -165,6 +166,7 @@ class InstalledGame:
|
|||
tmp.executable = json.get('executable', '')
|
||||
tmp.launch_parameters = json.get('launch_parameters', '')
|
||||
tmp.prereq_info = json.get('prereq_info', None)
|
||||
tmp.uninstaller = json.get('uninstaller', None)
|
||||
|
||||
tmp.can_run_offline = json.get('can_run_offline', False)
|
||||
tmp.requires_ot = json.get('requires_ot', False)
|
||||
|
|
Loading…
Reference in a new issue