Epochify (#1)
Make it work for Epoch! Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
serviceName = "TurtleSilicon"
|
||||
serviceName = "EpochSilicon"
|
||||
accountName = "sudo_password"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,25 +8,14 @@ import (
|
||||
|
||||
type UserPrefs struct {
|
||||
SuppressedUpdateVersion string `json:"suppressed_update_version"`
|
||||
TurtleWoWPath string `json:"turtlewow_path"`
|
||||
EpochPath string `json:"epoch_path"`
|
||||
CrossOverPath string `json:"crossover_path"`
|
||||
EnvironmentVariables string `json:"environment_variables"`
|
||||
SaveSudoPassword bool `json:"save_sudo_password"`
|
||||
ShowTerminalNormally bool `json:"show_terminal_normally"`
|
||||
EnableVanillaTweaks bool `json:"enable_vanilla_tweaks"`
|
||||
RemapOptionAsAlt bool `json:"remap_option_as_alt"`
|
||||
AutoDeleteWdb bool `json:"auto_delete_wdb"`
|
||||
EnableMetalHud bool `json:"enable_metal_hud"`
|
||||
|
||||
// Graphics settings
|
||||
ReduceTerrainDistance bool `json:"reduce_terrain_distance"`
|
||||
SetMultisampleTo2x bool `json:"set_multisample_to_2x"`
|
||||
SetShadowLOD0 bool `json:"set_shadow_lod_0"`
|
||||
EnableLibSiliconPatch bool `json:"enable_lib_silicon_patch"`
|
||||
|
||||
// Tracking whether user has manually disabled these settings
|
||||
UserDisabledShadowLOD bool `json:"user_disabled_shadow_lod"`
|
||||
UserDisabledLibSiliconPatch bool `json:"user_disabled_lib_silicon_patch"`
|
||||
}
|
||||
|
||||
func getPrefsPath() (string, error) {
|
||||
@@ -34,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