diff --git a/cmd/main/aboutdialog.go b/cmd/main/aboutdialog.go index 3a68104..bae34a4 100644 --- a/cmd/main/aboutdialog.go +++ b/cmd/main/aboutdialog.go @@ -4,7 +4,6 @@ import ( "fmt" "os/exec" - "github.com/balazsgrill/potatodrive/win" "github.com/lxn/walk" . "github.com/lxn/walk/declarative" "github.com/rs/zerolog/log" @@ -20,7 +19,7 @@ func openlink(link *walk.LinkLabelLink) { func aboutDialog(_ walk.Form) (int, error) { return MainWindow{ Title: "About PotatoDrive", - Icon: win.InstalledFile(win.POTATOICO, false), + Icon: "#2\\0409", MinSize: Size{300, 200}, Size: Size{300, 200}, MaxSize: Size{300, 200}, diff --git a/cmd/main/ui.go b/cmd/main/ui.go index d4ae557..91ee2ba 100644 --- a/cmd/main/ui.go +++ b/cmd/main/ui.go @@ -12,7 +12,7 @@ import ( "golang.org/x/sys/windows" ) -//go:generate rsrc -manifest .\main.exe.manifest -o rsrc.syso +//go:generate rsrc -manifest .\main.exe.manifest -o rsrc.syso -ico ../../potato.ico type UI struct { *walk.MainWindow diff --git a/win/installation.go b/win/installation.go index e50c086..16cac87 100644 --- a/win/installation.go +++ b/win/installation.go @@ -15,24 +15,19 @@ const ( MUTEXNAME = "7122117b-3a2e-4c5d-bb21-2c9d0d2243bd" ) -func InstalledFile(relativename string, absolute bool) string { +func InstalledFile(relativename string, short bool) string { exec, err := os.Executable() if strings.HasPrefix(exec, os.TempDir()) { // Detects development mode, where files are looked for in the working directory rather than along with the exe - if absolute { - exec, err = os.Getwd() - } else { - exec = "." - } + exec, err = os.Getwd() } else { exec = filepath.Dir(exec) } - if err != nil { panic(err) } path := filepath.Join(exec, relativename) - if absolute { + if short { return ToShortPath(path) } return path