functional
Some checks failed
Build Go/Fyne App for macOS ARM64 / build (pull_request) Has been cancelled

This commit is contained in:
2025-07-22 09:00:31 -07:00
parent b744b6bc2b
commit abb9f3a0e5
6 changed files with 48 additions and 25 deletions

View File

@@ -17,7 +17,7 @@
<string>MacOSX</string> <string>MacOSX</string>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>91</string> <string>99</string>
<key>NSHighResolutionCapable</key> <key>NSHighResolutionCapable</key>
<true/> <true/>
<key>NSSupportsAutomaticGraphicsSwitching</key> <key>NSSupportsAutomaticGraphicsSwitching</key>

View File

@@ -3,4 +3,4 @@
Name = "EpochSilicon" Name = "EpochSilicon"
ID = "com.eburk.epochsilicon" ID = "com.eburk.epochsilicon"
Version = "1.2.4" Version = "1.2.4"
Build = 92 Build = 100

View File

@@ -201,17 +201,30 @@ func PatchEpoch(myWindow fyne.Window, updateAllStatuses func()) {
} }
debug.Println("Downloading updates from Project Epoch servers.") 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.") // TODO: Change from dialog to pulsing animation
dialog.ShowInformation("Downloading patches", "Downloading patches for Project Epoch, this will take some time. Please wait until the status changes to \"Patched\"", myWindow)
dialog.ShowInformation("Success", "Epoch patching process completed.", myWindow) paths.DownloadingPatches = true
go func() {
stats, err := epoch.Update(paths.EpochPath, true, true, false)
if err != nil {
errMsg := fmt.Sprintf("failed to update Epoch files: %v", err)
fyne.Do(func() {
dialog.ShowError(errors.New(errMsg), myWindow)
})
paths.DownloadingPatches = false
log.Println(errMsg)
}
log.Printf("Successfully updated %d Epoch files", stats.Updated)
debug.Println("Epoch patching with bundled resources completed successfully.")
fyne.Do(func() {
dialog.ShowInformation("Success", "Epoch patching process completed.", myWindow)
})
fyne.DoAndWait(func() {
paths.DownloadingPatches = false
updateAllStatuses()
})
}()
updateAllStatuses() updateAllStatuses()
} }

View File

@@ -23,6 +23,7 @@ var (
PatchesAppliedCrossOver = false PatchesAppliedCrossOver = false
RosettaX87ServiceRunning = false RosettaX87ServiceRunning = false
ServiceStarting = false ServiceStarting = false
DownloadingPatches = false
) )
func SelectCrossOverPath(myWindow fyne.Window, crossoverPathLabel *widget.RichText, updateAllStatuses func()) { func SelectCrossOverPath(myWindow fyne.Window, crossoverPathLabel *widget.RichText, updateAllStatuses func()) {

View File

@@ -63,7 +63,7 @@ func createPathSelectionForm(myWindow fyne.Window) *widget.Form {
widget.NewFormItem("CrossOver Path:", container.NewBorder(nil, nil, nil, widget.NewButton("Set/Change", func() { widget.NewFormItem("CrossOver Path:", container.NewBorder(nil, nil, nil, widget.NewButton("Set/Change", func() {
paths.SelectCrossOverPath(myWindow, crossoverPathLabel, UpdateAllStatuses) paths.SelectCrossOverPath(myWindow, crossoverPathLabel, UpdateAllStatuses)
}), crossoverPathLabel)), }), crossoverPathLabel)),
widget.NewFormItem("Epoch Path:", container.NewBorder(nil, nil, nil, widget.NewButton("Set/Change", func() { widget.NewFormItem("Warcraft Path:", container.NewBorder(nil, nil, nil, widget.NewButton("Set/Change", func() {
paths.SelectEpochPath(myWindow, epochPathLabel, UpdateAllStatuses) paths.SelectEpochPath(myWindow, epochPathLabel, UpdateAllStatuses)
}), epochPathLabel)), }), epochPathLabel)),
) )

View File

@@ -106,6 +106,17 @@ func updateEpochStatus() {
} }
} }
// Check for Epoch-specific files
epochPatchesApplied := false
stats, err := epoch.Update(paths.EpochPath, false, true, true)
if err != nil {
debug.Printf("Failed to get download Epoch patches: %v", err)
}
if stats.Outdated == 0 {
debug.Println("Nothing is outdated")
epochPatchesApplied = true
}
// Check if patched files have the correct size (matches bundled versions) // Check if patched files have the correct size (matches bundled versions)
winerosettaDllCorrectSize := utils.CompareFileWithBundledResource(winerosettaDllPath, "winerosetta/winerosetta.dll") winerosettaDllCorrectSize := utils.CompareFileWithBundledResource(winerosettaDllPath, "winerosetta/winerosetta.dll")
d3d9DllCorrectSize := utils.CompareFileWithBundledResource(d3d9DllPath, "winerosetta/d3d9.dll") d3d9DllCorrectSize := utils.CompareFileWithBundledResource(d3d9DllPath, "winerosetta/d3d9.dll")
@@ -116,24 +127,22 @@ func updateEpochStatus() {
utils.DirExists(rosettaX87DirPath) && utils.PathExists(rosettaX87ExePath) && utils.DirExists(rosettaX87DirPath) && utils.PathExists(rosettaX87ExePath) &&
utils.PathExists(libRuntimeRosettaX87Path) && dllsFileValid && utils.PathExists(libRuntimeRosettaX87Path) && dllsFileValid &&
winerosettaDllCorrectSize && d3d9DllCorrectSize && winerosettaDllCorrectSize && d3d9DllCorrectSize &&
rosettaX87CorrectSize && libRuntimeRosettaX87CorrectSize { rosettaX87CorrectSize && libRuntimeRosettaX87CorrectSize && epochPatchesApplied {
paths.PatchesAppliedEpoch = true 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() epochPathLabel.Refresh()
if paths.DownloadingPatches {
if paths.PatchesAppliedEpoch { epochStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Downloading...", Style: widget.RichTextStyle{ColorName: theme.ColorNamePrimary}}}
if patchEpochButton != nil {
patchEpochButton.Disable()
}
if unpatchEpochButton != nil {
unpatchEpochButton.Disable()
}
} else if paths.PatchesAppliedEpoch {
epochStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Patched", Style: widget.RichTextStyle{ColorName: theme.ColorNameSuccess}}} epochStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Patched", Style: widget.RichTextStyle{ColorName: theme.ColorNameSuccess}}}
if patchEpochButton != nil { if patchEpochButton != nil {
patchEpochButton.Disable() patchEpochButton.Disable()