Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix steam launch support for custom login servers
- Loading branch information
Showing
4 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as Registry from 'winreg'; | ||
|
||
const getRegistryValuesPromise = async (regKey: Registry.Registry): Promise<Registry.RegistryItem[]> { | ||
return new Promise((res: (items: Registry.RegistryItem[]) => void, rej: (err: Error) => void) => { | ||
regKey.values((err, items) => { | ||
if (err) { | ||
rej(err); | ||
} else { | ||
res(items); | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
export const lookupRegistry = async (hive: string, path: string, item: string): Promise<Registry.RegistryItem | null> => { | ||
const regKey = new Registry({ | ||
hive: hive, | ||
key: path | ||
}); | ||
|
||
const values = await getRegistryValuesPromise(regKey); | ||
const result = values.find((regItem) => regItem.name === item); | ||
return result || null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters