Runprogram

Linux specific forum
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Runprogram

Post by Inf0Byt3 »

I'm trying to make this work on linux but i'm stumbled it ain't working... I want to run UPX 2.0 for lin with this proggie but it returns 6222 -> i bet this is an error in upx. I am correctly calling the app. Why doesn't it work?

Code: Select all

power.s = "9"
upx.s = "/root/upx"
file.s = "/root/testexe"
Debug RunProgram(upx,"-"+power.s+" "+Chr(34)+file+Chr(34),"",#PB_RunProgram_Wait)
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

Hi,

I think, you're not root, trying to run a programm in /root/...
I know, you're runnung ubuntu.... are you sure, you have the appropriate rights for this folder :?: May you'd installed it as root but now trying to run it as normal user...
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Yes, I am root, but I don't have ubuntu installed. I use Mandriva2006. I think there's something wrong with the RunProgram() procedure :roll: . The files are there, but it still doesn't run correctly :(.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

Hmm.. you're right.. I don't have upx installed an get a debug message of 12389 (which should be only >0 if the command succeeds... :roll: )
It's must be a bug in RunProgram().. type what ever you want as programm to start (i.e: jkdjshfgjksdgfj) Runprogram() never fails :evil: ...
Giving a path to a prog that exsists on my PC, all went well...
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Doesn't exist for linux a command like ShellExecute() for windows? There should be one there too :roll: . Hope whis will be fixed in the next version of PB...
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
WishMaster
Enthusiast
Enthusiast
Posts: 277
Joined: Fri Jun 17, 2005 7:13 pm
Location: Franconia
Contact:

Post by WishMaster »

You can use System_() instead of RunProgram()


...and do NOT work as root! This is not healthy!
Image Image
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Thanks WishMaster! BTW, I ran only this as root to test it, I usually use my normal account.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Post Reply