diff --git a/config/config.go b/config/config.go index 67c22d5..e09962f 100644 --- a/config/config.go +++ b/config/config.go @@ -6,11 +6,11 @@ import ( "fmt" "os" "os/exec" - "path/filepath" "strings" "github.com/BurntSushi/toml" "github.com/apprehensions/rbxbin" + "github.com/apprehensions/wine" "github.com/vinegarhq/vinegar/splash" ) @@ -143,9 +143,9 @@ func (b *Binary) validate() error { } if b.WineRoot != "" { - w := filepath.Join(b.WineRoot, "bin", "wine64") - if _, err := exec.LookPath(w); err != nil { - return fmt.Errorf("wine64 not present in wineroot") + w := wine.New("", "/tmp").Wine("") + if w.Err != nil { + return fmt.Errorf("wineroot: %w", w.Err) } } @@ -154,7 +154,7 @@ func (b *Binary) validate() error { func (b *Binary) setup() error { if err := b.validate(); err != nil { - return fmt.Errorf("invalid: %w", err) + return err } if err := b.FFlags.SetRenderer(b.Renderer); err != nil { diff --git a/go.mod b/go.mod index 1ec2dd7..a4cc3cc 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/altfoxie/drpc v0.0.0-20240929140334-e714e6291275 github.com/apprehensions/rbxbin v0.0.0-20241108182759-6d92e1ecbfab github.com/apprehensions/rbxweb v0.0.0-20240329184049-0bdedc184942 - github.com/apprehensions/wine v0.0.0-20240402112551-874f01f9e84d + github.com/apprehensions/wine v0.0.0-20241109121733-f99088878030 github.com/folbricht/pefile v0.1.0 github.com/fsnotify/fsnotify v1.8.0 github.com/godbus/dbus/v5 v5.1.0 diff --git a/go.sum b/go.sum index 744e765..d0593bb 100644 --- a/go.sum +++ b/go.sum @@ -25,6 +25,10 @@ github.com/apprehensions/rbxweb v0.0.0-20240329184049-0bdedc184942 h1:pNRoIKlv32 github.com/apprehensions/rbxweb v0.0.0-20240329184049-0bdedc184942/go.mod h1:F7WKRLrQxuRgfXxhwnlFJ059ZBMRxkXxvIhUxP4Qc5g= github.com/apprehensions/wine v0.0.0-20240402112551-874f01f9e84d h1:gf4oF5BVh6GEAfjVlt5/0HJ+2pohrbf+5LZAh29fyY0= github.com/apprehensions/wine v0.0.0-20240402112551-874f01f9e84d/go.mod h1:t54gBblDmNAdLoRNLKk/338+JQvCiyt6qS8EUpD3RYw= +github.com/apprehensions/wine v0.0.0-20241109115212-21fe280585b5 h1:u4mK0UyuGXrXNcR4zrR0rv2d5wtx+S71yYnMbIwTOo8= +github.com/apprehensions/wine v0.0.0-20241109115212-21fe280585b5/go.mod h1:t54gBblDmNAdLoRNLKk/338+JQvCiyt6qS8EUpD3RYw= +github.com/apprehensions/wine v0.0.0-20241109121733-f99088878030 h1:p9wQhjrCVORRZStMXw3IBjiQ7yS5fd6ugvxFCbZngEs= +github.com/apprehensions/wine v0.0.0-20241109121733-f99088878030/go.mod h1:t54gBblDmNAdLoRNLKk/338+JQvCiyt6qS8EUpD3RYw= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/folbricht/pefile v0.1.0 h1:y9aMwgNlPO/iyp8Izll3Au4XNp7Fi7uDH8OKZ1Nl+lw=