Skip to content

Commit

Permalink
Fix installed osu detection (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGoogle authored Jun 22, 2020
1 parent c3c81ef commit 038f8ef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Version 1.0.1
[Fix]
- Installed game detection #3

## Version 1.0.0
[Added]
- install
Expand Down
7 changes: 5 additions & 2 deletions src/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ def _find_exe(self) -> t.Optional[str]:
if not WIN:
raise NotImplementedError('Only Windows supported for now')

UNINSTALL_KEY = R'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{86ce7517-ee79-4be9-a314-128183321391}'
UNINSTALL_REG = R'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
try:
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, UNINSTALL_KEY) as key:
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, R'Software\osu!') as key:
uninstall_id = winreg.QueryValueEx(key, 'UninstallId')[0]
uninstall_key = UNINSTALL_REG + fR'\{{{uninstall_id}}}'
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, uninstall_key) as key:
exe = winreg.QueryValueEx(key, 'DisplayIcon')[0]
return pathlib.Path(exe)
except FileNotFoundError:
Expand Down
4 changes: 2 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Integration for Osu!",
"name": "Integration for osu!",
"platform": "egg",
"guid": "79764115-b455-4ff0-be13-a316c7c53dec",
"version": "1.0.0",
"version": "1.0.1",
"description": "Until GOG provide osu id this plugin is shown as Newegg",
"author": "Mesco",
"email": "[email protected]",
Expand Down

0 comments on commit 038f8ef

Please sign in to comment.