LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Greetings from noob first time poster - .run extension question (http://www.linuxquestions.org/questions/linux-newbie-8/greetings-from-noob-first-time-poster-run-extension-question-418775/)

RolySaul 02-23-2006 11:19 AM

Greetings from noob first time poster - .run extension question
 
If I understand correctly, *.run files are the linux equivalent of *.exe windows files. They run alone right??

If that is correct, then I shouldn't need to associate them with another app.

If that is correct, then me associating *.run files with a text editor was not the smartest thing I've ever done, but it was honestly done in the interests of experimentation, thinking that I could easily change back to the proper association, BUT..... Thru kde 3.2.1, I cannot find a way to associate *.run files with nothing.

If that makes any sense, I would appreciate any advice on this...I tried searching thru a few of these forums, but I didn't see the same problem.

When I try to launch a .run file now, specifically a radeon 9600 driver package, ( I know I know), it opens up in Kwrite and totally hoses Kwrite for about a minute lol.....

Honestly guys I did search for a while but found nothing so here it is, and thanks.

lord-fu 02-23-2006 11:23 AM

I am pretty sure you can just from a terminal still just

./packagename.run

The only files(I think) I have ran into were my Nvidia drivers with the run extension. That has been a while since I ran that, well a few weeks ago but I believe thats how I did it. That will just run the file not reassociate it with whatever.

Sorry if thats not what you wanted, and sorry if I am wrong.

Oh and welcome to Linux Questions!

acid_kewpie 02-23-2006 11:24 AM

well they aren't the "equivalent" as they aren't really official in any way (unlike rpm's, deb's, tar.gz's etc...), but yes they are usually some form of binary that would run like it. there is no association, you would simply set the file's permissions to be executable. that's all you need to do. alternatively you could associate it with bash or something similar.

unSpawn 02-23-2006 12:34 PM

Doesn't that sound familiar?..
 
alternatively you could associate it with bash or something similar
Executing files only by looking at the extension. Doesn't *that* sound familiar?..


I am pretty sure you can just from a terminal still just ./packagename.run
...or "sh ./packagename.run" (so it doesn't even *need* to be made executable) is IMHO the correct answer if you don't run .run files often (that is like every five minutes).

If you insist on associating files to be executed at least run a wrapper. This one will only run a file with /bin/sh in an xterm window if you provide the right MD5sum (if a site doesn't give you even the simplest of verification methods, should you be running that file?). That is not much (it should be improved with at least inspection using "file") but I hope it can serve as a simple warning you should not run anything "just because".

Code:

#!/bin/sh
filen="${1}"; term="xterm -e"; if [ -e "${filen}" ]; then printfn="$(basename ${filen})"; zenity --warning --title \
"Run file \"${printfn}\"" --text="You've chosen to run file \"${printfn}\"\nYou must give the MD5sum next."
case "$?" in 0) SUM=($(zenity --entry --title "Checking \"${printfn}\"" --text="Paste the sum part of the MD5sum:" \
2>&1)); SUM=${SUM[0]}; CKSUM=($(md5sum "${filen}")); CHSUM=${CKSUM[0]}; if [ "${SUM[0]}" = "${CKSUM[0]}" \
]; then zenity --info --title "OK" --text="Sums match, ready to run \"/bin/sh ${filen}\"."; xterm -e "/bin/sh ${filen}";
else zenity --warning --title "Checking \"${printfn}\" FAILED!" --text="sum ${CKSUM[0]} doesn't match ${SUM0}";
exit 1; fi;; *) exit 1;; esac; fi; exit 0

Save this script under any name you like, make executable, and when asked what application to run the .run file with supply this one. It will take 1 argument (a filename) and relies only on Zenity (like ancient Xdialog) so it should be easy to change if you got something similar.


All times are GMT -5. The time now is 04:34 PM.