diff --git a/README.md b/README.md index c4550a3..b401429 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ go get -u -v github.com/cuu/LauncherGoDev * https://github.com/itchyny/volume-go * https://github.com/go-ini/ini * github.com/cavaliercoder/grab +* github.com/yookoala/realpath # Create “.mpd_cpi.conf” config diff --git a/mainscreen.go b/mainscreen.go index dfdf54b..dd9de29 100644 --- a/mainscreen.go +++ b/mainscreen.go @@ -11,6 +11,9 @@ import ( "path/filepath" //os/exec" "encoding/json" + + "github.com/yookoala/realpath" + "github.com/cuu/LauncherGoDev/sysgo/UI" "github.com/cuu/LauncherGoDev/sysgo/UI/Emulator" @@ -145,8 +148,12 @@ func ReadTheDirIntoPages(self *UI.MainScreen, _dir string, pglevel int, cur_page if strings.HasSuffix(strings.ToLower(f.Name()),UI.IconExt) { i2 := self.ExtraName(f.Name()) iconitem := UI.NewIconItem() - abs_path,_ := filepath.Abs(_dir+"/"+f.Name()) - iconitem.CmdPath = abs_path + rel_path,err := realpath.Realpath( _dir+"/"+f.Name() ) + if err != nil { + rel_path,_ = filepath.Abs(_dir+"/"+f.Name()) + } + + iconitem.CmdPath = rel_path UI.MakeExecutable( iconitem.CmdPath ) iconitem.MyType = UI.ICON_TYPES["EXE"] if UI.FileExists( UI.SkinMap( _dir+"/"+ UI.ReplaceSuffix(i2,"png"))) {