[Wine] Script Help

mooseranger wineforum-user at winehq.org
Sat May 30 07:36:54 CDT 2009


Hello,

When running Battle for Middle Earth 2, my screen resolution needs to be set at 1024x768 before I run the program or it crashes when I start a game. (It does switch automatically to 1024x768 but if I didn't set it myself beforehand it will crash once I start a game).  Normally I have my resolution set at 1440x900.

I wrote a script to do a few things:


Code:

sed 's/"UseGLSL"="enabled"/"UseGLSL"="disabled"/' -i /home/david/.wine/user.reg
xrandr -s 1024x768
sleep 2
env WINEPREFIX="/home/david/.wine" 
wine "C:\Program Files\Electronic Arts\The Battle for Middle-earth (tm) II\lotrbfme2.exe"
sed 's/"UseGLSL"="disabled"/"UseGLSL"="enabled"/' -i /home/david/.wine/user.reg
xrandr -s 1440x900




The sed stuff is in there because LOTRBFME2 requires UseGLSL disabled but for other things I need it enabled.

That said, whenever I run this script it crashes when I try to load a game just the same as it does if my resolution were 1440x900 before I launched it.  If I take out the xrandr -s 1024x768 line, manually change the resolution in the nvidia x server settings, then run the script, it works fine (but isn't as convenient).

Does nvidia x server settings do something xrandr doesn't, or is there something else I am supposed to do?

(of course, if anyone knew how to get battle for middle earth to run fine from 1440x900, that would be great as well).

Thank you very much!







More information about the wine-users mailing list