El Foro

[Script] SimCity 2013

Autor Respuestas
Jump to the page: 1 - 2 - 3
steve723 Monday 29 July 2013 at 19:04
steve723Anonymous

While trying another update to the script I am currently at the game sever select screen. I am getting a large update. While wating I found this on EA's new HQ page for this game:

14. How to Run on Linux: Thanks davidlukasm!!

1. Download: You have to download SimCity 2013 via Origin. Since there is a bug in wine which makes Origin unusable (it never gets the file downloaded), a workaround has been proposed: http://bugs.winehq.org/attachment.cgi?id=43385
This will probably never be included in any official wine release, so you will have to build your own wine. On 64 bit linux you can follow these instructions: http://wiki.winehq.org/WineOn64bit -- but before executing "make", you have to apply the aforementioned patch (in file dlls/ws2_32/socket.c) - you only need this patch in order to *download* SimCity 5. Playing it won't require any special wine version (wine 1.5.25)
also, use winetricks vcrun2005 vcrun2008 vcrun2010 and probably directx9, too. Since I didn't try this out without these winetricks, I can't tell wether they are required. (someone said vcrun2003 was, but in fact it's not)

2. When Origin will have downloaded the file, it will say something like "installing" and will hang at 100%. Open a terminal and killall -9 EAProxyInstaller.exe (but make sure you give it enough time to complete whatever it's doing before you kill it, i.e. *don't* kill it as soon as it reaches 100%, but rather wait a few seconds). You probably even won't have to restart Origin after killing the ProxyInstaller. Then, start the game and it will download it's main (3GB) files. You can then play the game or switch back to whatever version of wine you use regularly (only tested with 1.5.25)

3. Remember not to start SimCity via SimCity.exe - always use Origin, or you will get an error about "Activation.dll", which could not be loaded.

I will try some these other vcruns next time I test. The oringin download part is improved but you still have to manully click on the game in my games tab and select download. The script will work after that.

#!/bin/bash
# Date : (2013-07-19)
# Last revision : (2013-07-29)
# Wine version used : 1.6-rc2
# Distribution used to test : xUbuntu 13.10
# Author : Jimmy Ramsmark
# Licence : GPLv3
 
# This script was tested using the DVD version of `SimCity 2013'
# Bought in Sweden 2013
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="SimCity 2013"
AUTHOR="Jimmy Ramsmark"
PREFIX="SimCity"
WORKINGWINEVERSION="1.5.28-Origin"
 
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "Maxis" "http://www.simcity.com/" "$AUTHOR" "$PREFIX"
POL_Wine_SelectPrefix "$PREFIX"

# Modified to add Origin download support by Steven Wilson useing Origin script by GNU_Raziel
POL_SetupWindow_InstallMethod "DVD,ORIGIN"

if [ "$INSTALL_METHOD" = "DVD" ]; then

# Let the user select a DVD
POL_SetupWindow_cdrom
 
# Check if this DVD is the SimCity 2013 DVD
POL_SetupWindow_check_cdrom "SimCity.zip"

# Set and install the correct Wine version
POL_Wine_PrefixCreate "$WORKINGWINEVERSION"
 
# Run installer
taskset -c 0 wine start /unix "$CDROM/Setup.exe"

#Origin method
elif [ "$INSTALL_METHOD" = "ORIGIN" ]; then

# Set and install the correct Wine version
POL_Wine_PrefixCreate "$WORKINGWINEVERSION"

# Installing mandatory dependencies
POL_Wine_InstallFonts
POL_Function_FontsSmoothRGB
POL_Call POL_Install_wininet # Fix EA Connexion's issue 1
POL_Call POL_Install_vcrun2010

# Installing Origin
# Downloading latest Origin
cd "$POL_USER_ROOT/tmp/"
POL_Download "https://download.dm.origin.com/origin/live/OriginSetup.exe" ""
 
cd "$POL_USER_ROOT/tmp/"
POL_Wine start /unix "OriginSetup.exe"

fi

POL_SetupWindow_message "$(eval_gettext 'When Origin starts, login so that the installation of SimCity can start.\\nWhen the installation is finished, press next.\\n\\n!IMPORTANT! If the installer gets stuck on installing for a very long time without anything happening, then set a timer for 5 minutes and then press next when the timer reaches 0, the script will then try to fix it for you\\n')" "$TITLE"
 
#We need to make sure that this bastard gets killed
COUNT_PROXY=$(ps aux | grep -c EAProxyInstaller.exe)
 
if [ "$COUNT_PROXY" -gt 1 ]; then
    killall EAProxyInstaller.exe
fi
 
POL_SetupWindow_message "$(eval_gettext 'Please close Origin now (If the game is uppdating successfully then let it finish, but if it it hangs then continue), and then press next (If you can not close it, just press next and the script will attempt to close it for you)\\n')" "$TITLE"
 
#Kill Origin so that the script can continue
killall Origin.exe
 
# Need to block Origin from using this file, since it breaks the game.
# And if we just remove it, Origin will just replace it with a new one.
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Origin"
rm IGO32.dll
touch IGO32.dll
chmod 000 IGO32.dll
 
# Create shortcuts
POL_Shortcut "SimCity.exe" "$TITLE" "" "" "Game;"
POL_Shortcut "Origin.exe" "Origin - $TITLE" "" "" "Game;"
 
POL_SetupWindow_message "$(eval_gettext 'Installation finished!\\n\\n When you start the game, Origin might act a bit funky at times, but just continue like you didnt see it')" "$TITLECOMPLETE"

POL_SetupWindow_Close
exit 0

Editado por: steve723

steve723 Monday 29 July 2013 at 19:09
steve723Anonymous

I forgot to add that I tested with wine 1.6 and the script broke, Oringin dosn't download with anything under wine 1.6. The only wine that seems to enable Origin to download is wine 1.5.28-Origin, which is a modified version of wine 1.5.28 and therfore no good saying anything on winehq.com as they don't support modified wine versions.
Deleted empty
Deleted empty
steve723 Tuesday 30 July 2013 at 8:11
steve723Anonymous

Is something wrong with this forum? I just posted and the post is not here even though it sayed it posted.
Deleted not needed
alcorsepol Tuesday 30 July 2013 at 8:36
alcorsepolAnonymous

I went back to work yesterday, so haven't had much time to read the forum :)

I will write a complete version of the script in the days that follow.
steve723 Tuesday 30 July 2013 at 10:51
steve723Anonymous

I went back to work yesterday, so haven't had much time to read the forum :)

I will write a complete version of the script in the days that follow.

Quote from alcorsepol


Try this

#!/bin/bash
# Date : (2013-07-19)
# Last revision : (2013-07-29)
# Wine version used : 1.5.28-Origin
# Distribution used to test : xUbuntu 13.10 and Kubuntu 13-10
# Author : Jimmy Ramsmark
# Licence : GPLv3
 
# This script was tested using the DVD version of `SimCity 2013'
# Bought in Sweden 2013
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="SimCity 2013"
AUTHOR="Jimmy Ramsmark"
PREFIX="SimCity"
WORKINGWINEVERSION="1.5.28-Origin"
 
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "Maxis" "http://www.simcity.com/" "$AUTHOR" "$PREFIX"
POL_Wine_SelectPrefix "$PREFIX"

# Modified to add Origin download support by Steven Wilson useing Origin script by GNU_Raziel
POL_SetupWindow_InstallMethod "DVD,ORIGIN"

if [ "$INSTALL_METHOD" = "DVD" ]; then

# Let the user select a DVD
POL_SetupWindow_cdrom
 
# Check if this DVD is the SimCity 2013 DVD
POL_SetupWindow_check_cdrom "SimCity.zip"

# Set and install the correct Wine version
POL_Wine_PrefixCreate "$WORKINGWINEVERSION"
 
# Run installer
taskset -c 0 wine start /unix "$CDROM/Setup.exe"

#Origin method
elif [ "$INSTALL_METHOD" = "ORIGIN" ]; then

# Set and install the correct Wine version
POL_Wine_PrefixCreate "$WORKINGWINEVERSION"

# Installing mandatory dependencies
POL_Wine_InstallFonts
POL_Function_FontsSmoothRGB
POL_Call POL_Install_wininet # Fix EA Connexion's issue 1
POL_Call POL_Install_vcrun2010
POL_Call POL_Install_vcrun2008
POL_Call POL_Install_vcrun2005
# This seems to cause Origin to fail its initializing so I am commenting it out for now. POL_Call POL_Install_directx9

# Installing Origin
# Downloading latest Origin
cd "$POL_USER_ROOT/tmp/"
POL_Download "https://download.dm.origin.com/origin/live/OriginSetup.exe" ""
 
cd "$POL_USER_ROOT/tmp/"
POL_Wine start /unix "OriginSetup.exe"

fi

POL_SetupWindow_message "$(eval_gettext 'When Origin starts, login so that the installation of SimCity can start.\\nWhen the installation is finished, press next.\\n\\n!IMPORTANT! If the installer gets stuck on installing for a very long time without anything happening, then set a timer for 5 minutes and then press next when the timer reaches 0, the script will then try to fix it for you\\n')" "$TITLE"

#We need to make sure that this gets killed
COUNT_PROXY=$(ps aux | grep -c EAProxyInstaller.exe)
 
if [ "$COUNT_PROXY" -gt 1 ]; then
killall EAProxyInstaller.exe
fi
 
POL_SetupWindow_message "$(eval_gettext 'Please close Origin now (If the game is uppdating successfully then let it finish, but if it it hangs then continue), and then press next (If you can not close it, just press next and the script will attempt to close it for you)\\n')" "$TITLE"
 
#Kill Origin so that the script can continue
killall Origin.exe
 
# Need to block Origin from using this file, since it breaks the game.
# And if we just remove it, Origin will just replace it with a new one.
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Origin"
rm IGO32.dll
touch IGO32.dll
chmod 000 IGO32.dll
 
# Create shortcuts
POL_Shortcut "SimCity.exe" "$TITLE" "" "" "Game;"
POL_Shortcut "Origin.exe" "Origin - $TITLE" "" "" "Game;"
 
POL_SetupWindow_message "$(eval_gettext 'Installation finished!\\n\\n When you start the game, Origin might act a bit funky at times, but just continue like you didnt see it')" "$TITLECOMPLETE"

POL_SetupWindow_Close
exit 0

Editado por: steve723

steve723 Tuesday 30 July 2013 at 13:05
steve723Anonymous

Looks like we never will be able to totally atomate Simcity 2013 Origin install. We can automat the Origin client install then the user logs in, clicks on my games tab then hovers over simcity 2013 and selects install. After installing manually just continue the script. It works as I have done it. You have to wait a long time for the game to start.

GNU_Raziel      Saturday 12 May 2012 at 2:46 - [quote]
Rank: Admin

Admin
     
Hi,

yes you can, we added EA's Origin support but, so far, only Mass Effect 3 is available in origin version because it's the only game we had the occasion to test on it.

And since Origin do nt provide any command-line options to install games (like steam and desura do) it's impossible to make simple support sor it, user MUST add targeted game to it's origin library.

EA's Origin installer in in the Testing Section if you want to try it, but remember, with wine, nearly each game need specific tweak/options/third party softwares so don't expect playing all origin games magically under linux. Like we do with steam/desura, a specific installer need to be done for each game.

Regards,

GNU_Raziel
steve723 Tuesday 30 July 2013 at 18:28
steve723Anonymous

Great I wait over 1 hour and a half -that's how long it takes to load- to test this some more only to discover that the servers are down for maintaince. Rotten luck I guess. You'd think they would at least give an estimate of when they'd be back up.
steve723 Tuesday 30 July 2013 at 20:09
steve723Anonymous

It seems to launch much faster after todays update.
Ronin DUSETTE Tuesday 30 July 2013 at 20:39
Ronin DUSETTE
Admin

Do you think adjusting the Display tab setings in config would help? Maybe Direct Draw Renderer to opengl?

Citar


It defaults to that, so no.

I tried wine 1.6 and it runs much better.

Citar


Yeah. Its a great milestone.

With that, I have no clue why it would have stopped.

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
steve723 Wednesday 31 July 2013 at 3:25
steve723Anonymous

Simcity 2013 loads to the city levle much faster now that EA/Maixs added update number 6 today. Looks like my Orgin script modifications to this install script are work well now.
steve723 Wednesday 31 July 2013 at 3:29
steve723Anonymous

Wierd how it breaks Origin on the install via wine 1.6 but after you install using wine 1.5.28-Origin, you can switch the VD to wine 1.6.
steve723 Wednesday 31 July 2013 at 19:37
steve723Anonymous

When you goto your city and get the black box just click in the black box and it will contine loading.
ebeyer Monday 9 September 2013 at 16:00
ebeyerAnonymous

My heartfelt thanks to the OP and his colleagues who worked so hard on this script.  I was able to install and run the game on my System76 Bonobo running Manjaro linux with no issues. This game was (so far) the last reason I had to try to install windows on the laptop.
EB
jre Thursday 24 July 2014 at 3:01
jreAnonymous

Sorry for bumping this thread. I used this script (steve723's version) a year ago to install the Origin shop version. But recently I had several problems with installing and playing.

So now here is a new version of the script which fixes (or tells the user how to fix) them. With this version of the script SimCity finally installs with several MB/sec and doesn't hang upon downloading (that should be due to patching Qt5Network.dll). But it also starts anytime I try it (in the past I needed frequent tries). I also have a feeling the game itself runs better now. I don't know if the latter two are due to wine 1.7.22 or to changes in SimCity itself.

I hope not to have broken the DVD section. This is the first time I worked with PlayOnLinux. Thanks to all previous authors! btw, I don't claim any copyright or whatever for this script. It would be great to see this in the official repos once.

Have fun

jre


Changelog:

  • Patch Qt5Network.dll
        see http://bugs.winehq.org/show_bug.cgi?id=31438#c128
        # [EA Origin]Unable to download game since the new version
        
        For this to work Origin must not be started directly after installation.
        So massively spam the user with warnings not to log in immediately after
        installation, which would cause Origin to be started before patching it.
        Instead patch Origin after installation and just then start it.
        
        I tried to make this bulk of messages easy to understand, improvements
        welcome!
  • Don't remove the IGO32.dll file anymore.
        This now causes Origin to fail to start.
        Instead hint how to disable Origin In Game.
  • Hint to GTE CyberTrust Global Root certificate problems
  • Hint to use patched wine
        Bug #33723/29876
        Origin needs job objects, causes e.g. the EAProxyInstaller problems
  • Use wine 1.7.22

#!/bin/bash
# Date : (2013-07-19)
# Last revision : (2014-07-23)
# Wine version used : 1.7.22
# Distribution used to test : Debian Jessie (testing), earlier xUbuntu 13.10 and Kubuntu 13.10,
# Author : Jimmy Ramsmark and others
# Modified to add Origin download support by Steven Wilson using Origin script by GNU_Raziel
# Licence : GPLv3

# This script was tested with the Origin Store version (9.4.11.2806)
# An earlier version of this script was tested using the DVD version
# of `SimCity 2013' bought in Sweden 2013.

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="SimCity 2013"
AUTHOR="Jimmy Ramsmark and others"
PREFIX="SimCity"
WORKINGWINEVERSION="1.7.22"

POL_SetupWindow_Init
POL_Debug_Init

POL_SetupWindow_presentation "$TITLE" "Maxis" "http://www.simcity.com/" "$AUTHOR" "$PREFIX"
POL_Wine_SelectPrefix "$PREFIX"

POL_SetupWindow_message "$(eval_gettext 'Origin needs job objects and completion ports to determine if a game is running or has exited. To fix this you should use a patched wine version, see http://bugs.winehq.org/show_bug.cgi?id=33723 and http://bugs.winehq.org/show_bug.cgi?id=29876. It would be nice if someone could provide this, so that this script could use a patched wine.\n\nBut you still can run Origin and SimCity with an unpatched wine. This script workarounds the resulting problems during installation (kill EAProxyInstaller.exe). So you can play Simcity, Origin will just not be notified when you quit it.')" "$TITLE"

POL_SetupWindow_message "$(eval_gettext 'Origin requires the GTE CyberTrust Global Root certificate to go online. Since this certificate is not secure it has been disabled by some Linux distributions recently. If you experience problems with Origin refusing to connect, then check out your distribution´s help system to learn how to reenable it.\n')" "$TITLE"

POL_SetupWindow_InstallMethod "DVD,ORIGIN"

if [ "$INSTALL_METHOD" = "DVD" ]; then

# Let the user select a DVD
POL_SetupWindow_cdrom

# Check if this DVD is the SimCity 2013 DVD
POL_SetupWindow_check_cdrom "SimCity.zip"

# Set and install the correct Wine version
POL_Wine_PrefixCreate "$WORKINGWINEVERSION"

# Run installer
taskset -c 0 wine start /unix "$CDROM/Setup.exe"

#Origin method
elif [ "$INSTALL_METHOD" = "ORIGIN" ]; then

# Set and install the correct Wine version
POL_Wine_PrefixCreate "$WORKINGWINEVERSION"

# Installing mandatory dependencies
POL_Wine_InstallFonts
POL_Function_FontsSmoothRGB
POL_Call POL_Install_wininet # Fix EA Connexion's issue 1
POL_Call POL_Install_vcrun2010
POL_Call POL_Install_vcrun2008
POL_Call POL_Install_vcrun2005

# Installing Origin
# Downloading latest Origin
cd "$POL_USER_ROOT/tmp/"
POL_Download "https://download.dm.origin.com/origin/live/OriginSetup.exe" ""
# Download "Qt5Network.bin.patch", see http://bugs.winehq.org/show_bug.cgi?id=31438#c128
# [EA Origin]Unable to download game since the new version
POL_Download "http://bugs.winehq.org/attachment.cgi?id=47911" ""

POL_SetupWindow_message "$(eval_gettext 'You are close to installing Origin.\n\nPress NEXT now to start the installation of Origin.\n\nComplete it, but don´t log in at the end of the installation process or Origin will be started too early. (If you log in anyway, just exit Origin. DO NOT TRY TO INSTALL SIMCITY IN ORIGIN NOW!)\n')" "$TITLE"

POL_Wine start /unix "OriginSetup.exe"

POL_SetupWindow_message "$(eval_gettext 'Please wait for the installation of Origin to complete. Don´t log in at the end of the installation process or Origin will be started too early. (If you logged in anyway, just exit Origin. DO NOT TRY TO INSTALL SIMCITY IN THIS STEP!)\n\nClick away the Origin login dialog and then press NEXT.\n\nOrigin will then be patched and started afterwards. So AFTER clicking NEXT now, login in the Origin dialog, then go to the ´My Games´ tab and start the download and installation of SimCity.\n')" "$TITLE"

#We need to make sure that this gets killed
COUNT_PROXY=$(ps aux | grep -c Origin.exe)

if [ "$COUNT_PROXY" -gt 1 ]; then
killall Origin.exe
fi

# Patch Qt5Network.dll
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Origin"
patch -p0 < "$POL_USER_ROOT/tmp/attachment.cgi?id=47911"

# Start Origin with patched Qt5Network.dll
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Origin"
POL_Wine start /unix "Origin.exe"

fi

POL_SetupWindow_message "$(eval_gettext 'Please wait for the installation of SimCity to finish.\n\nThen press NEXT.\n\nIf the SimCity installer gets stuck after downloading on `Installing...` for more then 5 minutes press NEXT, the script will then try to fix it for you.\n')" "$TITLE"

#We need to make sure that this gets killed
COUNT_PROXY=$(ps aux | grep -c EAProxyInstaller.exe)

if [ "$COUNT_PROXY" -gt 1 ]; then
killall EAProxyInstaller.exe
fi

POL_SetupWindow_message "$(eval_gettext 'The installation of SimCity should now be complete. Please close Origin now (If the game is still updating then let it finish, but if it it hangs for a long time then continue.), and then press NEXT (If you can not close it, just press NEXT and the script will attempt to close it for you).\n')" "$TITLE"

#We need to make sure that this gets killed
COUNT_PROXY=$(ps aux | grep -c Origin.exe)

if [ "$COUNT_PROXY" -gt 1 ]; then
killall Origin.exe
fi

# Create shortcuts

POL_Shortcut "SimCity.exe" "$TITLE" "" "" "Game;"
POL_Shortcut "Origin.exe" "Origin - $TITLE" "" "" "Game;"

POL_SetupWindow_message "$(eval_gettext 'Installation finished!\n\n Now start Origin and go to ´Origin - Application Settings - Origin In Game´ and UNTICK ´Enable Origin In Game´. The first time you run SimCity you might have to watch the full intro, but from then on you can normally start SimCity. Have Fun!')" "$TITLECOMPLETE"

POL_SetupWindow_Close
exit 0

SimCity 2013 winehq AppDB maintainer
https://appdb.winehq.org/objectManager.php?sClass=version&iId=27821
TortueGaming Friday 25 July 2014 at 21:58
TortueGamingAnonymous

Thanks, it's nice to see this script fixed.

jre Saturday 26 July 2014 at 16:44
jreAnonymous

Thanks.

Unfortunately SimCity broke again here: I could click the green start triangle in the SimCity start dialog, but although SimCity was started and I heard the sound I couldn't see it. Cycling through open windows (Alt + TAB) showed the SimCity window (with messed up content as usual) but I couldn't bring it to the foreground.

Then I moved to the new wine 1.7.23 in PlayOnLinux and everything worked again. Let's see if this is still the case tomorrow.

I'd be happy to get more reports, especially after trying the game for a few days.


SimCity 2013 winehq AppDB maintainer
https://appdb.winehq.org/objectManager.php?sClass=version&iId=27821
jre Monday 28 July 2014 at 16:12
jreAnonymous

Currently I experience the Simcity-not-visible-problem even on fresh installs (wine 1.7.23). The only solution I found currently is to configure wine to emulate a virtual desktop. Then everything works.

 

Here comes a new version of the script, except that I updated it to use wine 1.7.23 there shouldn't be any changes that affect the way it works.

Changelog:

  • updated to wine 1.7.23
  • reworked many message dialogs
  • moved COUNT_PROXY code directly in tests

 

#!/bin/bash
# Date : (2013-07-19)
# Last revision : (2014-07-28)
# Wine version used : 1.7.23
# Distribution used to test : Debian Jessie (testing),
#     earlier versions with xUbuntu 13.10 and Kubuntu 13.10
# Author : Jimmy Ramsmark and others
# Modified to add Origin download support by Steven Wilson,
#     using Origin script by GNU_Raziel
# Licence : GPLv3

# This script was tested with the Origin Store version (Origin 9.4.12.2807)
# An earlier version of this script was tested using the DVD version
# of `SimCity 2013' bought in Sweden 2013.

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="SimCity 2013"
AUTHOR="Jimmy Ramsmark and others"
PREFIX="SimCity"
WORKINGWINEVERSION="1.7.23"

POL_SetupWindow_Init
POL_Debug_Init

POL_SetupWindow_presentation "$TITLE" "Maxis" "http://www.simcity.com/" "$AUTHOR" "$PREFIX"
POL_Wine_SelectPrefix "$PREFIX"

POL_SetupWindow_message "$(eval_gettext 'Origin needs job objects and completion ports to determine if a game is running or has exited. To fix this you should use a patched wine version, see http://bugs.winehq.org/show_bug.cgi?id=33723 and http://bugs.winehq.org/show_bug.cgi?id=29876.\n\nUnfortunately such a patched wine is not available for download yet, so this script uses an unpatched wine.\n\nThis script workarounds the resulting problems during installation (kill EAProxyInstaller.exe). So you still can play Simcity. Origin will just not be notified when you quit it.\n')" "$TITLE"

POL_SetupWindow_message "$(eval_gettext 'Origin requires the GTE CyberTrust Global Root certificate to connect to EA. Since this certificate is not secure it has been disabled by some Linux distributions recently (http://bugs.winehq.org/show_bug.cgi?id=35828). If Origin refuses to connect, then check out your distribution´s help system to learn how to reenable this insecure certificate.\n')" "$TITLE"

POL_SetupWindow_InstallMethod "DVD,ORIGIN"

if [ "$INSTALL_METHOD" = "DVD" ]; then

# Let the user select a DVD
POL_SetupWindow_cdrom

# Check if this DVD is the SimCity 2013 DVD
POL_SetupWindow_check_cdrom "SimCity.zip"

# Set and install the correct Wine version
POL_Wine_PrefixCreate "$WORKINGWINEVERSION"

# Run installer
taskset -c 0 wine start /unix "$CDROM/Setup.exe"

#Origin method
elif [ "$INSTALL_METHOD" = "ORIGIN" ]; then

# Set and install the correct Wine version
POL_Wine_PrefixCreate "$WORKINGWINEVERSION"

# Installing mandatory dependencies
POL_Wine_InstallFonts
POL_Function_FontsSmoothRGB
POL_Call POL_Install_wininet # Fix EA Connexion's issue 1
POL_Call POL_Install_vcrun2010
POL_Call POL_Install_vcrun2008
POL_Call POL_Install_vcrun2005
# MS Visual C++ 2008 Runtime with SP1 and
# MS DirectX (D3DX9_43.dll and d3dx9_31.dll) come with SimCity itself.

cd "$POL_USER_ROOT/tmp/"

# Downloading latest Origin
POL_Download "https://download.dm.origin.com/origin/live/OriginSetup.exe" ""

# Download "Qt5Network.bin.patch", see http://bugs.winehq.org/show_bug.cgi?id=31438#c128
# [EA Origin]Unable to download game since the new version
POL_Download "http://bugs.winehq.org/attachment.cgi?id=47911" ""

POL_SetupWindow_message "$(eval_gettext 'You are close to installing Origin.\n\nPress NEXT now to start the installation of Origin.\n\nComplete it, but don´t log in at the end of the installation process or Origin will be started too early. (If you log in anyway, just exit Origin. DO NOT TRY TO INSTALL SIMCITY IN ORIGIN NOW!)\n')" "$TITLE"

# Installing Origin
POL_Wine start /unix "OriginSetup.exe"

POL_SetupWindow_message "$(eval_gettext 'Please wait for the installation of Origin to complete. Don´t log in at the end of the installation process or Origin will be started too early. (If you logged in anyway, just exit Origin. DO NOT TRY TO INSTALL SIMCITY IN THIS STEP!)\n\nClick away the Origin login dialog and then press NEXT.\n\nOrigin will then be patched and started afterwards. So AFTER clicking NEXT now, login in the Origin dialog, then go in the Origin window to the ´My Games´ tab and start the download and installation of SimCity.\n')" "$TITLE"

# Kill Origin if the user still started it
if [ "$(ps aux | grep -c Origin.exe)" -gt 1 ]; then
killall Origin.exe
fi

# Patch Qt5Network.dll
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Origin"
patch -p0 < "$POL_USER_ROOT/tmp/attachment.cgi?id=47911"

# Start Origin with patched Qt5Network.dll
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Origin"
POL_Wine start /unix "Origin.exe"

fi

POL_SetupWindow_message "$(eval_gettext 'Please WAIT for the installation of SimCity to finish.\n\nIf the SimCity installer gets stuck after downloading on `Installing...` for more then 5 minutes press NEXT, the script will then try to fix it for you.\n\nPress NEXT when the installation is complete.\n')" "$TITLE"

# Kill EAProxyInstaller, which causes the installation not to finish
if [ "$(ps aux | grep -c EAProxyInstaller.exe)" -gt 1 ]; then
killall EAProxyInstaller.exe
fi

# Origin In Game has to be disabled
# Otherwise the Simcity start screen will load, but upon "Connecting to servers" SimCity will crash.
# Note that replacing IGO32.dll with an empty, chmod 000, file doesn't work anymore (Instead of starting
# up, Origin then complains "UPDATE ERROR, Your update could not be completed. Please download and install
# the latest version of Origin from https://download.dm.origin.com/origin/live/OriginSetup.exe." (which
# we already do.
POL_SetupWindow_message "$(eval_gettext 'The installation of SimCity should now be complete. (If the game is still updating then let it finish, but if it hangs for a long time then press NEXT.)\n\nIn the Origin window go to ´Origin - Application Settings - Origin In Game´ and UNTICK (disable) ´Enable Origin In Game´.\n\nThen close the Origin window and press NEXT. (If you can not close Origin, just press NEXT and the script will attempt to close it for you.)\n')" "$TITLE"

# Kill Origin if user didn't/couldn't close it
if [ "$(ps aux | grep -c Origin.exe)" -gt 1 ]; then
killall Origin.exe
fi

# Create shortcuts
POL_Shortcut "SimCity.exe" "$TITLE" "" "" "Game;"
POL_Shortcut "Origin.exe" "Origin - $TITLE" "" "" "Game;"

POL_SetupWindow_message "$(eval_gettext 'Installation finished!\n\nUnfortunately the game is known to sometimes work and sometimes not. It may be safest to play only on a freshly rebooted system and then to start Origin and just in there SimCity (instead of starting SimCity directly). If the actual SimCity game starts (you hear the sounds), but isn´t visible you can configure wine to emulate a virtual desktop.\n\nHave Fun!\n')" "$TITLECOMPLETE"

POL_SetupWindow_Close
exit 0

SimCity 2013 winehq AppDB maintainer
https://appdb.winehq.org/objectManager.php?sClass=version&iId=27821