-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
At some point Relic broke launch arguments via URI
- Loading branch information
1 parent
e4da8ec
commit 673dc3f
Showing
2 changed files
with
40 additions
and
3 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,22 @@ | ||
package utils | ||
|
||
import "golang.org/x/sys/windows/registry" | ||
|
||
func GetSteamPath() string { | ||
key, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 1677280`, registry.QUERY_VALUE) | ||
if err != nil { | ||
panic(err) | ||
} | ||
defer key.Close() | ||
|
||
value, _, err := key.GetStringValue("UninstallString") | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
// Sample UninstallString value: | ||
// "C:\Program Files (x86)\Steam\steam.exe" steam://uninstall/1677280 | ||
|
||
// Return the path to the Steam executable | ||
return value[1 : len(value)-len("\" steam://uninstall/1677280")] | ||
} |