[News] How to Get SWTOR to work with Steam Overlay - Advanced Users Only
Register now to get rid of this ad!
+ Reply to Thread
Results 1 to 6 of 6

Thread: How to Get SWTOR to work with Steam Overlay - Advanced Users Only

  1. #1
    Mr Catface Inflik Inflik's Avatar
    Join Date
    Dec 2009
    Posts
    4,245
    Thanks
    24
    Thanked 393 Times in 191 Posts

    How to Get SWTOR to work with Steam Overlay - Advanced Users Only

    Posted from SWTOR Germany Forums. For those who really want to get STEAM overlay and UI to work on SWTOR, follow the instructions below. The reason he left the file uncompiled was so people could see the source and show he wasn't trying to design a logger or anything of that nature.

    OK. I think this will work for everyone...

    I still don't want to give out an exe as a matter of principle, so you are going to make it yourself. But don't worry, you don't have to download anything to make it, which is another of my self given requirements =)

    Step 1:
    - copy/paste this code into a text editor (ex. notepad) and save it as 'swtorsteam.txt'
    - I saved mine on the desktop
    - DO NOT NAME IT 'steamswtor.txt' OR THE SWTOR LAUNCHER WILL SEE PART OF THAT NAME LATER 'swtor.exe' AND WILL THINK THE REAL 'swtor.exe' IS RUNNING

    Code:
    using System;
    using System.Diagnostics;
    using System.IO;
    using System.IO.Pipes;
    using System.Management;
    using System.Threading;
    using System.Windows.Forms;
    
    namespace steamswtor
    {
        class Program
        {
            static bool IsPreVista()
            {
                //Vista or higher check
                if (System.Environment.OSVersion.Version.Major < 6)
                {
                    MessageBox.Show("Windows Vista or higher is required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return true;
                }
    
                return false;
            }
    
            static void Main(string[] args)
            {
                // If Operating System is before Vista, then exit
                if (IsPreVista())
                    return;
    
                if (args.Length == 0)
                {
                    string pipeName = "swtorsteam";
                                 
                    // run ourself as admin
                    try
                    {
                        Process admin = new Process();
                        admin.StartInfo.FileName = System.Reflection.Assembly.GetEntryAssembly().Location;
                        admin.StartInfo.Arguments = pipeName;
                        admin.StartInfo.Verb = "runas";
                        admin.Start();
                    }
                    catch(Exception e)
                    {
                        string errmsg = e.Message + "\n";
                        errmsg += "Failed to escalate. Program will now exit.";
                        MessageBox.Show(errmsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
    
                    // run the swtor launcher
                    try
                    {
                        Process launcher = new Process();
                        launcher.StartInfo.FileName = Directory.GetCurrentDirectory() + "\\launcher.exe";
                        launcher.Start();
                    }
                    catch(Exception e)
                    {
                        string errmsg = e.Message + "\n";
                        errmsg += "Launcher failed to begin. Is this exe in SWTOR's home directory? Program will now exit.";
                        MessageBox.Show(errmsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
    
                    // loop waiting for our temp file to be filled with swtor's commandline arguments
                    Console.WriteLine("Waiting for our other program to finish...");
    
                    // grab data from the commandline arguments
                    string exe, arguments, workingdirectory;
                    try
                    {
                        NamedPipeServerStream server = new NamedPipeServerStream(pipeName);
                        server.WaitForConnection();
    
                        StreamReader sr = new StreamReader(server);
                        string cmdline = sr.ReadLine();
                        sr.Close();
                        server.Close();
    
                        // grab data from the commandline arguments
                        exe = cmdline.Substring(1, cmdline.IndexOf('"', 1) - 1);
                        arguments = cmdline.Substring(cmdline.IndexOf("\" ") + 2);
                        workingdirectory = cmdline.Substring(1, cmdline.IndexOf("swtor.exe") - 1);
                    }
                    catch(Exception e)
                    {
                        string errmsg = e.Message + "\n";
                        errmsg += "Failed to read command line arguments from other program. Program will now exit.";
                        MessageBox.Show(errmsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
    
                    try
                    {
                        // start swtor's client
                        Process swtor = new Process();
                        swtor.StartInfo.FileName = exe;
                        swtor.StartInfo.Arguments = arguments;
                        swtor.StartInfo.WorkingDirectory = workingdirectory;
                        swtor.Start();
                    }
                    catch(Exception e)
                    {
                        string errmsg = e.Message + "\n";
                        errmsg += "swtor.exe failed to begin. Is this exe in SWTOR's home directory? Program will now exit.";
                        MessageBox.Show(errmsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
    
                    // exit the program
                    return;
                }
                else
                {
                    // Connect to pipe server
                    string pipeName = args[0];
                    NamedPipeClientStream client = new NamedPipeClientStream(pipeName);
                    client.Connect(10000);
                   
                    //Create the query
                    ObjectQuery query = new ObjectQuery("Select * from Win32_Process Where Name =\"swtor.exe\"");
    
                    // check once a second for swtor.exe that the launcher starts when the user hit's play in the launcher
                    Console.WriteLine("Waiting for launcher to start swtor...");
                    while (true)
                    {
                        ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
                        ManagementObjectCollection processList = searcher.Get();
    
                        foreach (ManagementObject obj in processList)
                        {
                            string cmdline = obj.GetPropertyValue("CommandLine").ToString();
    
                            if (cmdline.Contains("username"))
                            {
                                // kill the process
                                obj.InvokeMethod("Terminate", null);
    
                                // write command line to the pipe
                                try
                                {
                                    StreamWriter sw = new StreamWriter(client);
                                    sw.WriteLine(cmdline);
                                    sw.Close();
                                    client.Close();
                                }
                                catch(Exception e)
                                {
                                    string errmsg = e.Message + "\n";
                                    errmsg += "Failed to write commandline arguments to pipe. Program will now exit.";
                                    MessageBox.Show(errmsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                    return;
                                }
    
                                // exit the program
                                return;
                            }
                        }
    
                        Thread.Sleep(1000);
                    }
                }
            }
        }
    }
    Step 2(the hard part):
    - Open a command prompt
    - Start Menu->All Programs->Accessories->Command Prompt
    - change the current directory to where you saved the above 'swtorsteam.txt' file
    - Since I saved mine on the desktop I just had to type "cd Desktop" without the quotes and hit enter
    - Enter the following into the command prompt and hit enter
    - For advanced users: you don't have to use v3.5, I just picked v3.5 because I think almost everyone will have that directory, you can use any that has a csc.exe in it

    Code:
    PATH %windir%\Microsoft.Net\Framework\v3.5
    - Now enter the following into the command prompt and hit enter

    Code:
    csc /platform:x86 swtorsteam.txt
    - csc is the c# compiler if you were wondering
    - There now should be a swtorsteam.exe in the same directory you are currently in
    - If you have done the same as me, that means swtorsteam.exe is on your desktop now
    - You can exit out of the command prompt now

    Step 3(the easy part):
    - Now that you have an exe, move it into your swtor's home directory. The home directory is the one with swtor's launcher.exe in it
    - An example swtor home directory is:

    Code:
    C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars - The Old Republic
    - Go into steam and do the normal 'add non-steam game' and browse to the exe you just placed in swtor's home directory and add it

    Step 4(Optional):
    - Right click on the newly made game in steam's library and go to properties
    - Click Choose Icon and browse to swtor's launcher.exe and select it to get the swtor icon
    - Or you can change swtorsteam.exe's icon image by following a couple steps in a post of mine on the third page of this thread
    - Change the title from 'swtorsteam' to 'Star Wars - The Old Republic'

    You are done!

    If you try it and the steam overlay still doesn't work, then try exiting steam and running steam in admin-mode and try again. This is what my friend had to do.

    Thanks to all that posted on my previous thread. It helped seeing what problems people were having.

    If anyone has any problems, let me know. I will try and fix it.

    Enjoy!
    Source: STAR WARS: The Old Republic - Steam Overlay - Working on vista/win7

  2. #2
    Wasteman Zirkus is on a distinguished road Zirkus's Avatar
    Join Date
    Jan 2011
    Location
    NC
    Posts
    571
    Thanks
    70
    Thanked 33 Times in 18 Posts
    Posting this from Steam browser. Worked like a charm. Hoorah no more alt-tabbing.

  3. #3
    Couch Potato XCman is on a distinguished road
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Worked like a charm. So nice to have Steam working with SWTOR.

    I know this isn't the subject of this particular thread, but any idea how to get SWTOR to appear in steam that you are playing it as a game? So that my steam friends know I am playing SWTOR? Just curious!

    Love the overlay fix, can't say thanks enough!

  4. #4
    Community Manager Makatiel is on a distinguished road Makatiel's Avatar
    Join Date
    Dec 2009
    Posts
    8,799
    Blog Entries
    15
    Thanks
    93
    Thanked 1,173 Times in 520 Posts
    Gamer IDs

    Gamertag: vdasaro
    On your steam window under the "Games" tab you have the option to "Add a Non-Steam game to my library"

    Pick that. Navigate it to "C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars-The Old Republic\launcher.exe"

    This assumes of course Windows 7 and default install location. Your mileage may vary with a non-standard install on another OS but it should be in a similar location.

    Launch TOR from Steam. Viola, you should show as playing SWTOR when you are logged in.

  5. #5
    Pretty Pretty Princess Ducky - AKA - SirDiesAlot is on a distinguished road
    Join Date
    Oct 2010
    Posts
    154
    Thanks
    22
    Thanked 3 Times in 3 Posts
    I don't get it. Why go through all that trouble, when mak's way is much more simple? If I recall correctly, you use mak's method in windows xp.
    I'm not Ducky. I didn't know there was another player called "Ducky" until 16-10-2010. I've had this name since janurary 06, 2010, and according to HLStats, if there is an imposter, it's not me; its Ducky.

  6. #6
    Community Manager Makatiel is on a distinguished road Makatiel's Avatar
    Join Date
    Dec 2009
    Posts
    8,799
    Blog Entries
    15
    Thanks
    93
    Thanked 1,173 Times in 520 Posts
    Gamer IDs

    Gamertag: vdasaro
    My way is the end of the steps. If you don't do the above first you can't use the overlay.

    Now in my sleepiness of midnight I didn't think to specify that it tells you to do what I said above. Yeah, making helpful posts while sleepy isn't always a good idea.

+ Reply to Thread

LinkBacks (?)

  1. 04-24-2012, 04:43 PM
  2. 03-29-2012, 01:56 AM
  3. 03-16-2012, 07:35 AM
  4. 01-30-2012, 02:22 AM

Similar Threads

  1. DarkCraft - Advanced Mob Pathfinding - Minecraft Mod
    By CaptSpiffy in forum Minecraft
    Replies: 3
    Last Post: 09-25-2011, 07:16 PM
  2. Euclideon Advanced Atom Graphics
    By Wicked in forum Gaming Discussion
    Replies: 15
    Last Post: 08-04-2011, 11:47 AM
  3. Free Steam Games for Nvidia and Ati users
    By bloodyred in forum General Discussion
    Replies: 6
    Last Post: 02-22-2010, 02:58 PM
  4. {Tutorial -- Mapping} How to make a TF2 Overlay/Spray
    By Nightshde in forum Guides & Tutorials
    Replies: 0
    Last Post: 12-21-2009, 07:06 PM

Visitors found this page by searching for:

swtor steam overlay

swtor steam

getting steam to work with swtor

swtor in steamsteam overlay swtorhow to add swtor to steamadd swtor to steam how to get swtor to work with steamswtor steam overlay windows 7running swtor through steamrunning swtor thru steamswtor and steamadding swtor to steamhow to run swtor through steamhow to make swtor work with steamswtor on steamhow to play swtor on steamrun swtor through steamgetting SWTOR to work with steamswotr steamsteam swtorRun SWTOR in steamhow to get swtor on steamhow to get swtor to work with steam overlayswtor can you use steam
SEO Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts