GithubHelp home page GithubHelp logo

swtor_fix's Introduction

Fix for Star Wars: The Old Republic to run on WINE

WINE doesn't handle SW:TOR by default and needs a patch (http://bugs.winehq.org/show_bug.cgi?id=29168) I wanted to use WINE from a repo without patching, so I implemented this small application to allow SW:TOR to work correctly. All it does is waiting for swtor.exe to start up, takes his PID and launch two threads. First thread simply waits for swtor.exe to end to do cleanup, the second one just updates KUSER_SHARED_DATA's time fields, so the game network code just works as it should be and then copies those into swtor.exe process memory.

This code is based on original patch for WINE by Carsten Juttner & Xolotl Loki

How to:

  • copy swtor_fix.exe to ~/.wine/drive_c
  • run two terminals
  • on first one, run: $ WINEDEBUG=-all wine c:\swtor_fix.exe
  • switch to second one and run: $ WINEDEBUG=-all wine ~/.wine/drive_c/Program\ Files\ (x86)/Electronic\ Arts/BioWare/Star\ Wars\ -\ The\ Old\ Republic/launcher.exe

swtor_fix's People

Contributors

aljen avatar er1c avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swtor_fix's Issues

Enhancement: new launcher.sh to project

There is an awesome script floating around to help download and run your patcher. I have modified it to turn off Bit Runner, which is a very annoying blocker for installing on wine.

There may be a lot of additional enhancements and configuration that could be added. Like it asking if you would like it to run winecfg and telling you to how to quickly setup a virtual desktop. But this should be good for most peoples needs.

Might call this awesomelauncher? Or swtorFirstTimeSetupLauncher? Or aljenLauncherOfAwesomeness?

The script originated from (had to do a kessle run to parse it all out): http://appdb.winehq.org/objectManager.php?sClass=version&iId=27088
As far as licensing, I have a version of below that is 2 clause BSD on my computer. You are free to license the below copy as how you see fit, aljen. I am also not interested in credit. I want swtor_fix to be a speedy patch for everyone out there!

Below is the script. It is also at http://pastebin.com/z9ttJ9Nv

#! /bin/bash

# All cudo's goes towards the original script! The added script below is purely cosmetic in comparison (in that the new part only automates a previously manual step).

unset OPTIMUS_PREFIX
# In case of an optimus-enabled laptop, the use of primusrun is recommended over    optirun.
# Don't uncomment this line in any other case.
# OPTIMUS_PREFIX="                              primusrun"

### BELOW HAS BEEN ADDED TO TURN OFF BIT RUNNER AND SUPPORT PLAYONLINUX ###

#Regardless of where our launcher is located, lets automatically find it and use it!  Even if this script is in a parent directory.
settingslocation=`echo \'``find . -name "launcher.settings" | grep "Star Wars - The Old Republic/launcher.settings"``echo \'`
launcherlocation=`echo \'``find . -name "launcher.exe" | grep "Star Wars - The Old Republic/launcher.exe"``echo \'`

if [ -z "$settingslocation" ]; then
    settingslocation=`echo \'``find . -name "launcher.settings" | grep "./launcher.settings"``echo \'`
fi

if [ -z "$launcherlocation" ]; then
    launcherlocation=`echo \'``find . -name "launcher.exe" | grep "./launcher.exe"``echo \'`
fi

#This is our main command!
LAUNCHER_COMMAND="wine $launcherlocation"

#The text to replace in order to turn off bit runner!
sourcetext=`echo \'`'"PatchingMode": "{ \\"swtor\\": \\"BR\\" }"'`echo \'`
replacetext=`echo \'`'"PatchingMode": "{ \\"swtor\\": \\"SSN\\" }"'`echo \'`

#Is launcher.settings setup for running bit runner?
cmd="grep -i $sourcetext $settingslocation"
istextfound=`eval $cmd`

if [ -n "$istextfound" ]; then
    echo "This will update the launcher.settings file so that bitraider is disabled!"
    echo
    echo "Replacing: $sourcetext"
    echo "with:      $replacetext"
    echo

    islaunchersettingsfixed=n
fi

#Has launcher.settings had  bit runner turned off?
cmd="grep -i $replacetext $settingslocation"
istextfound=`eval $cmd`

if [ -n "$istextfound" ]; then
    echo "This file has been updated so bitraider is disabled."
    echo
    echo "Ready to install!"
    echo

    islaunchersettingsfixed=y
fi

#If launcher.settings doesn't even have bit runner turned on or off, assume this is the first run of the launcher!
#  If it runs flawlessly, there will be no need to turn off bit runner.  This script will not need to be ran again!
if [ -z "$islaunchersettingsfixed" ]; then
    echo "The launcher has never been ran.  Please run the launcher for the first time."
    echo "Login using your user name and password.  Then run the launcher."
    echo
    echo "1.  If the launcher fails:  This is good! Please re-run this script. It will turn off bitraider the second time around."
    echo "2.  If the launcher succeeds:  The first time, there is no need to run this script again.  Please run the installer directly next time!"
    echo
