Skip to content

Commit

Permalink
wine: proper registry types
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Sep 24, 2023
1 parent f14a972 commit 13516de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions wine/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ type RegistryType string

const (
REG_SZ RegistryType = "REG_SZ"
REG_MULTI_SZ = "REG_MULTI_SZ"
REG_EXPAND_SZ = "REG_EXPAND_SZ"
REG_DWORD = "REG_DWORD"
REG_QWORD = "REG_QWORD"
REG_BINARY = "REG_BINARY"
REG_NONE = "REG_NONE"
REG_MULTI_SZ RegistryType = "REG_MULTI_SZ"
REG_EXPAND_SZ RegistryType = "REG_EXPAND_SZ"
REG_DWORD RegistryType = "REG_DWORD"
REG_QWORD RegistryType = "REG_QWORD"
REG_BINARY RegistryType = "REG_BINARY"
REG_NONE RegistryType = "REG_NONE"
)

func (p *Prefix) RegistryAdd(key, value string, kind, data string) error {
func (p *Prefix) RegistryAdd(key, value string, rtype RegistryType, data string) error {
if key == "" {
return errors.New("no registry key given")
}

return p.Wine("reg", "add", key, "/v", value, "/t", kind, "/d", data, "/f").Run()
return p.Wine("reg", "add", key, "/v", value, "/t", string(rtype), "/d", data, "/f").Run()
}
2 changes: 1 addition & 1 deletion wine/tricks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import (
func (p *Prefix) DisableCrashDialogs() error {
log.Println("Disabling Crash dialogs")

return p.RegistryAdd("HKEY_CURRENT_USER\\Software\\Wine\\WineDbg", "ShowCrashDialog", REG_DWORD, "")
return p.RegistryAdd("HKEY_CURRENT_USER\\Software\\Wine\\WineDbg", "ShowCrashDialog", REG_SZ, "")
}

0 comments on commit 13516de

Please sign in to comment.