diff --git a/src/appimaged/appimaged.go b/src/appimaged/appimaged.go index 281c89ea..df899d2d 100644 --- a/src/appimaged/appimaged.go +++ b/src/appimaged/appimaged.go @@ -258,8 +258,15 @@ func moveDesktopFiles(ai *AppImage) error { if err != nil { return err } - if *verbosePtr { - log.Println("main: Moved ", desktopcachedir+"/appimagekit_"+ai.md5+".desktop to", xdg.DataHome+"/applications/") + for _, file := range files { + if *verbosePtr == true { + log.Println("main: Moving", file.Name(), "to", xdg.DataHome+"/applications/") + } + + // Call external mv because os.Rename() may fail with EXDEV error "invalid cross-device link" + cmd := exec.Command("mv", desktopcachedir+"/"+file.Name(), xdg.DataHome+"/applications/") + err := cmd.Run() + helpers.LogError("main", err) } if !ai.startup {