Skip to content

Commit

Permalink
Release 5.14.1 Fix not accepting default package location
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonius7 committed Jun 2, 2024
1 parent 957fd13 commit dd915e8
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 22 deletions.
43 changes: 32 additions & 11 deletions backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,26 +247,46 @@ def OS_open_file(path):
print("Opened: " + path)
except:
print_traceback()

def library_dir():



def steam_dir():
'''
UTILITY: Returns Steam library path (/steamui) for Windows, Mac, Linux.
UTILITY: Returns Steam path (/steamui) for Windows, Mac, Linux.
'''
try:
steamui_path = ""
steam_path = ""
if OS_TYPE == "Windows":
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "SOFTWARE\Valve\Steam")
steam_path = winreg.QueryValueEx(key, "SteamPath")[0]
steamui_path = steam_path.replace("/","\\") + "\steamui"
steam_path = steam_path.replace("/","\\")
#print(steamui_path)
elif OS_TYPE == "Darwin":
steamui_path = os.path.expandvars('$HOME') + "/Library/Application Support/Steam" + "/steamui"
steam_path = os.path.expandvars('$HOME') + "/Library/Application Support/Steam"
elif OS_TYPE == "Linux":
steamui_path = os.path.expandvars('$HOME') + "/.steam/steam" + "/steamui"
return steamui_path
steam_path = os.path.expandvars('$HOME') + "/.steam/steam"
return steam_path
except:
print("Steam Library directory not found. Is Steam installed/has been run under this User?", file=sys.stderr)
print("Steam directory not found. Is Steam installed/has been run under this User?", file=sys.stderr)
print_traceback()

def package_dir():
'''
UTILITY: Returns Steam package path (/steamui) for Windows, Mac, Linux.
'''
package_path = steam_dir() + "/package"
if OS_TYPE == "Windows":
package_path = package_path.replace("/","\\")
return package_path

def library_dir():
'''
UTILITY: Returns Steam library path (/steamui) for Windows, Mac, Linux.
'''
library_path = steam_dir() + "/steamui"
if OS_TYPE == "Windows":
library_path = library_path.replace("/","\\")
return library_path

def skins_dir():
skins_path = library_dir() + "/skins/OldGlory"
Expand Down Expand Up @@ -340,12 +360,13 @@ def get_md5_file_hash(filepath):
print("Unable to get hash of file: " + filepath, file=sys.stderr)
print_traceback()

def get_path_with_wildcard(filepath = r"C:\Program Files (x86)\0E Games\Steam\package",
def get_path_with_wildcard(filepath = r"C:\Program Files (x86)\Steam\package",
search_term = "steamui_websrc_all.zip.vz.*"):
'''
UTILITY: Returns the filepath (filename) of file using a search wildcard
defaults to Steam\package steamui_websrc_all.zip.vz.* file
'''
#if os.path.isfile(Path(filepath).glob(search_term)):
return next(Path(filepath).glob(search_term))

### Check CSS Patched
Expand Down Expand Up @@ -1332,7 +1353,7 @@ def update_json_last_patched_date(json_data):
write_json_data(json_data)

def update_steamui_websrc_hash(json_data):
json_data["steamui_websrc_all.zip.vz_hash"] = get_md5_file_hash(get_path_with_wildcard())
json_data["steamui_websrc_all.zip.vz_hash"] = get_md5_file_hash(get_path_with_wildcard(package_dir()))
write_json_data(json_data)

### file management functions as part of auto-update
Expand Down
6 changes: 3 additions & 3 deletions old_glory.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

class OldGloryApp(tk.Tk):
def __init__(self, *args, **kwargs):
self.version = "1.1.3"
self.release = "5.14"
self.version = "1.1.3.1"
self.release = "5.14.1"

### Window Frame
tk.Tk.__init__(self, *args, **kwargs)
Expand Down Expand Up @@ -134,7 +134,7 @@ def get_frame(self, name):

def steam_update_check(self):
pass
self.current_file_hash = backend.get_md5_file_hash(backend.get_path_with_wildcard())
self.current_file_hash = backend.get_md5_file_hash(backend.get_path_with_wildcard(backend.package_dir()))
if self.current_file_hash != self.json_data["steamui_websrc_all.zip.vz_hash"]:
print("New Steam Update detected. If the Steam window does not appear, try using the Remake JS button in Settings.", file=sys.stderr)

Expand Down
2 changes: 1 addition & 1 deletion old_glory.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ block_cipher = None
a = Analysis(['old_glory.py'],
binaries=[],
datas=[('steam_oldglory.ico', '.')],
hiddenimports=['six'],
hiddenimports=['six', 'pkg_resources.extern'],
hookspath=[],
runtime_hooks=[],
excludes=['lzma', 'bz2', 'tcl', 'pygments', 'matplotlib', 'IPython', 'ipython_genutils', 'ipykernel', 'jupyter_client', 'asyncio', 'hook', 'distutils', 'hooks', 'tornado', 'sqlite3', 'PyInstaller', 'jedi', 'test', 'site', 'pycparser'],
Expand Down
2 changes: 1 addition & 1 deletion old_glory_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"jsPatchedFile": "sq.js",
"jsOriginalFile": "sp.js.original",
"steamui_websrc_all.zip.vz_hash": "543ddfbd73d1bb57720f1545974908c7",
"lastPatchedDate": "2024-05-30T14:41:52Z",
"lastPatchedDate": "2024-06-02T12:54:40Z",
"themes": {
"steam-library": {
"author": "Shiina",
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
jsbeautifier==1.14.0
libsass==0.21.0
Pillow==10.3.0
requests==2.32.0
requests_oauthlib==1.3.1
rjsmin==1.2.0
jsbeautifier>=1.14.0
libsass>=0.21.0
Pillow>=10.3.0
requests>=2.32.0
requests_oauthlib>=1.3.1
rjsmin>=1.2.0
altgraph>=0.17.4
certifi>=2023.7.22
charset-normalizer>=3.3.0
Expand Down

0 comments on commit dd915e8

Please sign in to comment.