Results 1 to 10 of 10

Thread: HOWTO: StarCraft 2 + Bumblebee + Wine 1.5

Threaded View

  1. #1
    Join Date
    Jul 2006
    Beans
    287
    Distro
    Kubuntu

    HOWTO: StarCraft 2 + Bumblebee + Wine 1.5

    Here's how I got StarCraft II running under Kubuntu 12.04 with Wine 1.5 and Bumblebee (for NVIDIA Optimus laptops). Hopefully, someone else will find it useful. I will assume you've already installed Wine 1.5 and Bumblebee. Make sure Bumblebee is working correctly for Linux apps before tackling Wine with it.

    1. First, install Visual C++ runtimes:
      Code:
      winetricks vcrun2005 vcrun2008
    2. Run winecfg. Go to the Libraries tab and add a new override for "msvcp90" (without the quotes). Then edit the override and select Native (Windows). The dialog should now resemble the screenshot below. Click OK to save and exit.
      snapshot2.png
    3. Open a terminal and spawn a bash process under optirun. Then start the StarCraft II downloadable installer under Wine. The executable name might vary.
      Code:
      optirun bash
      wine <path_to_installer>/StarCraft-II-Setup-enUS.exe

    At this point, the game should install and run correctly. Note that you cannot specify the wine command as an argument to optirun because StarCraft II spawns child processes and terminates the parent process. However, it's a pain to spawn a bash process every time we want to run StarCraft, so we'll solve that problem next.

    Launching StarCraft II after installation: You can't use the shortcut that the installer creates to launch StarCraft II because it won't run under Bumblebee that way. Starting it directly under optirun doesn't work either because StarCraft II's launcher spawns several child processes and terminates the launcher process, which terminates optirun, too. Instead, you need to make sure optirun is started and stays running until all the child processes have exited. I've written a little Python script that handles this.

    Code:
    #!/usr/bin/env python
    
    # Run StarCraft II via Optirun. Requires jumping through hoops because
    # the first executable launches a couple of subprocesses so we need to
    # keep Optirun alive for those.
    
    import sys
    import subprocess
    import time
    import os
    
    if 'RUNNING_WITH_OPTIRUN' in sys.argv:
      home_dir = os.environ['HOME']
      subprocess.check_call(['wine', home_dir + '/.wine/drive_c/Program Files (x86)/StarCraft II/StarCraft II.exe'])
      # Wait for initial launcher subprocess to be called. It handles patch updates and such.
      time.sleep(10)
      # Keep alive until the launcher terminates.
      while subprocess.Popen(['pidof', 'Blizzard Launcher.exe'], stdout=subprocess.PIPE).communicate()[0]:
        time.sleep(5)
      # Wait for game executable to be called.
      time.sleep(5)
      # Keep alive until the game executable terminates.
      while subprocess.Popen(['pidof', 'SC2.exe', 'Agent.exe'], stdout=subprocess.PIPE).communicate()[0]:
        time.sleep(5)
    else:
      # Call myself with optirun.
      subprocess.check_call(['optirun', sys.argv[0], 'RUNNING_WITH_OPTIRUN'])
    Save the above script as /usr/local/bin/starcraft2 (or whatever you prefer) and make it executable by running:
    Code:
    sudo chmod +x /usr/local/bin/starcraft2
    Now you can launch StarCraft II by running:
    Code:
    starcraft2
    Create a menu item for the script if you like. Enjoy!
    Last edited by Rob_H; March 3rd, 2013 at 06:45 PM.

Bookmarks

Posting Permissions

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