first epoch pass
Some checks failed
Build Go/Fyne App for macOS ARM64 / build (pull_request) Has been cancelled
Some checks failed
Build Go/Fyne App for macOS ARM64 / build (pull_request) Has been cancelled
This commit is contained in:
@@ -8,9 +8,9 @@ import (
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
||||
"turtlesilicon/pkg/debug"
|
||||
"turtlesilicon/pkg/paths" // Corrected import path
|
||||
"turtlesilicon/pkg/utils" // Corrected import path
|
||||
"epochsilicon/pkg/debug"
|
||||
"epochsilicon/pkg/paths" // Corrected import path
|
||||
"epochsilicon/pkg/utils" // Corrected import path
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
@@ -110,7 +110,7 @@ func LaunchGame(myWindow fyne.Window) {
|
||||
return
|
||||
}
|
||||
if paths.EpochPath == "" {
|
||||
dialog.ShowError(fmt.Errorf("TurtleWoW path not set. Please set it in the patcher."), myWindow)
|
||||
dialog.ShowError(fmt.Errorf("Epoch path not set. Please set it in the patcher."), myWindow)
|
||||
return
|
||||
}
|
||||
if !paths.PatchesAppliedEpoch || !paths.PatchesAppliedCrossOver {
|
||||
@@ -132,28 +132,9 @@ func LaunchGame(myWindow fyne.Window) {
|
||||
}
|
||||
gameMutex.Unlock()
|
||||
|
||||
debug.Println("Preparing to launch TurtleSilicon...")
|
||||
debug.Println("Preparing to launch EpochSilicon...")
|
||||
|
||||
// Determine which WoW executable to use based on vanilla-tweaks preference
|
||||
var wowExePath string
|
||||
if EnableVanillaTweaks {
|
||||
if !CheckForWoWTweakedExecutable() {
|
||||
// Show dialog asking if user wants us to apply vanilla-tweaks
|
||||
HandleVanillaTweaksRequest(myWindow, func() {
|
||||
// After successful patching, continue with launch using the tweaked executable
|
||||
wowTweakedExePath := GetWoWTweakedExecutablePath()
|
||||
if wowTweakedExePath != "" {
|
||||
continueLaunch(myWindow, wowTweakedExePath)
|
||||
} else {
|
||||
dialog.ShowError(fmt.Errorf("failed to find WoW-tweaked.exe after patching"), myWindow)
|
||||
}
|
||||
})
|
||||
return // Exit early since dialog will handle the continuation
|
||||
}
|
||||
wowExePath = GetWoWTweakedExecutablePath()
|
||||
} else {
|
||||
wowExePath = filepath.Join(paths.EpochPath, "WoW.exe")
|
||||
}
|
||||
wowExePath := filepath.Join(paths.EpochPath, "Project-Epoch.exe")
|
||||
|
||||
// Continue with normal launch process
|
||||
continueLaunch(myWindow, wowExePath)
|
||||
@@ -161,12 +142,12 @@ func LaunchGame(myWindow fyne.Window) {
|
||||
|
||||
// continueLaunch continues the game launch process with the specified executable
|
||||
func continueLaunch(myWindow fyne.Window, wowExePath string) {
|
||||
rosettaInTurtlePath := filepath.Join(paths.EpochPath, "rosettax87")
|
||||
rosettaExecutable := filepath.Join(rosettaInTurtlePath, "rosettax87")
|
||||
rosettaInEpochPath := filepath.Join(paths.EpochPath, "rosettax87")
|
||||
rosettaExecutable := filepath.Join(rosettaInEpochPath, "rosettax87")
|
||||
wineloader2Path := filepath.Join(paths.CrossoverPath, "Contents", "SharedSupport", "CrossOver", "CrossOver-Hosted Application", "wineloader2")
|
||||
|
||||
if !utils.PathExists(rosettaExecutable) {
|
||||
dialog.ShowError(fmt.Errorf("rosetta executable not found at %s. Ensure TurtleWoW patching was successful", rosettaExecutable), myWindow)
|
||||
dialog.ShowError(fmt.Errorf("rosetta executable not found at %s. Ensure Epoch patching was successful", rosettaExecutable), myWindow)
|
||||
return
|
||||
}
|
||||
if !utils.PathExists(wineloader2Path) {
|
||||
@@ -174,7 +155,7 @@ func continueLaunch(myWindow fyne.Window, wowExePath string) {
|
||||
return
|
||||
}
|
||||
if !utils.PathExists(wowExePath) {
|
||||
dialog.ShowError(fmt.Errorf("WoW executable not found at %s. Ensure your TurtleWoW directory is correct", wowExePath), myWindow)
|
||||
dialog.ShowError(fmt.Errorf("WoW executable not found at %s. Ensure your Epoch directory is correct", wowExePath), myWindow)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -198,7 +179,7 @@ func continueLaunch(myWindow fyne.Window, wowExePath string) {
|
||||
debug.Println("RosettaX87 service is running. Proceeding to launch WoW.")
|
||||
|
||||
if paths.CrossoverPath == "" || paths.EpochPath == "" {
|
||||
dialog.ShowError(fmt.Errorf("CrossOver path or TurtleWoW path is not set. Cannot launch WoW."), myWindow)
|
||||
dialog.ShowError(fmt.Errorf("CrossOver path or Epoch path is not set. Cannot launch WoW."), myWindow)
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -7,8 +7,8 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"turtlesilicon/pkg/debug"
|
||||
"turtlesilicon/pkg/paths"
|
||||
"epochsilicon/pkg/debug"
|
||||
"epochsilicon/pkg/paths"
|
||||
)
|
||||
|
||||
// RecommendedSettings contains the recommended graphics settings for optimal performance
|
||||
@@ -25,7 +25,7 @@ var RecommendedSettings = map[string]string{
|
||||
// Returns true if all settings are correctly applied, false otherwise
|
||||
func CheckRecommendedSettings() bool {
|
||||
if paths.EpochPath == "" {
|
||||
debug.Printf("TurtleWoW path not set, cannot check Config.wtf")
|
||||
debug.Printf("Epoch path not set, cannot check Config.wtf")
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ func isSettingCorrect(configText, setting, expectedValue string) bool {
|
||||
// ApplyRecommendedSettings applies all recommended graphics settings to Config.wtf
|
||||
func ApplyRecommendedSettings() error {
|
||||
if paths.EpochPath == "" {
|
||||
return fmt.Errorf("TurtleWoW path not set")
|
||||
return fmt.Errorf("Epoch path not set")
|
||||
}
|
||||
|
||||
configPath := filepath.Join(paths.EpochPath, "WTF", "Config.wtf")
|
||||
|
@@ -1,205 +0,0 @@
|
||||
package launcher
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
||||
"turtlesilicon/pkg/debug"
|
||||
"turtlesilicon/pkg/paths"
|
||||
"turtlesilicon/pkg/utils"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
)
|
||||
|
||||
// ApplyVanillaTweaks applies vanilla-tweaks to WoW.exe to create WoW-tweaked.exe
|
||||
func ApplyVanillaTweaks(myWindow fyne.Window) error {
|
||||
if paths.EpochPath == "" {
|
||||
return fmt.Errorf("TurtleWoW path not set")
|
||||
}
|
||||
if paths.CrossoverPath == "" {
|
||||
return fmt.Errorf("CrossOver path not set")
|
||||
}
|
||||
|
||||
// Get the current working directory (where the app executable is located)
|
||||
execPath, err := os.Executable()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get executable path: %v", err)
|
||||
}
|
||||
appDir := filepath.Dir(execPath)
|
||||
|
||||
// Check if we're in development mode
|
||||
vanillaTweaksPath := filepath.Join(appDir, "winerosetta", "vanilla-tweaks.exe")
|
||||
if !utils.PathExists(vanillaTweaksPath) {
|
||||
// Try relative path from current working directory (for development)
|
||||
workingDir, _ := os.Getwd()
|
||||
vanillaTweaksPath = filepath.Join(workingDir, "winerosetta", "vanilla-tweaks.exe")
|
||||
if !utils.PathExists(vanillaTweaksPath) {
|
||||
return fmt.Errorf("vanilla-tweaks.exe not found")
|
||||
}
|
||||
}
|
||||
|
||||
wowExePath := filepath.Join(paths.EpochPath, "WoW.exe")
|
||||
wineloader2Path := filepath.Join(paths.CrossoverPath, "Contents", "SharedSupport", "CrossOver", "CrossOver-Hosted Application", "wineloader2")
|
||||
|
||||
if !utils.PathExists(wowExePath) {
|
||||
return fmt.Errorf("WoW.exe not found at %s", wowExePath)
|
||||
}
|
||||
if !utils.PathExists(wineloader2Path) {
|
||||
return fmt.Errorf("wineloader2 not found at %s", wineloader2Path)
|
||||
}
|
||||
|
||||
// First, copy vanilla-tweaks.exe to the TurtleWoW directory temporarily
|
||||
tempVanillaTweaksPath := filepath.Join(paths.EpochPath, "vanilla-tweaks.exe")
|
||||
|
||||
// Copy vanilla-tweaks.exe to TurtleWoW directory
|
||||
debug.Printf("Copying vanilla-tweaks.exe from %s to %s", vanillaTweaksPath, tempVanillaTweaksPath)
|
||||
sourceFile, err := os.Open(vanillaTweaksPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to open vanilla-tweaks.exe: %v", err)
|
||||
}
|
||||
defer sourceFile.Close()
|
||||
|
||||
destFile, err := os.Create(tempVanillaTweaksPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create temporary vanilla-tweaks.exe: %v", err)
|
||||
}
|
||||
defer destFile.Close()
|
||||
|
||||
_, err = destFile.ReadFrom(sourceFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to copy vanilla-tweaks.exe: %v", err)
|
||||
}
|
||||
|
||||
// Ensure the copied file is executable
|
||||
if err := os.Chmod(tempVanillaTweaksPath, 0755); err != nil {
|
||||
debug.Printf("Warning: failed to set executable permission on vanilla-tweaks.exe: %v", err)
|
||||
}
|
||||
|
||||
// Build the command to apply vanilla-tweaks using the correct format:
|
||||
// cd "path" && "wineloader2" ./vanilla-tweaks.exe --no-frilldistance -no-farclip ./WoW.exe
|
||||
shellCmd := fmt.Sprintf(`cd %s && %s ./vanilla-tweaks.exe --no-frilldistance --no-farclip ./WoW.exe`,
|
||||
utils.QuotePathForShell(paths.EpochPath),
|
||||
utils.QuotePathForShell(wineloader2Path))
|
||||
|
||||
debug.Printf("Applying vanilla-tweaks with command: %s", shellCmd)
|
||||
|
||||
// Execute the command
|
||||
cmd := exec.Command("sh", "-c", shellCmd)
|
||||
output, err := cmd.CombinedOutput()
|
||||
|
||||
debug.Printf("vanilla-tweaks command output: %s", string(output))
|
||||
|
||||
// Clean up the temporary vanilla-tweaks.exe file
|
||||
if cleanupErr := os.Remove(tempVanillaTweaksPath); cleanupErr != nil {
|
||||
debug.Printf("Warning: failed to clean up temporary vanilla-tweaks.exe: %v", cleanupErr)
|
||||
}
|
||||
|
||||
// Always check if the output file was created, regardless of exit code
|
||||
// Some Wine programs report error exit codes even when they succeed
|
||||
foundPath := GetWoWTweakedExecutablePath()
|
||||
if foundPath == "" {
|
||||
// Only report error if no output file was created
|
||||
if err != nil {
|
||||
debug.Printf("vanilla-tweaks command failed: %v", err)
|
||||
return fmt.Errorf("failed to apply vanilla-tweaks: %v\nOutput: %s", err, string(output))
|
||||
} else {
|
||||
return fmt.Errorf("vanilla-tweaks completed but WoW-tweaked.exe was not created\nOutput: %s", string(output))
|
||||
}
|
||||
}
|
||||
|
||||
// If we found the file but there was an error code, log it as a warning
|
||||
if err != nil {
|
||||
debug.Printf("vanilla-tweaks reported error but output file was created: %v", err)
|
||||
}
|
||||
|
||||
debug.Println("vanilla-tweaks applied successfully")
|
||||
return nil
|
||||
}
|
||||
|
||||
// CheckForVanillaTweaksExecutable checks if vanilla-tweaks.exe exists and is accessible
|
||||
func CheckForVanillaTweaksExecutable() bool {
|
||||
// Get the current working directory (where the app executable is located)
|
||||
execPath, err := os.Executable()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
appDir := filepath.Dir(execPath)
|
||||
|
||||
// Check if we're in development mode (running from VSCode)
|
||||
vanillaTweaksPath := filepath.Join(appDir, "winerosetta", "vanilla-tweaks.exe")
|
||||
if utils.PathExists(vanillaTweaksPath) {
|
||||
return true
|
||||
}
|
||||
|
||||
// Try relative path from current working directory (for development)
|
||||
workingDir, _ := os.Getwd()
|
||||
vanillaTweaksPath = filepath.Join(workingDir, "winerosetta", "vanilla-tweaks.exe")
|
||||
return utils.PathExists(vanillaTweaksPath)
|
||||
}
|
||||
|
||||
// GetVanillaTweaksExecutablePath returns the path to vanilla-tweaks.exe if it exists
|
||||
func GetVanillaTweaksExecutablePath() (string, error) {
|
||||
// Get the current working directory (where the app executable is located)
|
||||
execPath, err := os.Executable()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to get executable path: %v", err)
|
||||
}
|
||||
appDir := filepath.Dir(execPath)
|
||||
|
||||
// Check if we're in development mode (running from VSCode)
|
||||
vanillaTweaksPath := filepath.Join(appDir, "winerosetta", "vanilla-tweaks.exe")
|
||||
if utils.PathExists(vanillaTweaksPath) {
|
||||
return vanillaTweaksPath, nil
|
||||
}
|
||||
|
||||
// Try relative path from current working directory (for development)
|
||||
workingDir, _ := os.Getwd()
|
||||
vanillaTweaksPath = filepath.Join(workingDir, "winerosetta", "vanilla-tweaks.exe")
|
||||
if utils.PathExists(vanillaTweaksPath) {
|
||||
return vanillaTweaksPath, nil
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("vanilla-tweaks.exe not found")
|
||||
}
|
||||
|
||||
// CheckForWoWTweakedExecutable checks if WoW_tweaked.exe exists in the TurtleWoW directory
|
||||
func CheckForWoWTweakedExecutable() bool {
|
||||
if paths.EpochPath == "" {
|
||||
return false
|
||||
}
|
||||
|
||||
testPath := filepath.Join(paths.EpochPath, "WoW_tweaked.exe")
|
||||
return utils.PathExists(testPath)
|
||||
}
|
||||
|
||||
// GetWoWTweakedExecutablePath returns the path to the WoW_tweaked.exe file if it exists
|
||||
func GetWoWTweakedExecutablePath() string {
|
||||
if paths.EpochPath == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
testPath := filepath.Join(paths.EpochPath, "WoW_tweaked.exe")
|
||||
if utils.PathExists(testPath) {
|
||||
return testPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// HandleVanillaTweaksRequest handles the case when vanilla-tweaks is enabled but WoW-tweaked.exe doesn't exist
|
||||
func HandleVanillaTweaksRequest(myWindow fyne.Window, callback func()) {
|
||||
dialog.ShowConfirm("Vanilla-tweaks not found",
|
||||
"WoW-tweaked.exe was not found in your TurtleWoW directory.\n\nWould you like TurtleSilicon to automatically apply vanilla-tweaks for you?",
|
||||
func(confirmed bool) {
|
||||
if confirmed {
|
||||
if err := ApplyVanillaTweaks(myWindow); err != nil {
|
||||
dialog.ShowError(fmt.Errorf("failed to apply vanilla-tweaks: %v", err), myWindow)
|
||||
return
|
||||
}
|
||||
// After successful patching, execute the callback
|
||||
callback()
|
||||
}
|
||||
}, myWindow)
|
||||
}
|
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.burkey.co/eburk/epochcli/pkg/epoch"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
@@ -12,20 +13,18 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"turtlesilicon/pkg/debug"
|
||||
"turtlesilicon/pkg/paths" // Corrected import path
|
||||
"turtlesilicon/pkg/utils" // Corrected import path
|
||||
"epochsilicon/pkg/debug"
|
||||
"epochsilicon/pkg/paths" // Corrected import path
|
||||
"epochsilicon/pkg/utils" // Corrected import path
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
)
|
||||
|
||||
func PatchEpoch(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
// TODO: patch vanilla 3.3.5 to epoch
|
||||
log.Fatal("FIXME")
|
||||
debug.Println("Patch TurtleWoW clicked")
|
||||
debug.Println("Patch Epoch clicked")
|
||||
if paths.EpochPath == "" {
|
||||
dialog.ShowError(fmt.Errorf("TurtleWoW path not set. Please set it first."), myWindow)
|
||||
dialog.ShowError(fmt.Errorf("Epoch path not set. Please set it first."), myWindow)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -156,12 +155,6 @@ func PatchEpoch(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
winerosettaEntry := "winerosetta.dll"
|
||||
needsWinerosettaUpdate := true
|
||||
|
||||
// Check user's preference for libSiliconPatch and shadowLOD
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
|
||||
// Save updated preferences
|
||||
utils.SavePrefs(prefs)
|
||||
|
||||
if fileContentBytes, err := os.ReadFile(dllsTextFile); err == nil {
|
||||
fileContent := string(fileContentBytes)
|
||||
if strings.Contains(fileContent, winerosettaEntry) {
|
||||
@@ -207,8 +200,18 @@ func PatchEpoch(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
}
|
||||
}
|
||||
|
||||
debug.Println("TurtleWoW patching with bundled resources completed successfully.")
|
||||
dialog.ShowInformation("Success", "TurtleWoW patching process completed using bundled resources.", myWindow)
|
||||
debug.Println("Downloading updates from Project Epoch servers.")
|
||||
stats, err := epoch.Update(paths.EpochPath, true, true, false)
|
||||
if err != nil {
|
||||
errMsg := fmt.Sprintf("failed to update Epoch files: %v", err)
|
||||
dialog.ShowError(errors.New(errMsg), myWindow)
|
||||
log.Println(errMsg)
|
||||
}
|
||||
log.Printf("Successfully updated %d Epoch files", stats.Updated)
|
||||
|
||||
debug.Println("Epoch patching with bundled resources completed successfully.")
|
||||
|
||||
dialog.ShowInformation("Success", "Epoch patching process completed.", myWindow)
|
||||
updateAllStatuses()
|
||||
}
|
||||
|
||||
@@ -234,7 +237,7 @@ func PatchCrossOver(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
if err := utils.CopyFile(wineloaderOrig, wineloaderCopy); err != nil {
|
||||
errMsg := fmt.Sprintf("failed to copy wineloader: %v", err)
|
||||
if strings.Contains(err.Error(), "operation not permitted") {
|
||||
errMsg += "\n\nSolution: Open System Settings, go to Privacy & Security > App Management, and enable TurtleSilicon."
|
||||
errMsg += "\n\nSolution: Open System Settings, go to Privacy & Security > App Management, and enable EpochSilicon."
|
||||
}
|
||||
dialog.ShowError(fmt.Errorf(errMsg), myWindow)
|
||||
paths.PatchesAppliedCrossOver = false
|
||||
@@ -275,18 +278,15 @@ func PatchCrossOver(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
}
|
||||
|
||||
func UnpatchEpoch(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
// TODO: unpatch epoch
|
||||
log.Fatal("fixme")
|
||||
debug.Println("Unpatch TurtleWoW clicked")
|
||||
debug.Println("Unpatch Epoch clicked")
|
||||
if paths.EpochPath == "" {
|
||||
dialog.ShowError(fmt.Errorf("TurtleWoW path not set. Please set it first."), myWindow)
|
||||
dialog.ShowError(fmt.Errorf("Epoch path not set. Please set it first."), myWindow)
|
||||
return
|
||||
}
|
||||
|
||||
// Files to remove
|
||||
winerosettaDllPath := filepath.Join(paths.EpochPath, "winerosetta.dll")
|
||||
d3d9DllPath := filepath.Join(paths.EpochPath, "d3d9.dll")
|
||||
libSiliconPatchDllPath := filepath.Join(paths.EpochPath, "libSiliconPatch.dll")
|
||||
rosettaX87DirPath := filepath.Join(paths.EpochPath, "rosettax87")
|
||||
dllsTextFile := filepath.Join(paths.EpochPath, "dlls.txt")
|
||||
|
||||
@@ -303,7 +303,7 @@ func UnpatchEpoch(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
}
|
||||
|
||||
// Remove DLL files
|
||||
filesToRemove := []string{winerosettaDllPath, d3d9DllPath, libSiliconPatchDllPath}
|
||||
filesToRemove := []string{winerosettaDllPath, d3d9DllPath}
|
||||
for _, file := range filesToRemove {
|
||||
if utils.PathExists(file) {
|
||||
debug.Printf("Removing file: %s", file)
|
||||
@@ -317,7 +317,7 @@ func UnpatchEpoch(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
}
|
||||
}
|
||||
|
||||
// Update dlls.txt file - remove winerosetta.dll and libSiliconPatch.dll entries
|
||||
// Update dlls.txt file - remove winerosetta.dll
|
||||
if utils.PathExists(dllsTextFile) {
|
||||
debug.Printf("Updating dlls.txt file: %s", dllsTextFile)
|
||||
content, err := os.ReadFile(dllsTextFile)
|
||||
@@ -331,7 +331,7 @@ func UnpatchEpoch(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
|
||||
for _, line := range lines {
|
||||
trimmedLine := strings.TrimSpace(line)
|
||||
if trimmedLine != "winerosetta.dll" && trimmedLine != "libSiliconPatch.dll" {
|
||||
if trimmedLine != "winerosetta.dll" {
|
||||
filteredLines = append(filteredLines, line)
|
||||
}
|
||||
}
|
||||
@@ -347,9 +347,9 @@ func UnpatchEpoch(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
}
|
||||
}
|
||||
|
||||
debug.Println("TurtleWoW unpatching completed successfully.")
|
||||
debug.Println("Epoch unpatching completed successfully.")
|
||||
paths.PatchesAppliedEpoch = false
|
||||
dialog.ShowInformation("Success", "TurtleWoW unpatching process completed.", myWindow)
|
||||
dialog.ShowInformation("Success", "Epoch unpatching process completed.", myWindow)
|
||||
updateAllStatuses()
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"turtlesilicon/pkg/utils"
|
||||
"epochsilicon/pkg/utils"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
@@ -53,14 +53,14 @@ func SelectCrossOverPath(myWindow fyne.Window, crossoverPathLabel *widget.RichTe
|
||||
}, myWindow)
|
||||
}
|
||||
|
||||
func SelectTurtleWoWPath(myWindow fyne.Window, turtlewowPathLabel *widget.RichText, updateAllStatuses func()) {
|
||||
func SelectEpochPath(myWindow fyne.Window, epochPathLabel *widget.RichText, updateAllStatuses func()) {
|
||||
dialog.ShowFolderOpen(func(uri fyne.ListableURI, err error) {
|
||||
if err != nil {
|
||||
dialog.ShowError(err, myWindow)
|
||||
return
|
||||
}
|
||||
if uri == nil {
|
||||
log.Println("TurtleWoW path selection cancelled.")
|
||||
log.Println("Epoch path selection cancelled.")
|
||||
updateAllStatuses()
|
||||
return
|
||||
}
|
||||
@@ -68,20 +68,20 @@ func SelectTurtleWoWPath(myWindow fyne.Window, turtlewowPathLabel *widget.RichTe
|
||||
if utils.DirExists(selectedPath) {
|
||||
EpochPath = selectedPath
|
||||
PatchesAppliedEpoch = false
|
||||
log.Println("TurtleWoW path set to:", EpochPath)
|
||||
log.Println("Epoch path set to:", EpochPath)
|
||||
// Save to prefs
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.EpochPath = selectedPath
|
||||
utils.SavePrefs(prefs)
|
||||
} else {
|
||||
dialog.ShowError(fmt.Errorf("invalid selection: '%s' is not a valid directory", selectedPath), myWindow)
|
||||
log.Println("Invalid TurtleWoW path selected:", selectedPath)
|
||||
log.Println("Invalid Epoch path selected:", selectedPath)
|
||||
}
|
||||
updateAllStatuses()
|
||||
}, myWindow)
|
||||
}
|
||||
|
||||
func UpdatePathLabels(crossoverPathLabel, turtlewowPathLabel *widget.RichText) {
|
||||
func UpdatePathLabels(crossoverPathLabel, EpochPathLabel *widget.RichText) {
|
||||
if CrossoverPath == "" {
|
||||
crossoverPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not set", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
} else {
|
||||
@@ -90,11 +90,11 @@ func UpdatePathLabels(crossoverPathLabel, turtlewowPathLabel *widget.RichText) {
|
||||
crossoverPathLabel.Refresh()
|
||||
|
||||
if EpochPath == "" {
|
||||
turtlewowPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not set", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
EpochPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not set", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
} else {
|
||||
turtlewowPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: EpochPath, Style: widget.RichTextStyle{ColorName: theme.ColorNameSuccess}}}
|
||||
EpochPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: EpochPath, Style: widget.RichTextStyle{ColorName: theme.ColorNameSuccess}}}
|
||||
}
|
||||
turtlewowPathLabel.Refresh()
|
||||
EpochPathLabel.Refresh()
|
||||
}
|
||||
|
||||
func CheckDefaultCrossOverPath() {
|
||||
|
@@ -10,8 +10,8 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"turtlesilicon/pkg/paths"
|
||||
"turtlesilicon/pkg/utils"
|
||||
"epochsilicon/pkg/paths"
|
||||
"epochsilicon/pkg/utils"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
@@ -80,7 +80,7 @@ func StartRosettaX87Service(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
log.Println("Starting RosettaX87 service...")
|
||||
|
||||
if paths.EpochPath == "" {
|
||||
dialog.ShowError(fmt.Errorf("TurtleWoW path not set. Please set it first"), myWindow)
|
||||
dialog.ShowError(fmt.Errorf("Epoch path not set. Please set it first"), myWindow)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ func StartRosettaX87Service(myWindow fyne.Window, updateAllStatuses func()) {
|
||||
rosettaX87Exe := filepath.Join(rosettaX87Dir, "rosettax87")
|
||||
|
||||
if !utils.PathExists(rosettaX87Exe) {
|
||||
dialog.ShowError(fmt.Errorf("rosettax87 executable not found at %s. Please apply TurtleWoW patches first", rosettaX87Exe), myWindow)
|
||||
dialog.ShowError(fmt.Errorf("rosettax87 executable not found at %s. Please apply Epoch patches first", rosettaX87Exe), myWindow)
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -5,11 +5,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"turtlesilicon/pkg/debug"
|
||||
"turtlesilicon/pkg/launcher"
|
||||
"turtlesilicon/pkg/patching"
|
||||
"turtlesilicon/pkg/service"
|
||||
"turtlesilicon/pkg/utils"
|
||||
"epochsilicon/pkg/debug"
|
||||
"epochsilicon/pkg/launcher"
|
||||
"epochsilicon/pkg/patching"
|
||||
"epochsilicon/pkg/service"
|
||||
"epochsilicon/pkg/utils"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
@@ -75,10 +75,10 @@ func createOptionsComponents() {
|
||||
|
||||
// createPatchingButtons creates all patching-related buttons
|
||||
func createPatchingButtons(myWindow fyne.Window) {
|
||||
patchTurtleWoWButton = widget.NewButton("Patch Epoch", func() {
|
||||
patchEpochButton = widget.NewButton("Patch Epoch", func() {
|
||||
patching.PatchEpoch(myWindow, UpdateAllStatuses)
|
||||
})
|
||||
unpatchTurtleWoWButton = widget.NewButton("Unpatch Epoch", func() {
|
||||
unpatchEpochButton = widget.NewButton("Unpatch Epoch", func() {
|
||||
patching.UnpatchEpoch(myWindow, UpdateAllStatuses)
|
||||
})
|
||||
patchCrossOverButton = widget.NewButton("Patch CrossOver", func() {
|
||||
@@ -123,7 +123,7 @@ func createBottomBar(myWindow fyne.Window) fyne.CanvasObject {
|
||||
|
||||
// GitHub button
|
||||
githubButton := widget.NewButton("GitHub", func() {
|
||||
githubURL := "https://github.com/tairasu/TurtleSilicon"
|
||||
githubURL := "https://github.com/tairasu/EpochSilicon"
|
||||
parsedURL, err := url.Parse(githubURL)
|
||||
if err != nil {
|
||||
debug.Printf("Error parsing GitHub URL: %v", err)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"turtlesilicon/pkg/debug"
|
||||
"turtlesilicon/pkg/paths"
|
||||
"epochsilicon/pkg/debug"
|
||||
"epochsilicon/pkg/paths"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/canvas"
|
||||
@@ -13,11 +13,11 @@ import (
|
||||
// createHeaderContainer creates the header with title and subtitle
|
||||
func createHeaderContainer() fyne.CanvasObject {
|
||||
// Main title
|
||||
titleText := widget.NewRichTextFromMarkdown("# TurtleSilicon")
|
||||
titleText := widget.NewRichTextFromMarkdown("# EpochSilicon")
|
||||
titleText.Wrapping = fyne.TextWrapOff
|
||||
|
||||
// Subtitle
|
||||
subtitleText := widget.NewLabel("A TurtleWoW launcher for Apple Silicon Macs")
|
||||
subtitleText := widget.NewLabel("An Epoch launcher for Apple Silicon Macs")
|
||||
subtitleText.Alignment = fyne.TextAlignCenter
|
||||
|
||||
// Create header container
|
||||
@@ -57,14 +57,14 @@ func createLogoContainer() fyne.CanvasObject {
|
||||
return logoContainer
|
||||
}
|
||||
|
||||
// createPathSelectionForm creates the form for selecting CrossOver and TurtleWoW paths
|
||||
// createPathSelectionForm creates the form for selecting CrossOver and Epoch paths
|
||||
func createPathSelectionForm(myWindow fyne.Window) *widget.Form {
|
||||
pathSelectionForm := widget.NewForm(
|
||||
widget.NewFormItem("CrossOver Path:", container.NewBorder(nil, nil, nil, widget.NewButton("Set/Change", func() {
|
||||
paths.SelectCrossOverPath(myWindow, crossoverPathLabel, UpdateAllStatuses)
|
||||
}), crossoverPathLabel)),
|
||||
widget.NewFormItem("TurtleWoW Path:", container.NewBorder(nil, nil, nil, widget.NewButton("Set/Change", func() {
|
||||
paths.SelectTurtleWoWPath(myWindow, epochPathLabel, UpdateAllStatuses)
|
||||
widget.NewFormItem("Epoch Path:", container.NewBorder(nil, nil, nil, widget.NewButton("Set/Change", func() {
|
||||
paths.SelectEpochPath(myWindow, epochPathLabel, UpdateAllStatuses)
|
||||
}), epochPathLabel)),
|
||||
)
|
||||
|
||||
@@ -76,7 +76,7 @@ func createPatchOperationsLayout() fyne.CanvasObject {
|
||||
patchOperationsLayout := container.NewVBox(
|
||||
widget.NewSeparator(),
|
||||
container.NewGridWithColumns(4,
|
||||
widget.NewLabel("TurtleWoW Patch:"), epochStatusLabel, patchTurtleWoWButton, unpatchTurtleWoWButton,
|
||||
widget.NewLabel("Epoch Patch:"), epochStatusLabel, patchEpochButton, unpatchEpochButton,
|
||||
),
|
||||
container.NewGridWithColumns(4,
|
||||
widget.NewLabel("CrossOver Patch:"), crossoverStatusLabel, patchCrossOverButton, unpatchCrossOverButton,
|
||||
|
@@ -13,8 +13,8 @@ import (
|
||||
|
||||
"howett.net/plist"
|
||||
|
||||
"turtlesilicon/pkg/paths"
|
||||
"turtlesilicon/pkg/utils"
|
||||
"epochsilicon/pkg/paths"
|
||||
"epochsilicon/pkg/utils"
|
||||
)
|
||||
|
||||
// showOptionsPopup creates and shows an integrated popup window for options
|
||||
@@ -32,7 +32,6 @@ func showOptionsPopup() {
|
||||
widget.NewSeparator(),
|
||||
metalHudCheckbox,
|
||||
showTerminalCheckbox,
|
||||
vanillaTweaksCheckbox,
|
||||
autoDeleteWdbCheckbox,
|
||||
widget.NewSeparator(),
|
||||
container.NewBorder(nil, nil, nil, container.NewHBox(enableOptionAsAltButton, disableOptionAsAltButton), optionAsAltStatusLabel),
|
||||
@@ -203,8 +202,8 @@ func showTroubleshootingPopup() {
|
||||
|
||||
rowCrossover := container.NewBorder(nil, nil, widget.NewLabel("CrossOver version:"), crossoverStatusShort, nil)
|
||||
rowWDB := container.NewBorder(nil, nil, widget.NewLabel("Delete WDB directory (cache):"), wdbDeleteButton, nil)
|
||||
rowWine := container.NewBorder(nil, nil, widget.NewLabel("Delete Wine prefixes (~/.wine & TurtleWoW/.wine):"), wineDeleteButton, nil)
|
||||
appMgmtNote := widget.NewLabel("Please ensure TurtleSilicon is enabled in System Settings > Privacy & Security > App Management.")
|
||||
rowWine := container.NewBorder(nil, nil, widget.NewLabel("Delete Wine prefixes (~/.wine & Epoch/.wine):"), wineDeleteButton, nil)
|
||||
appMgmtNote := widget.NewLabel("Please ensure EpochSilicon is enabled in System Settings > Privacy & Security > App Management.")
|
||||
appMgmtNote.Wrapping = fyne.TextWrapWord
|
||||
appMgmtNote.TextStyle = fyne.TextStyle{Italic: true}
|
||||
|
||||
|
@@ -1,14 +1,16 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"epochsilicon/pkg/debug"
|
||||
"git.burkey.co/eburk/epochcli/pkg/epoch"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"turtlesilicon/pkg/paths"
|
||||
"turtlesilicon/pkg/service"
|
||||
"turtlesilicon/pkg/utils"
|
||||
"epochsilicon/pkg/paths"
|
||||
"epochsilicon/pkg/service"
|
||||
"epochsilicon/pkg/utils"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
@@ -75,7 +77,7 @@ func updateCrossoverStatus() {
|
||||
crossoverStatusLabel.Refresh()
|
||||
}
|
||||
|
||||
// updateEpochStatus updates TurtleWoW path and patch status
|
||||
// updateEpochStatus updates Epoch path and patch status
|
||||
func updateEpochStatus() {
|
||||
if paths.EpochPath == "" {
|
||||
epochPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not set", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
@@ -86,7 +88,6 @@ func updateEpochStatus() {
|
||||
// Check if all required files exist
|
||||
winerosettaDllPath := filepath.Join(paths.EpochPath, "winerosetta.dll")
|
||||
d3d9DllPath := filepath.Join(paths.EpochPath, "d3d9.dll")
|
||||
libSiliconPatchDllPath := filepath.Join(paths.EpochPath, "libSiliconPatch.dll")
|
||||
rosettaX87DirPath := filepath.Join(paths.EpochPath, "rosettax87")
|
||||
dllsTextFile := filepath.Join(paths.EpochPath, "dlls.txt")
|
||||
rosettaX87ExePath := filepath.Join(rosettaX87DirPath, "rosettax87")
|
||||
@@ -98,7 +99,7 @@ func updateEpochStatus() {
|
||||
contentStr := string(fileContent)
|
||||
winerosettaPresent := strings.Contains(contentStr, "winerosetta.dll")
|
||||
|
||||
// Validate dlls.txt: winerosetta must be present, libSiliconPatch based on setting
|
||||
// Validate dlls.txt: winerosetta must be present
|
||||
if winerosettaPresent {
|
||||
dllsFileValid = true
|
||||
}
|
||||
@@ -111,35 +112,46 @@ func updateEpochStatus() {
|
||||
rosettaX87CorrectSize := utils.CompareFileWithBundledResource(rosettaX87ExePath, "rosettax87/rosettax87")
|
||||
libRuntimeRosettaX87CorrectSize := utils.CompareFileWithBundledResource(libRuntimeRosettaX87Path, "rosettax87/libRuntimeRosettax87")
|
||||
|
||||
if utils.PathExists(winerosettaDllPath) && utils.PathExists(d3d9DllPath) && utils.PathExists(libSiliconPatchDllPath) &&
|
||||
if utils.PathExists(winerosettaDllPath) && utils.PathExists(d3d9DllPath) &&
|
||||
utils.DirExists(rosettaX87DirPath) && utils.PathExists(rosettaX87ExePath) &&
|
||||
utils.PathExists(libRuntimeRosettaX87Path) && dllsFileValid &&
|
||||
winerosettaDllCorrectSize && d3d9DllCorrectSize &&
|
||||
rosettaX87CorrectSize && libRuntimeRosettaX87CorrectSize {
|
||||
paths.PatchesAppliedEpoch = true
|
||||
}
|
||||
|
||||
// Check for Epoch-specific files, set PatchesAppliedEpoch to false if not updated
|
||||
stats, err := epoch.Update(paths.EpochPath, false, true, true)
|
||||
if err != nil {
|
||||
paths.PatchesAppliedEpoch = false
|
||||
debug.Printf("Failed to get download Epoch patches: %v", err)
|
||||
}
|
||||
if stats.Outdated > 0 {
|
||||
paths.PatchesAppliedEpoch = false
|
||||
}
|
||||
}
|
||||
|
||||
epochPathLabel.Refresh()
|
||||
|
||||
if paths.PatchesAppliedEpoch {
|
||||
epochStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Patched", Style: widget.RichTextStyle{ColorName: theme.ColorNameSuccess}}}
|
||||
if patchTurtleWoWButton != nil {
|
||||
patchTurtleWoWButton.Disable()
|
||||
if patchEpochButton != nil {
|
||||
patchEpochButton.Disable()
|
||||
}
|
||||
if unpatchTurtleWoWButton != nil {
|
||||
unpatchTurtleWoWButton.Enable()
|
||||
if unpatchEpochButton != nil {
|
||||
unpatchEpochButton.Enable()
|
||||
}
|
||||
} else {
|
||||
epochStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not patched", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
if patchTurtleWoWButton != nil {
|
||||
if patchEpochButton != nil {
|
||||
if paths.EpochPath != "" {
|
||||
patchTurtleWoWButton.Enable()
|
||||
patchEpochButton.Enable()
|
||||
} else {
|
||||
patchTurtleWoWButton.Disable()
|
||||
patchEpochButton.Disable()
|
||||
}
|
||||
}
|
||||
if unpatchTurtleWoWButton != nil {
|
||||
unpatchTurtleWoWButton.Disable()
|
||||
if unpatchEpochButton != nil {
|
||||
unpatchEpochButton.Disable()
|
||||
}
|
||||
}
|
||||
epochStatusLabel.Refresh()
|
||||
|
@@ -1,8 +1,8 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"turtlesilicon/pkg/paths"
|
||||
"turtlesilicon/pkg/utils"
|
||||
"epochsilicon/pkg/paths"
|
||||
"epochsilicon/pkg/utils"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
|
@@ -5,8 +5,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"turtlesilicon/pkg/debug"
|
||||
"turtlesilicon/pkg/utils"
|
||||
"epochsilicon/pkg/debug"
|
||||
"epochsilicon/pkg/utils"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
|
@@ -20,9 +20,9 @@ var (
|
||||
launchButton *widget.Button
|
||||
playButton *widget.Button
|
||||
playButtonText *widget.RichText
|
||||
patchTurtleWoWButton *widget.Button
|
||||
patchEpochButton *widget.Button
|
||||
patchCrossOverButton *widget.Button
|
||||
unpatchTurtleWoWButton *widget.Button
|
||||
unpatchEpochButton *widget.Button
|
||||
unpatchCrossOverButton *widget.Button
|
||||
startServiceButton *widget.Button
|
||||
stopServiceButton *widget.Button
|
||||
@@ -30,7 +30,6 @@ var (
|
||||
// Option checkboxes
|
||||
metalHudCheckbox *widget.Check
|
||||
showTerminalCheckbox *widget.Check
|
||||
vanillaTweaksCheckbox *widget.Check
|
||||
autoDeleteWdbCheckbox *widget.Check
|
||||
|
||||
// Recommended settings button
|
||||
@@ -45,19 +44,6 @@ var (
|
||||
// Environment variables entry
|
||||
envVarsEntry *widget.Entry
|
||||
|
||||
// Graphics settings checkboxes
|
||||
reduceTerrainDistanceCheckbox *widget.Check
|
||||
setMultisampleTo2xCheckbox *widget.Check
|
||||
setShadowLOD0Checkbox *widget.Check
|
||||
libSiliconPatchCheckbox *widget.Check
|
||||
applyGraphicsSettingsButton *widget.Button
|
||||
|
||||
// Graphics settings help buttons
|
||||
reduceTerrainDistanceHelpButton *widget.Button
|
||||
setMultisampleTo2xHelpButton *widget.Button
|
||||
setShadowLOD0HelpButton *widget.Button
|
||||
libSiliconPatchHelpButton *widget.Button
|
||||
|
||||
// Window reference for popup functionality
|
||||
currentWindow fyne.Window
|
||||
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
serviceName = "TurtleSilicon"
|
||||
serviceName = "EpochSilicon"
|
||||
accountName = "sudo_password"
|
||||
)
|
||||
|
||||
|
@@ -23,7 +23,7 @@ func getPrefsPath() (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return filepath.Join(dir, "TurtleSilicon", "prefs.json"), nil
|
||||
return filepath.Join(dir, "EpochSilicon", "prefs.json"), nil
|
||||
}
|
||||
|
||||
func LoadPrefs() (*UserPrefs, error) {
|
||||
|
@@ -11,7 +11,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"turtlesilicon/pkg/debug"
|
||||
"epochsilicon/pkg/debug"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
@@ -130,7 +130,7 @@ func QuotePathForShell(path string) string {
|
||||
}
|
||||
|
||||
func CheckForUpdate(currentVersion string) (latestVersion, releaseNotes string, updateAvailable bool, err error) {
|
||||
resp, err := http.Get("https://api.github.com/repos/tairasu/TurtleSilicon/releases/latest")
|
||||
resp, err := http.Get("https://api.github.com/repos/tairasu/EpochSilicon/releases/latest")
|
||||
if err != nil {
|
||||
return "", "", false, err
|
||||
}
|
||||
@@ -163,7 +163,7 @@ type Asset struct {
|
||||
|
||||
// CheckForUpdateWithAssets returns update information including download assets
|
||||
func CheckForUpdateWithAssets(currentVersion string) (*UpdateInfo, bool, error) {
|
||||
resp, err := http.Get("https://api.github.com/repos/tairasu/TurtleSilicon/releases/latest")
|
||||
resp, err := http.Get("https://api.github.com/repos/tairasu/EpochSilicon/releases/latest")
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
@@ -201,7 +201,7 @@ func CheckForUpdateWithAssets(currentVersion string) (*UpdateInfo, bool, error)
|
||||
// DownloadUpdate downloads the latest release and returns the path to the downloaded file
|
||||
func DownloadUpdate(downloadURL string, progressCallback func(downloaded, total int64)) (string, error) {
|
||||
// Create temporary file
|
||||
tempFile, err := os.CreateTemp("", "TurtleSilicon-update-*.dmg")
|
||||
tempFile, err := os.CreateTemp("", "EpochSilicon-update-*.dmg")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to create temp file: %v", err)
|
||||
}
|
||||
@@ -349,12 +349,12 @@ func InstallUpdate(dmgPath string) error {
|
||||
var newAppPath string
|
||||
|
||||
// First, try the exact name
|
||||
exactPath := filepath.Join(mountPoint, "TurtleSilicon.app")
|
||||
exactPath := filepath.Join(mountPoint, "EpochSilicon.app")
|
||||
if PathExists(exactPath) {
|
||||
newAppPath = exactPath
|
||||
} else {
|
||||
// Search for any .app bundle in the mount point
|
||||
debug.Printf("TurtleSilicon.app not found at exact path, searching for .app bundles")
|
||||
debug.Printf("EpochSilicon.app not found at exact path, searching for .app bundles")
|
||||
entries, err := os.ReadDir(mountPoint)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to read DMG contents: %v", err)
|
||||
@@ -406,7 +406,7 @@ func InstallUpdate(dmgPath string) error {
|
||||
}
|
||||
|
||||
// Fix executable permissions for the main binary
|
||||
executablePath := filepath.Join(currentAppPath, "Contents", "MacOS", "turtlesilicon")
|
||||
executablePath := filepath.Join(currentAppPath, "Contents", "MacOS", "epochsilicon")
|
||||
if PathExists(executablePath) {
|
||||
debug.Printf("Setting executable permissions for: %s", executablePath)
|
||||
if err := os.Chmod(executablePath, 0755); err != nil {
|
||||
@@ -466,7 +466,7 @@ func TestDMGMount(dmgPath string) (string, string, error) {
|
||||
if infoErr == nil {
|
||||
infoLines := strings.Split(string(infoOutput), "\n")
|
||||
for _, line := range infoLines {
|
||||
if strings.Contains(line, "/Volumes/") && strings.Contains(line, "TurtleSilicon") {
|
||||
if strings.Contains(line, "/Volumes/") && strings.Contains(line, "EpochSilicon") {
|
||||
line = strings.TrimSpace(line)
|
||||
if strings.HasPrefix(line, "/Volumes/") {
|
||||
mountPoint = line
|
||||
@@ -487,12 +487,12 @@ func TestDMGMount(dmgPath string) (string, string, error) {
|
||||
var newAppPath string
|
||||
|
||||
// First, try the exact name
|
||||
exactPath := filepath.Join(mountPoint, "TurtleSilicon.app")
|
||||
exactPath := filepath.Join(mountPoint, "EpochSilicon.app")
|
||||
if PathExists(exactPath) {
|
||||
newAppPath = exactPath
|
||||
} else {
|
||||
// Search for any .app bundle in the mount point
|
||||
debug.Printf("TurtleSilicon.app not found at exact path, searching for .app bundles")
|
||||
debug.Printf("EpochSilicon.app not found at exact path, searching for .app bundles")
|
||||
entries, err := os.ReadDir(mountPoint)
|
||||
if err != nil {
|
||||
// Unmount before returning error
|
||||
|
Reference in New Issue
Block a user