fi

echo "Would you like to Continue? [y/n]"
read input

if [ ! $input = y ]; then
    echo
    echo "Thank you for using this script.  You have choosen $input which is not lower case y.  Exiting..."
    echo

    exit
fi

#Only backup launcher.settings and turn off bit runner in launcher.settings when bit runner is enabled.
if [ $islaunchersettingsfixed = n ]; then
    echo "Backing up launcher.settings to launcher.settings`date +%y%m%d_%H%M`.bak"
    settingsbackuplocation="$settingslocation`date +%y%m%d_%H%M`.bak"

    #Makes a backup of launcher.settings! This only gets done when launcher.settings does not have Bit Runner disabled.
    cmd="cp $settingslocation $settingsbackuplocation"
    eval $cmd

    echo
    echo "Making changes to launcher.settings..."

    #Removes ' from around these statements.  Sed will have its own ' around both statements.
    sourcetextstring=`echo $sourcetext | sed "s|'||g"`
    replacetextstring=`echo $replacetext | sed "s|'||g"`

    #Replaces the desired text in launcher.settings
    cmd="sed 's|$sourcetextstring|$replacetextstring|g' $settingsbackuplocation > $settingslocation"

    echo
    echo "It is strongly advised to allow bit runner to be turned off.  Unless you have a very good reason not to, please select y here.  Turn off bit runner? [Y/n]
    read turnoffbitrunner

    if [ ! $turnoffbitrunner = n ]; then
        eval $cmd
    fi

    echo
    echo "Finished updating launcher.settings! You will now be able to use the installer to download swtor!"

    #Cleanup our local variables
    unset turnoffbitrunner
    unset replacetextstring
    unset sourcetextstring
    unset settingsbackuplocation
fi

echo
echo "Is your wine environment in 64 bit mode? (Choose y if unsure. If running this on playonlinux 'in 32 bit mode', choose n) [Y/n]"
read specifyarch

echo
echo "Would you like to configure wine to use a custom prefix? (Choose y if unsure. If running this on playonlinux, choose n) [Y/n]"
read specifyprefix

# Set up a new wineprefix in the game directory, and reduce debugging to improve performance.
# If you don't like it there, or running the script from somewhere else, change it.
# Please note that WINEARCH=win32 is REQUIRED.
if [ $specifyarch = y -o $specifyarch = Y -o $specifyarch = yes -o $specifyarch = Yes -o $specifyarch = YES ]; then
    export WINEARCH=win32
    export WINEDEBUG=-all
fi

if [ $specifyprefix = y -o $specifyprefix = Y -o $specifyprefix = yes -o $specifyprefix = Yes -o $specifyprefix = YES ]; then
    export WINEPREFIX="$( pwd )/wineprefix"
fi

# Clean up after ourselves.
unset settingslocation
unset launcherlocation

unset islauchersettingsfixed
unset specifyarch
unset specifyprefix
unset istextfound
unset input
unset cmd

### FROM HERE ON OUT IS THE ORIGINAL SCRIPT  ###

# Check if we have swtor_fix.exe, and download it if we don't.
# This can be placed anywhere on the system, and must be run parallel to the game.

if [ ! -f swtor_fix.exe ]; then
    wget -O swtor_fix.exe https://github.com/aljen/swtor_fix/raw/master/swtor_fix.exe
fi

# Start it parallely.
wine swtor_fix.exe &

# Give it a sec to fire up.
sleep 1

# Install and set up components in wineprefix.
# Since that command does nothing if already ran, we need no checks there.
winetricks msvcp90=native d3dx9_36 vcrun2008 msls31 winhttp

# Here we come!
eval $OPTIMUS_PREFIX $LAUNCHER_COMMAND

# Since wait for swtor_fix.exe to finish.
wait $!

# Clean up after ourselves.
unset WINEARCH
unset WINEPREFIX
unset WINEDEBUG

Firefox warning about a virus

Is this program completely safe? After downloading it, Firefox informs that the file contains a malware or a virus. I wouldn't be so concerned about a Windows malware, but now that I'm supposed to run it under WINE... :P

Doesn't work correctly with Catalina wine32on64?

I have been taking care of a guide on how to run the game on macOS systems. Recently I saw a huge increase in people asking me how to run it on Catalina, so I ventured into the unknown and updated to Catalina.

With wine32on64 in place and boot args set to allow 32 bit, it looks like the pre-swtor_fix issue came back even though the fix did launch correctly. Ship sounds playing in the background but not launching. Wondering if you might give some tips on what might be going on. Screenshot attached.
Screen Shot 2020-04-05 at 4 24 17 PM

Error when running the 2nd terminal command

I get this error: [0113/164128:ERROR:network_change_notifier_win.cc(111)] WSALookupServiceBegin failed with: 8

The launcher opens but when I try to log in it basically keeps spinning. Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.