Forum

[Script] StarCraft II : Heart of the Swarm

Script to install popular RTS Game: Starcraft 2, the 2nd expansion

Författare Svar
Jump to the page: 1 - 2
shark711 Tuesday 28 May 2013 at 0:24
shark711Anonymous

This worked for me, hope it works for the next person too
Save the following in a file (sc2.pol) and then open PlayOnLinux
Then select Tools > Run a local script
Next > Browse (select the sc2.pol file) > Next > I Agree > Next > Next

Hopefully everything works well

Post implimentation tasks:
If Agent.exe fails during the install, the installer will still continue and complete, but once it has completed, PlayOnLinux will still wait for it to finnish (i.e. not crreate the Icon), this is because the agent.exe process has gone into limbo. Just kill this process for POL to register all processes has ended. You can use the following command that should work on all distros (it kills everything that matches "agent.exe"):

ps -ef | grep -v grep | grep -i Agent.exe | awk '{print $2}' | xargs kill -9


[code language=playonlinux]#!/bin/bash
[ "$PLAYONLINUX" == "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="StarCraft II : Heart of the Swarm"
DEVELOPER="Activision / Blizzard Entertainment"
PREFIX="StarcraftII"
WINEVERSION="1.5.26"
WINEARCH="x86"
WINEOS="winxp"
GAME_VMS="1024"
DLURLBASE="http://dist.blizzard.com/downloads/sc2-installers/full/"
 
cfg_check
POL_SetupWindow_Init
POL_SetupWindow_presentation "$TITLE" "$DEVELOPER" "http://www.starcraft2.com" "Shark 7-11" "$PREFIX"
 
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WINEVERSION"
POL_System_SetArch "$WINEARCH"
Set_OS "$WINEOS"
POL_Wine_OverrideDLL "builtin" "dnsapi"
POL_Wine_OverrideDLL "native,builtin" "mshtml"
POL_Wine_OverrideDLL "native,builtin" "msvcr80"
POL_System_TmpCreate "$PREFIX"
POL_Call POL_Install_vcrun2010
 
POL_SetupWindow_menu "Please Select your language/region" "$TITLE" "English (US)~Español (AL)~Português (BR)~English (EU)~English (SG)~Español (EU)~Deutsch~Français~Italiano~Polski~Русский~한국어~繁體中文~简体中文" "~"
    if [ "$APP_ANSWER" == "English (US)" ]
      then INSTNAME="StarCraft-II-Setup-enUS.exe"
    elif [ "$APP_ANSWER" == "Español (AL)" ]
      then INSTNAME="StarCraft-II-Setup-esMX.exe"
    elif [ "$APP_ANSWER" == "Português (BR)" ]
      then INSTNAME="StarCaft-II-Setup-ptBR.exe"
    elif [ "$APP_ANSWER" == "English (EU)" ]
      then INSTNAME="StarCraft-II-Setup-enGB.exe"
    elif [ "$APP_ANSWER" == "English (SG)" ]
      then INSTNAME="StarCraft-II-Setup-enSG.exe"
    elif [ "$APP_ANSWER" == "Español (EU)" ]
      then INSTNAME="StarCraft-II-Setup-esES.exe"
    elif [ "$APP_ANSWER" == "Deutsch" ]
      then INSTNAME="StarCraft-II-Setup-deDE.exe"
    elif [ "$APP_ANSWER" == "Français" ]
      then INSTNAME="StarCraft-II-Setup-frFR.exe"
    elif [ "$APP_ANSWER" == "Italiano" ]
      then INSTNAME="StarCraft-II-Setup-itIT.exe"
    elif [ "$APP_ANSWER" == "Polski" ]
      then INSTNAME="StarCraft-II-Setup-plPL.exe"
    elif [ "$APP_ANSWER" == "Русский" ]
      then INSTNAME="StarCraft-II-Setup-ruRU.exe"
    elif [ "$APP_ANSWER" == "한국어" ]
      then INSTNAME="StarCraft-II-Setup-koKR.exe"
    elif [ "$APP_ANSWER" == "繁體中文" ]
      then INSTNAME="StarCraft-II-Setup-zhTW.exe"
    elif [ "$APP_ANSWER" == "简体中文" ]
      then INSTNAME="StarCraft-II-Setup-zhCN.exe"
    fi
DLURL="$DLURLBASE""$INSTNAME"

POL_SetupWindow_InstallMethod "DVD,LOCAL,DOWNLOAD"
if [ "$INSTALL_METHOD" == "LOCAL" ]
then
    cd "$HOME"
    POL_SetupWindow_browse "Please select the installation file to run." "$INSTNAME"
    POL_SetupWindow_wait "Installing $TITLE." "$TITLE"
    POL_Wine start /unix "$APP_ANSWER"
elif [ "$INSTALL_METHOD" == "DOWNLOAD" ]
then
    cd "$POL_System_TmpDir"
    POL_Download "$DLURL"
    POL_SetupWindow_wait "Installing $TITLE." "$TITLE"
    POL_Wine start /unix "$POL_System_TmpDir/$INSTNAME"
elif [ "$INSTALL_METHOD" == "DVD" ]
then
    INSTNAME="StarCraft II Setup.exe"
    POL_SetupWindow_message "$(eval_gettext 'Please insert game media into your disk drive\\nif not already done.')" "$TITLE"
    POL_SetupWindow_cdrom
    POL_SetupWindow_check_cdrom "$INSTNAME"
    POL_Wine start /unix "$CDROM/$INSTNAME"
fi
 
POL_Wine_WaitExit "$TITLE"
 
POL_System_TmpDelete
POL_SetupWindow_VMS $GAME_VMS
POL_Wine_SetVideoDriver
 
POL_Shortcut "StarCraft II.exe" "$TITLE"
POL_Shortcut "StarCraft II Editor.exe" "$TITLE Editor"

POL_SetupWindow_Close
exit
[/code]

NOTE: None of these images are my own creations and are all under copyright by Blizzard Entertainment and associated companies. I claim none of these as my own
sidetopicon-48icon-22

Ändrat av shark711

Ronin DUSETTE Tuesday 28 May 2013 at 6:26
Ronin DUSETTE

Sorry. The formatting got messed up (for some reason BBcode tags do not work on our site with Google Chrome). I added the code brackets for it so that it would be more legible.

Feel free to re-edit your post if its not formatted correctly.

You will see some brackets with "code language=playonlinux" and "/code" at the beginning and end, respectively. Place your script in between those 2 lines of code. Then it will number everything.

Also, check the folowing link. It will tell you how to add screenshots, icons, etc..

http://www.playonlinux.com/en/topic-10187-Standards_for_script_publishing.html

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
shark711 Tuesday 28 May 2013 at 18:15
shark711Anonymous

Disclaimer: Obviously all this content is from the game itself and therefore part of their trademarks, copyrights etc etc. I claim none of this content as my own, except the POL script offcourse.

Running an MSI GT780DX Laptop
Ubuntu 12.04.2 (LTS)

Images:

-The icon that will be used for the installed program:
File Type: PNG
Size: 48x48

-The icon that will be used in the PlayOnLinux script list and the site
File Type: PNG
Size: 22x22

-Top corner Icon for install script
File Type: PNG
Size: 64x64

-Sideways banner
URL: http://farm8.staticflickr.com/7359/8868830945_7c45c7c140_o.png
FIle Type: PNG
Size: 150x356

running shots:
http://farm3.staticflickr.com/2828/8868832505_d6cbd68aae_o.png (dont use this, this is only to show that this was actually form linux and not via Windows)
http://farm4.staticflickr.com/3821/8868834541_1300d68d2d_o.png
http://farm9.staticflickr.com/8533/8869451442_a3fcd5d82d_o.png

Ändrat av shark711

Ronin DUSETTE Tuesday 28 May 2013 at 18:33
Ronin DUSETTE

No problem. Thanks for your contribution.

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
shark711 Tuesday 28 May 2013 at 19:03
shark711Anonymous




Ändrat av shark711

GNU_Raziel Tuesday 28 May 2013 at 20:02
GNU_Raziel

Your script actually install ONLY enGB version of the game...PoL is a multilanguage software, think about other countries, this game exist in several languages...
shark711 Tuesday 28 May 2013 at 21:35
shark711Anonymous

Done

Ändrat av shark711

Deleted Accidental post
Ronin DUSETTE Tuesday 28 May 2013 at 22:10
Ronin DUSETTE

You will have to modify the if/fi/then statements to check for which one it is.

You can have POL ask which language to install (or maybe even grep it from the system?), and save to a variable, and give it something like:



if $LANGUAGE = English
then
cd "$POL_System_TmpDir"
POL_Download "http://dist.blizzard.com/downloads/sc2-installers/full/StarCraft-II-Setup-enGB.exe"
POL_SetupWindow_wait "Installing $TITLE." "$TITLE"
POL_Wine start /unix "$POL_System_TmpDir/StarCraft-II-Setup-enGB.exe"
fi $LANGUAGE = Spanish
then
cd "$POL_System_TmpDir"
POL_Download "http://dist.blizzard.com/downloads/sc2-installers/full/StarCraft-II-Setup-Span.exe"
POL_SetupWindow_wait "Installing $TITLE." "$TITLE"
POL_Wine start /unix "$POL_System_TmpDir/StarCraft-II-Setup-enGB.exe"
fi


Im just paraphrasing, of course. The real code will be much better than mine. But as you can see, you are able to ask a question earlier in the install script, save it to $LANGUAGE or $GAMELANGUAGE, and tell the script to download the appropriate file.

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
shark711 Wednesday 29 May 2013 at 0:13
shark711Anonymous

@DJYoshaBYD, seen you message to late, I've updated the script and tested it, for some reason I got a few errors with the installer itself (which i didnt get previously). It is now compatible with all the available regions available for SC2, it also sets a few api's (to resolve some issues). And also has a message box at the end, incase you get an issue which is random (1 out of 30 times or so).
Ronin DUSETTE Wednesday 29 May 2013 at 0:18
Ronin DUSETTE

Good work. Gotta if, fi, then statements. :)

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Ronin DUSETTE Wednesday 29 May 2013 at 0:20
Ronin DUSETTE

Submit your script here:

http://www.playonlinux.com/en/new_app.html

Fill out as much as possible, and submit it for signing.

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
shark711 Wednesday 29 May 2013 at 0:29
shark711Anonymous

http://www.playonlinux.com/en/app-1722.html

Shouldn't some folks test it out first though?

Thanks for the help much appreciated

Ändrat av shark711

Ronin DUSETTE Wednesday 29 May 2013 at 0:42
Ronin DUSETTE

I dont have the game. If you are saying it tests well, and the script looks good, clean, and portable, then I dont see a problem. If there are issues after, we can always change them. That happens all of the time anyway. no script is perfect. :)

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
shark711 Wednesday 29 May 2013 at 10:28
shark711Anonymous

The installer will download it for you, and as far as I know you can play a subset of the maps for free (as part of their way of getting you to buy it). Let me test it a few times and then i will upload it
achelis Sunday 14 July 2013 at 15:06
achelisAnonymous

I'm currently testing it. Only issue I've had so far is with the Blizzard Installer - If you get the error "Failed to retrieve Blizzard updater properties" you may have to change your DNS. That worked for me at least - I'm using Googles DNS server now, but I imagine OpenDNS could work equally well.
Now it's downloading.. I'll let you know how I fare..
And Thank a bunch for the script!
achelis Sunday 14 July 2013 at 17:10
achelisAnonymous

