Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/grumpy-queens-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-bin": patch
---

feat: wine: Remove the USE_SYSTEM_WINE restriction on macOS Catalina
20 changes: 12 additions & 8 deletions pkg/wine/wine.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,27 @@ func executeMacOsWine(useSystemWine bool, ctx context.Context, args []string, ia
log.Warn("cannot detect macOS version", zap.Error(err))
}

var wineExecutable string
if catalina {
if len(ia64Name) == 0 {
return errors.New("macOS Catalina doesn't support 32-bit executables and as result Wine cannot run Windows 32-bit applications too")
if useSystemWine {
args = append([]string{ia32Name}, args...)
} else {
return errors.New("macOS Catalina doesn't support 32-bit executables and as result Wine cannot run Windows 32-bit applications too")
}
} else {
args = append([]string{ia64Name}, args...)
}

args = append([]string{ia64Name}, args...)
wineExecutable = "wine64"
} else {
args = append([]string{ia32Name}, args...)

wineExecutable = "wine"
}

if useSystemWine {
command := exec.CommandContext(ctx, "wine", args...)
command := exec.CommandContext(ctx, wineExecutable, args...)
env := os.Environ()
env = append(env,
fmt.Sprintf("WINEDEBUG=%s", "-all,err+all"),
Expand All @@ -116,7 +125,6 @@ func executeMacOsWine(useSystemWine bool, ctx context.Context, args []string, ia
}

var wineDir string
var wineExecutable string
if catalina {
dirName := "wine-4.0.1-mac"
//noinspection SpellCheckingInspection
Expand All @@ -125,8 +133,6 @@ func executeMacOsWine(useSystemWine bool, ctx context.Context, args []string, ia
if err != nil {
return err
}

wineExecutable = "wine64"
} else {
dirName := "wine-2.0.3-mac-10.13"
//noinspection SpellCheckingInspection
Expand All @@ -135,8 +141,6 @@ func executeMacOsWine(useSystemWine bool, ctx context.Context, args []string, ia
if err != nil {
return err
}

wineExecutable = "wine"
}
command := exec.CommandContext(ctx, filepath.Join(wineDir, "bin", wineExecutable), args...)
env := os.Environ()
Expand Down