use realpath on CmdPath of EXE Icons

This commit is contained in:
cuu 2018-07-25 16:47:11 +08:00
parent bbb9cbba64
commit 1109d67c16
2 changed files with 7 additions and 5 deletions

View File

@ -472,7 +472,7 @@ class MainScreen(object):
elif self.IsExecPackage(_dir+"/"+i): elif self.IsExecPackage(_dir+"/"+i):
iconitem._MyType = ICON_TYPES["EXE"] iconitem._MyType = ICON_TYPES["EXE"]
iconitem._CmdPath = _dir+"/"+i+"/"+i2+".sh" iconitem._CmdPath = os.path.realpath(_dir+"/"+i+"/"+i2+".sh")
MakeExecutable(iconitem._CmdPath) MakeExecutable(iconitem._CmdPath)
cur_page._Icons.append(iconitem) cur_page._Icons.append(iconitem)
else: else:
@ -488,7 +488,7 @@ class MainScreen(object):
#cmd = ReadTheFileContent(_dir+"/"+i) #cmd = ReadTheFileContent(_dir+"/"+i)
iconitem = IconItem() iconitem = IconItem()
iconitem._CmdPath = _dir+"/"+i iconitem._CmdPath = os.path.realpath(_dir+"/"+i)
MakeExecutable(iconitem._CmdPath) MakeExecutable(iconitem._CmdPath)
iconitem._MyType = ICON_TYPES["EXE"] iconitem._MyType = ICON_TYPES["EXE"]
if FileExists( SkinMap( _dir+"/"+ReplaceSuffix(i2,"png"))): if FileExists( SkinMap( _dir+"/"+ReplaceSuffix(i2,"png"))):

View File

@ -284,7 +284,8 @@ def event_process(event,main_screen):
pygame.quit() pygame.quit()
gobject_main_loop.quit() gobject_main_loop.quit()
os.chdir( GetExePath()) os.chdir( GetExePath())
exec_app_cmd = event.message exec_app_cmd = "cd "+os.path.dirname(event.message)+";"
exec_app_cmd += event.message
exec_app_cmd += "; sync & cd "+GetExePath()+"; exec python "+myscriptname exec_app_cmd += "; sync & cd "+GetExePath()+"; exec python "+myscriptname
print(exec_app_cmd) print(exec_app_cmd)
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd) os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
@ -301,7 +302,8 @@ def event_process(event,main_screen):
pygame.quit() pygame.quit()
gobject_main_loop.quit() gobject_main_loop.quit()
os.chdir( GetExePath()) os.chdir( GetExePath())
exec_app_cmd = event.message exec_app_cmd = "cd "+os.path.dirname(event.message)+";"
exec_app_cmd += event.message
exec_app_cmd += "; sync & cd "+GetExePath()+"; exec python "+myscriptname exec_app_cmd += "; sync & cd "+GetExePath()+"; exec python "+myscriptname
print(exec_app_cmd) print(exec_app_cmd)
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd) os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)