Script and game works fine for me - only issue was the Agent.exe not exiting as you described. Killed it and everything finished as it should.
Volatile Friday 27 September 2013 at 10:15
VolatileAnonymous

Game appears to be performing well. Thanks a lot!
ThomasCFR Saturday 28 December 2013 at 16:28
ThomasCFRAnonymous

For what it is worth:
- script worked like a charm. Installation was easy and everything went well.
- I had to manually kill Agent.exe as suspected by Shark711

I have little issues with controls during the game... need to hit a key several times before the command is understood (really annoying during panic modes! :p ) and the screen is sliding to other positions of the map as if I was moving my mouse to the edge of the maps, from times to times without any explanation. But that's 100% out of the excellent POL script shark711 provided!

Thanks a lot, Shark!
Keep going, PlayOnLinux Team! :-)

Ändrat av ThomasCFR

Kenairod Friday 14 March 2014 at 3:30
KenairodAnonymous

I've downloaded the installer (from the script) which has downloaded the game, then I've clicked on "Launch the game" and after having logged in, I've closed the game, but now it's blocked on the PoL window showing "Thanks for waiting while Starcraft 2 : Heart of the Swarm is installing..."
Is it normal ?

EDIT : Play on linux finally encountered an error :
Error in POL_Shortcut
Binary not found: StarCraft II.exe
Have you installed the program to the default location?


Now there are folders named Starcraft 2 on my desktop and in my /home, but nothing apear in PoL (it's actually the same as when I tried to install it with the official script of Wings of Liberty, with the downloaded client).

EDIT 2 : I'm retrying, from the executable I've download on the official website, now, I'll try not to launch the game at the end of the downloading of the game, but I fear it's going to give me an error even if I quit the download manager... Could you tell me the way you install it from the downloader ?

EDIT 3 : Actually, it appears the download manager directly downloads the game files into /home/<user>/Desktop/StarCraft II

Ändrat av Kenairod


Free the world, take Linux.