44
55import os
66import xbmc
7- from util import *
7+ from . util import *
88
99if os .name == 'nt' :
10- import _winreg
10+ import winreg
1111
1212
1313# https://github.com/lutris/lutris/blob/master/lutris/util/steam.py
@@ -50,10 +50,10 @@ def is_installed_win(app_id):
5050 :return: True if the app is installed, false otherwise
5151 """
5252 try :
53- app = _winreg .OpenKey (_winreg .HKEY_CURRENT_USER , "Software\\ Valve\\ Steam\\ Apps\\ " + app_id )
54- print (_winreg .QueryInfoKey (app )[1 ])
55- for i in range (_winreg .QueryInfoKey (app )[1 ]):
56- name , value , type = _winreg .EnumValue (app , i )
53+ app = winreg .OpenKey (winreg .HKEY_CURRENT_USER , "Software\\ Valve\\ Steam\\ Apps\\ " + app_id )
54+ print (winreg .QueryInfoKey (app )[1 ])
55+ for i in range (winreg .QueryInfoKey (app )[1 ]):
56+ name , value , type = winreg .EnumValue (app , i )
5757 if name == "Installed" :
5858 return value == 1
5959
@@ -73,10 +73,10 @@ def get_installed_steam_apps(registry_path):
7373
7474 if os .name == 'nt' :
7575 try :
76- apps = _winreg .OpenKey (_winreg .HKEY_CURRENT_USER , "Software\\ Valve\\ Steam\\ Apps" )
77- print (_winreg .QueryInfoKey (apps )[0 ])
78- for i in range (_winreg .QueryInfoKey (apps )[0 ]):
79- app_id = _winreg .EnumKey (apps , i )
76+ apps = winreg .OpenKey (winreg .HKEY_CURRENT_USER , "Software\\ Valve\\ Steam\\ Apps" )
77+ print (winreg .QueryInfoKey (apps )[0 ])
78+ for i in range (winreg .QueryInfoKey (apps )[0 ]):
79+ app_id = winreg .EnumKey (apps , i )
8080 if is_installed_win (app_id ):
8181 installed_apps .append (app_id )
8282
0 commit comments