Go Back   Champions of Regnum > English > Technical Support > Linux

Linux Technical issues under Linux platform

Reply
 
Thread Tools Display Modes
Old 07-14-2008, 03:44 PM   #1
Rolle
Pledge
 
Join Date: Jun 2007
Posts: 15
Rolle is on a distinguished road
Default Installerscript for Regnum on openSuSE

Heya all!

I made a script around the new installer for regnum to automize the installation of the dependencies and to create a start script. Because of being german I made the comments in german. It would be nice if someone could translate the script for other linux versions so all of us would profit. If not at least the ones using openSuSE could profit.

Thread in the german forum: http://regnum-online.de/forum/ftopic1139.html
packed scripts: http://rolandholder.ro.funpic.de/scr...tall.sh.tar.gz
__________________
Rolanda - marksman - German Guardians
R o l a n d a - warlock - German Guardians
Adnalor - knight - German Guardians
Rolle no ha iniciado sesión   Reply With Quote
Old 07-15-2008, 01:19 AM   #2
sakuramboo
Pledge
 
Join Date: Jan 2007
Posts: 27
sakuramboo is on a distinguished road
Default

in stead of RO_USER=roland, you should just use $USER instead. `echo $USER` will output the user you are logged in as.

also, user input would be good for determining which version of RO the user wants.

replace BIT=32 with...

echo "Are you running a 32bit or 64bit OS? (Please type 32 or 64)"
read BIT

if [ $BIT != "32" ]
if [ $BIT != "64" ]
echo "You did not follow directions!"
exit
fi
fi

good job with the script, though. looking really good.

EDIT: now that i think about it, looking over the script again, you dont even need $USER. the only time you call $RO_USER is for the users home directory. might as well just use $HOME instead.

also, line 26 isnt really needed. it is if you plan on installing RO as a different user. but, if that is the case, just log in as that user or just sudo -u <different user> <script>.

i would also add checks for the directory install path. something like...

echo "Please specify the install path."
echo "[$HOME/regnum_online]"
read RO_PATH

EDIT 2: the if for the version check could also be done like this to save space...

if [[ $BIT != "32" && $BIT != "64" ]]
echo "You didn't follow directions right!"
exit
fi

Last edited by sakuramboo; 07-15-2008 at 01:40 AM.
sakuramboo no ha iniciado sesión   Reply With Quote
Old 07-15-2008, 10:33 AM   #3
Rolle
Pledge
 
Join Date: Jun 2007
Posts: 15
Rolle is on a distinguished road
Default

Use of the variable $USER wont work because the script has to be run with root rights. That's the only way it is possible to install rpms in the system. Same for $HOME as this could be /root depending on the way you get root rights. Hm, I should have mentioned earlier...

Using user input to answer some questions instead of filling in the variables would be an idea, I'm just used to fill in variables in scripts. There is no real reason why i did it this way.

And btw, thanks for the feedback.
__________________
Rolanda - marksman - German Guardians
R o l a n d a - warlock - German Guardians
Adnalor - knight - German Guardians
Rolle no ha iniciado sesión   Reply With Quote
Old 07-15-2008, 09:32 PM   #4
sakuramboo
Pledge
 
Join Date: Jan 2007
Posts: 27
sakuramboo is on a distinguished road
Default

im sorry, but i am not too familiar with suse (ubuntu, fedora, redhat and slackware is what i have used). but, in both ubuntu and fedora, i was able to install the game as a user and not as root. the only reason to run the installer as root is to install it system wide (ie. in /usr). instead, i chose to install it in my users home directory. the only problem i had with fedora was that i had to modify SELinux to allow for the library files to be read from the regnum directory.

but, also, if installing packages is the issue, in stead of using sudo, use gksu instead. this way, the user will get a graphical password prompt and the command will run as root. since package installation is really the only need to have root, just run gksu rpm -I <package1> <package2> <etc.>, the user will get the prompt, type in the password, and the rpm's will get installed. upon completion, the script continues as a regular user.

good job with the script, though.
sakuramboo no ha iniciado sesión   Reply With Quote
Old 07-15-2008, 11:17 PM   #5
Rolle
Pledge
 
Join Date: Jun 2007
Posts: 15
Rolle is on a distinguished road
Default

Sure, installing the game can be done with user rights, installing it system wide would bring some other problems, espacially when there are updates for regnum.

I used sudo because I mostly work in the shell. And sudo is installed on every openSuSE, gksu or xsu or kdesu are only installed when the corresponding desktop is installed. Because of SuSE not simply offering one desktop this would have been too complicated. But I must convince, I never thought about it.

So the best way starting the script would be in a shell, either as root or per sudo. So you could also install regnum via a SSH shell.

What is missing in the script is a test for appropriate graphics drivers being installed. But atm I see no way to install them automatically since not all driver versions run with regnum and there are too many ways to install the drivers and different preferences which installation way suits best the needs of the specific user. So the only thing one could do would be to integrate a test. This regnum itself will do at the startup.

But I'm really looking forward for new ideas to integrate or to change something, the script was made for my needs and with my sight on automation.
__________________
Rolanda - marksman - German Guardians
R o l a n d a - warlock - German Guardians
Adnalor - knight - German Guardians
Rolle no ha iniciado sesión   Reply With Quote
Old 07-23-2008, 01:50 PM   #6
tak
Banned
 
Join Date: Apr 2007
Posts: 309
tak is on a distinguished road
Default

Quote:
Originally Posted by sakuramboo
replace BIT=32 with...

echo "Are you running a 32bit or 64bit OS? (Please type 32 or 64)"
read BIT

if [ $BIT != "32" ]
if [ $BIT != "64" ]
echo "You did not follow directions!"
exit
fi
fi
BIT=`uname -m`
if [ $BIT == "i386" || $BIT == "i686"]
wget 32 bit version
if [ $BIT == "x86_64" ]
wget 64 bit version
fi
fi
tak no ha iniciado sesión   Reply With Quote
Old 07-23-2008, 11:13 PM   #7
Rolle
Pledge
 
Join Date: Jun 2007
Posts: 15
Rolle is on a distinguished road
Default

Nice idea, will integrate it.
__________________
Rolanda - marksman - German Guardians
R o l a n d a - warlock - German Guardians
Adnalor - knight - German Guardians
Rolle no ha iniciado sesión   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:39 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
NGD Studios 2002-2024 © All rights reserved