Skip to content

Commit

Permalink
minor chnages
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Nov 1, 2023
1 parent 96981b2 commit 76bc6de
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 26 deletions.
Binary file modified icons/128/roblox-player.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/128/roblox-studio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/16/roblox-player.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/16/roblox-studio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/32/roblox-player.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/32/roblox-studio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/48/roblox-player.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/48/roblox-studio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/64/roblox-player.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/64/roblox-studio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (p *Package) Verify(src string) error {
}

if p.Checksum != hex.EncodeToString(hash.Sum(nil)) {
return fmt.Errorf("package %s is corrupted", p.Name)
return fmt.Errorf("package %s (%s) is corrupted", p.Name, src)
}

return nil
Expand All @@ -39,10 +39,10 @@ func (p *Package) Download(dest, deployURL string) error {
return nil
}

log.Printf("Downloading Package %s", p.Name)
log.Printf("Downloading Package %s (%s)", p.Name, dest)

if err := util.Download(deployURL+"-"+p.Name, dest); err != nil {
return fmt.Errorf("download package %s: %w", p.Name, err)
return fmt.Errorf("download package %s: %w", p.Name, dest, err)
}

return p.Verify(dest)
Expand Down
Binary file modified splash/vinegar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 25 additions & 23 deletions wine/dxvk/dxvk.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
const Repo = "https://github.com/doitsujin/dxvk"

func Setenv() {
log.Printf("Enabling DXVK DLL overrides")
log.Printf("Enabling WINE DXVK DLL overrides")

os.Setenv("WINEDLLOVERRIDES", os.Getenv("WINEDLLOVERRIDES")+";d3d10core=n;d3d11=n;d3d9=n;dxgi=n")
}
Expand All @@ -31,44 +31,44 @@ func Fetch(name string, ver string) error {
}

func Remove(pfx *wine.Prefix) error {
log.Println("Removing all overridden DXVK DLLs")
log.Println("Deleting all overridden DXVK DLLs")

for _, dir := range []string{"syswow64", "system32"} {
for _, dll := range []string{"d3d9", "d3d10core", "d3d11", "dxgi"} {
dllPath := filepath.Join("drive_c", "windows", dir, dll+".dll")
p := filepath.Join(pfx.Dir(), "drive_c", "windows", dir, dll+".dll")

log.Println("Removing DLL:", dllPath)
log.Println("Removing DXVK DLL:", p)

if err := os.Remove(filepath.Join(pfx.Dir(), dllPath)); err != nil {
if err := os.Remove(p); err != nil {
return err
}
}
}

log.Println("Restoring wineprefix DLLs")
log.Println("Restoring Wineprefix DLLs")

return pfx.Wine("wineboot", "-u").Run()
}

func Extract(name string, pfx *wine.Prefix) error {
log.Printf("Extracting DXVK (%s)", name)

tarFile, err := os.Open(name)
tf, err := os.Open(name)
if err != nil {
return err
}
defer tarFile.Close()
defer tf.Close()

stream, err := gzip.NewReader(tarFile)
zr, err := gzip.NewReader(tf)
if err != nil {
return err
}
defer stream.Close()
defer zr.Close()

reader := tar.NewReader(stream)
tr := tar.NewReader(zr)

for {
header, err := reader.Next()
hdr, err := tr.Next()

if err == io.EOF {
break
Expand All @@ -78,39 +78,41 @@ func Extract(name string, pfx *wine.Prefix) error {
return err
}

if header.Typeflag != tar.TypeReg {
if hdr.Typeflag != tar.TypeReg {
continue
}

destDir, ok := map[string]string{
dir, ok := map[string]string{
"x64": filepath.Join(pfx.Dir(), "drive_c", "windows", "system32"),
"x32": filepath.Join(pfx.Dir(), "drive_c", "windows", "syswow64"),
}[filepath.Base(filepath.Dir(header.Name))]
}[filepath.Base(filepath.Dir(hdr.Name))]

if !ok {
log.Printf("Skipping DXVK unhandled file: %s", header.Name)
log.Printf("Skipping DXVK unhandled file: %s", hdr.Name)
continue
}

if err := os.MkdirAll(destDir, 0o755); err != nil {
p := filepath.Join(dir, path.Base(hdr.Name))

if err := os.MkdirAll(dir, 0o755); err != nil {
return err
}

file, err := os.Create(filepath.Join(destDir, path.Base(header.Name)))
f, err := os.Create(p)
if err != nil {
return err
}

log.Printf("Extracting DLL %s", header.Name)
log.Printf("Extracting DLL %s", p)

if _, err = io.Copy(file, reader); err != nil {
file.Close()
if _, err = io.Copy(f, tr); err != nil {
f.Close()
return err
}

file.Close()
f.Close()
}

log.Printf("Removing DXVK tarball (%s)", name)
log.Printf("Deleting DXVK tarball (%s)", name)
return os.RemoveAll(name)
}

0 comments on commit 76bc6de

Please sign in to comment.