Das Forum

[Script] SimCity 2013

Autor Antworten
Jump to the page: 1 - 2 - 3
wojtek88 Sunday 3 August 2014 at 12:37
wojtek88Anonymous

Hi guys,
first of all - great work. I was able to run simcity using script provided by jre. Everything works like it is described and that's briliant. Of course, there are some minor issues, but this is normal while running game through wine. Unfortunately I have one issue that I would have to fix if I would like to play game for a long time - and maybe someone knows how to solve it. While being in city view when I move mouse over building it should be highlighted - instead weard white elements are shown, and they are in wrong place.
I attach part of the sample screenshot below. Did anyone had similar issue and knows how to get rid of it?

Deleted Involves piracy
jre Monday 10 November 2014 at 22:57
jreAnonymous

Hi,

EA recently released a new major version of Origin which causes troubles:

  • It broke the content downloading once again, I've adapted the script to that and now am able to fully install SimCity again.
  • Unfortunately I get a "We are unable to connect to EA servers to activate SimCity Digital Deluxe Edition on this computer using your account. Please try again later." At the same time this still works when I install in a terminal instead of using the script (using same wine version and doing exactly the same steps). (I'm on Debian Jessie amd64).
  • License text is not shown again, while it works fine without POL.

So this script might install everything, but then fail to launch SimCity... I'd like to hear from you whether 2.) happens to you, too. It would be great to hear a "Works here".

There have been different reports about graphic issues (e.g. wojtek88's or my fullscreen issue). I assume they are all hardware related. E.g. mine turned out to be a Intel/mesa one, which I could solve in the meantime. Also, the texture stuff is definitely experiencing continuous improvement in wine

Changelog:

  • use wine 1.7.30
  • drop all additional dependencies (wininet, vcrun20XX, font stuff)
  • simplify and documentation updates (moved some information from POL_SetupWindow_message to comments, removed obsolete stuff)
  • rename PREFIX to SimCity2013
  • adapt closer to POL style scripting
  • use "POL_Wine" instead of sytem "wine" in DVD section
  • rewrite patch Origin's Qt5Network.dll section, update to work again with new Origin

 

#!/bin/bash
# Date : (2013-07-19 01-51)
# Last revision : (2014-11-09 01-54)
# Wine version used : 1.7.30
# Distribution used to test : Debian Jessie (testing)
# Authors : Jimmy Ramsmark (alcorsepol, initial DVD version)
#           Steven Wilson (steve723, modified to add Origin
#            download support using Origin script by
#            GNU_Raziel: http://www.playonlinux.com/en/
#            changelog-1059-EAs_Origin.html (?)
#           jre
# Licence : GPLv3

# The initial version of this script was tested using the
# DVD version of 'SimCity 2013' bought in Sweden 2013
# with wine 1.6-rc2, xUbuntu 13.10

# The Origin version of this script was tested:
# Older Origin       with wine 1.5.28-Origin
# Origin 9.4.12.2807 with wine 1.7.23
# Origin 9.5.1.571   with wine 1.7.30

# Known bad wine versions:
# - 1.7.23 (newer Origin versions crash).
# - 1.7.29 (textures, wine bug #37406).

# This script mimics the HOWTO from the wine AppDB:
# https://appdb.winehq.org/objectManager.php?sClass=version&iId=27821
# Check TROUBLESHOOTING there first, if you have any
# issues.

# Known bugs:
# * Origin needs Job Objects (a wine by POL using the patch
#   from wine bug #33723 would be nice).
#   Then this would work:
#   - Installation finishes automatically (no
#     "kill EAProxyInstaller.exe" necessary).
#   - Origin doesn't complain that SimCity is still
#     running after quitting SimCity.
#   - Update of "Last Played/Time Played" in Origin.
#   Otherwise AFAIK there are no big gains with this (jre).
# * Origin's license text itself is not visible.
#   But I can see it in Debian's wine (jre).
# * Sometimes graphic glitches.
#   (I guess depending on certain hardware, jre.)

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

TITLE="SimCity 2013"
TITLE2="Origin"
AUTHOR="Jimmy Ramsmark and others"
PREFIX="SimCity2013"
WORKINGWINEVERSION="1.7.30"

POL_SetupWindow_Init
POL_Debug_Init

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

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

# Installing mandatory dependencies
# (They were recommended sometime, but I've found none of
# them to be necessary here, jre)
#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
#POL_Call POL_Install_directx9 (probably crashes SimCity)
# MS Visual C++ 2008 Runtime with SP1 and
# MS DirectX (D3DX9_43.dll and d3dx9_31.dll) come with SimCity itself.

POL_SetupWindow_InstallMethod "DVD,ORIGIN"

# DVD method
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"

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

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

    # Download latest Origin (gets updated constantly, so no md5sum available)
    POL_System_TmpCreate "$PREFIX"
    cd "$POL_System_TmpDir"
    POL_Download "https://download.dm.origin.com/origin/live/OriginSetup.exe" ""

    POL_SetupWindow_message "$(eval_gettext 'You are close to installing $TITLE2.\n\nPress NEXT now to start the installation of $TITLE2.\n\nThen follow the graphical install setup, but don´t log in at the end of the installation process. (If you log in anyway, just exit $TITLE2. DON´T TRY TO INSTALL $TITLE IN $TITLE2!)\n')" "$TITLE"

    # Installing Origin
    POL_Wine start "OriginSetup.exe"

    POL_SetupWindow_message "$(eval_gettext 'Please wait while $TITLE2 is installed. Don´t log in at the end of the installation process. (If you logged in anyway, just exit $TITLE2. DON´T TRY TO INSTALL $TITLE IN $TITLE2!)\n\nClick away the $TITLE2 login dialog and then press NEXT here.\n\n$TITLE2 will then be patched and restarted afterwards. So AFTER clicking NEXT here, login in the $TITLE2 dialog, then go in the $TITLE2 window to the ´My Games´ tab and start the download and installation of $TITLE.\n')" "$TITLE"

    # Kill Origin if the user still started it
    [ "$(ps aux | grep -c Origin.exe)" -lt 2 ] || killall Origin.exe

    # Patch Origin's Qt5Network.dll to buffer the QTcpSocket again (wine bug #31438)

    # Test if it has the known md5sum
    if [ "$(md5sum $WINEPREFIX/drive_c/$PROGRAMFILES/OriginQt5Network.dll | \
        sed "s| .*||")" = e0a5dc63aadcbaf671625dd8fa965e48 ]
    then
    # Change 1 byte in Qt5Network.dll to enable QTcpSocket buffering
    POL_Debug_Message "Qt5Network.dll: direct patching"
    cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Origin"
    printf '\x01' | dd of=Qt5Network.dll bs=1 seek=551777 count=1 conv=notrunc
    else
    # Download the python patch script, update it and try it
    POL_Debug_Message "Qt5Network.dll: python script patching"
    cd "$POL_System_TmpDir"
    POL_Download "http://bugs.winehq.org/attachment.cgi?id=49307" "078c2713aae6b6154303e19912c19293"
    mv attachment.cgi?id=49307 patch_qt5network_wine.py
    POL_Download "http://bugs.winehq.org/attachment.cgi?id=49932" "04ea372605edf8ded2bf15adf62fdb81"
    mv attachment.cgi?id=49932 patch_qt5network_wine.py.49932.patch
    patch < patch_qt5network_wine.py.49932.patch
    chmod +x patch_qt5network_wine.py
    cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Origin"
    "$POL_System_TmpDir/patch_qt5network_wine.py"

    # If this failed, exit
    [ "$?" -eq "0" ] || POL_Debug_Fatal "Failed to patch Qt5Network.dll to enable QTcpSocket buffering."
    fi

    # Remove the temporary directory
    POL_System_TmpDelete

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

fi

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

# Kill EAProxyInstaller, which causes the installation not to finish
[ "$(ps aux | grep -c EAProxyInstaller.exe)" -lt 2 ] || killall EAProxyInstaller.exe

# 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."
# (what we already do).
POL_SetupWindow_message "$(eval_gettext 'The installation of $TITLE should now be complete.\n\nIMPORTANT:\nIn the $TITLE2 window go to ´Origin - Application Settings - Origin In Game´ and UNTICK (disable) ´Enable Origin In Game´.\n\nThen close the $TITLE2 window and press NEXT. (If you can not close $TITLE2, just press NEXT and the script will attempt to close it for you.)\n')" "$TITLE"

# (Again, in case the user clicked NEXT to early before)
# Kill EAProxyInstaller, which causes the installation not to finish
[ "$(ps aux | grep -c EAProxyInstaller.exe)" -lt 2 ] || killall EAProxyInstaller.exe

# Kill Origin if user didn't/couldn't close it
[ "$(ps aux | grep -c Origin.exe)" -lt 2 ] || killall Origin.exe

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

POL_SetupWindow_message "$(eval_gettext '$TITLE has been successfully installed.')" "$TITLECOMPLETE"

POL_SetupWindow_Close
exit 0

 

Editiert von: jre


SimCity 2013 winehq AppDB maintainer
https://appdb.winehq.org/objectManager.php?sClass=version&iId=27821
LinuxScripter Sunday 27 September 2015 at 15:52
LinuxScripterAnonymous

 

Hi,

EA recently released a new major version of Origin which causes troubles:

  • It broke the content downloading once again, I've adapted the script to that and now am able to fully install SimCity again.
  • Unfortunately I get a "We are unable to connect to EA servers to activate SimCity Digital Deluxe Edition on this computer using your account. Please try again later." At the same time this still works when I install in a terminal instead of using the script (using same wine version and doing exactly the same steps). (I'm on Debian Jessie amd64).
  • License text is not shown again, while it works fine without POL.

So this script might install everything, but then fail to launch SimCity... I'd like to hear from you whether 2.) happens to you, too. It would be great to hear a "Works here".

There have been different reports about graphic issues (e.g. wojtek88's or my fullscreen issue). I assume they are all hardware related. E.g. mine turned out to be a Intel/mesa one, which I could solve in the meantime. Also, the texture stuff is definitely experiencing continuous improvement in wine

Changelog:

  • use wine 1.7.30
  • drop all additional dependencies (wininet, vcrun20XX, font stuff)
  • simplify and documentation updates (moved some information from POL_SetupWindow_message to comments, removed obsolete stuff)
  • rename PREFIX to SimCity2013
  • adapt closer to POL style scripting
  • use "POL_Wine" instead of sytem "wine" in DVD section
  • rewrite patch Origin's Qt5Network.dll section, update to work again with new Origin

I just used this script and after instaling Origin I got errors about dlls:

err:module:import_dll Library MSVCP120.dll (which is needed by L"C:\\Program Files\\Origin\\Origin.exe") not found
err:module:import_dll Library MSVCR120.dll (which is needed by L"C:\\Program Files\\Origin\\Origin.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"C:\\Program Files\\Origin\\Origin.exe" failed, status c0000135
err:module:import_dll Library MSVCP120.dll (which is needed by L"C:\\Program Files\\Origin\\Origin.exe") not found
err:module:import_dll Library MSVCR120.dll (which is needed by L"C:\\Program Files\\Origin\\Origin.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"C:\\Program Files\\Origin\\Origin.exe" failed, status c0000135
err:module:import_dll Library MSVCP120.dll (which is needed by L"C:\\Program Files\\Origin\\Origin.exe") not found
err:module:import_dll Library MSVCR120.dll (which is needed by L"C:\\Program Files\\Origin\\Origin.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"C:\\Program Files\\Origin\\Origin.exe" failed, status c0000135

After I clicked next I got a fatal error:

09/27/15 15:37:10 - [main] Fatal: Failed to patch Qt5Network.dll to enable QTcpSocket buffering.

Anyone help?


jre Sunday 27 September 2015 at 17:49
jreAnonymous

Add in line 77:

POL_Call POL_Install_vcrun2013
 
Edit line 54 (there is NO space between = and the version number, although it might look otherwise. Just update the version number):
WORKINGWINEVERSION="1.7.51"
 
Remove line 109-137 (patching isn't necessary since Wine 1.7.35), ignore the message to not log in the first time.
 
This should fix your current issues, but I fear you'll have other issues while installing Origin then, see https://appdb.winehq.org/objectManager.php?sClass=version&iId=26175.
 
Greets
jre

Editiert von: jre


SimCity 2013 winehq AppDB maintainer
https://appdb.winehq.org/objectManager.php?sClass=version&iId=27821
LinuxScripter Sunday 27 September 2015 at 22:05
LinuxScripterAnonymous

Here is the new script, modificated according to jre's advices and with info about Unity install failure and manually killing EAProxySetup.exe

#!/bin/bash
# Date : (2013-07-19 01-51)
# Last revision : (2015-09-27 22-02)
# Wine version used : 1.7.51
# Distribution used to test : Debian Jessie (testing),Ubuntu 15.04
# Authors : Jimmy Ramsmark (alcorsepol, initial DVD version)
#           Steven Wilson (steve723, modified to add Origin
#            download support using Origin script by
#            GNU_Raziel: http://www.playonlinux.com/en/
#            changelog-1059-EAs_Origin.html (?)
#           jre
#           LinuxScripter (changing wine version(big thanks to jre for telling me this),
#            removal of some obsolete lines since patching QT5Network.dll is no longer necessary)
# Licence : GPLv3
 
# The initial version of this script was tested using the
# DVD version of 'SimCity 2013' bought in Sweden 2013
# with wine 1.6-rc2, xUbuntu 13.10
 
# The Origin version of this script was tested:
# Older Origin       with wine 1.5.28-Origin
# Origin 9.4.12.2807 with wine 1.7.23
# Origin 9.5.1.571   with wine 1.7.30
# Origin 9.8.3.59237 with wine 1.7.51

# This script mimics the HOWTO from the wine AppDB:
# https://appdb.winehq.org/objectManager.php?sClass=version&iId=27821
# Check TROUBLESHOOTING there first, if you have any
# issues.
 
# Known bugs:
# * Origin needs Job Objects (a wine by POL using the patch
#   from wine bug #33723 would be nice).
#   Then this would work:
#   - Installation finishes automatically (no
#     "kill EAProxyInstaller.exe" necessary).
#   - Origin doesn't complain that SimCity is still
#     running after quitting SimCity.
#   - Update of "Last Played/Time Played" in Origin.
#   Otherwise AFAIK there are no big gains with this (jre).
# * Sometimes graphic glitches.
#   (I guess depending on certain hardware, jre.)
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="SimCity 2013"
TITLE2="Origin"
AUTHOR="Jimmy Ramsmark and others"
PREFIX="SimCity2013"
WORKINGWINEVERSION="1.7.51"
 
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "Maxis" "http://www.simcity.com/" "$AUTHOR" "$PREFIX"
POL_Wine_SelectPrefix "$PREFIX"
 
# Set and install the correct Wine version
POL_Wine_PrefixCreate "$WORKINGWINEVERSION"
 
# Installing mandatory dependencies
# (They were recommended sometime, but I've found none of
# them to be necessary here, jre)
# (They might become necessary depending on wine version used and hardware, LinuxScripter)
#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
#POL_Call POL_Install_directx9 (probably crashes SimCity)
# MS Visual C++ 2008 Runtime with SP1 and
# MS DirectX (D3DX9_43.dll and d3dx9_31.dll) come with SimCity itself.

#This is installed in order to avoid MSVCP120.dll error.
POL_Call POL_Install_vcrun2013

POL_SetupWindow_InstallMethod "DVD,ORIGIN"
 
# DVD method
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"
 
    # Run installer
    taskset -c 0 POL_Wine start /unix "$CDROM/Setup.exe"
 
# Origin method
elif [ "$INSTALL_METHOD" = "ORIGIN" ]
then
 
    # Download latest Origin (gets updated constantly, so no md5sum available)
    POL_System_TmpCreate "$PREFIX"
    cd "$POL_System_TmpDir"
    POL_Download "https://download.dm.origin.com/origin/live/OriginSetup.exe" ""
 
    POL_SetupWindow_message "$(eval_gettext 'You are close to installing $TITLE2.\n\nPress NEXT now to start the installation of $TITLE2.\n\nThen follow the graphical install setup. It might crash with "Please reinstall Origin" error.\n\nIn that case copy the contents of a working setup from VM or dual boot.\n\nThen you will have to manually kill EAProxyInstaller.exe')" "$TITLE"
 
    # Installing Origin
    POL_Wine start "OriginSetup.exe"
    # Kill Origin if the user still started it
    [ "$(ps aux | grep -c Origin.exe)" -lt 2 ] || killall Origin.exe
fi
 
    # Remove the temporary directory
    POL_System_TmpDelete
    cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Origin"
    POL_Wine start "Origin.exe"
 
fi
 
POL_SetupWindow_message "$(eval_gettext 'Please wait while $TITLE is installed.\n\nIf the $TITLE installer gets stuck (after downloading) on `Installing...` for more then 5 minutes press NEXT, the script will then try to fix this for you.\n\nPress NEXT when the installation is complete.\n')" "$TITLE"
 
# Kill EAProxyInstaller, which causes the installation not to finish
[ "$(ps aux | grep -c EAProxyInstaller.exe)" -lt 2 ] || killall EAProxyInstaller.exe
 
# Origin In Game has to be disabled
# Otherwise the SimCity start screen will load, but upon "Connecting to servers" SimCity will crash.

POL_SetupWindow_message "$(eval_gettext 'The installation of $TITLE should now be complete.\n\nIMPORTANT:\nIn the $TITLE2 window go to ´Origin - Application Settings - Origin In Game´ and disable ´Enable Origin In Game´.\n\nThen close the $TITLE2 window and press NEXT. (If you can not close $TITLE2, just press NEXT and the script will attempt to close it for you.)\n')" "$TITLE"
 
# (Again, in case the user clicked NEXT to early before)
# Kill EAProxyInstaller, which causes the installation not to finish
[ "$(ps aux | grep -c EAProxyInstaller.exe)" -lt 2 ] || killall EAProxyInstaller.exe
 
# Kill Origin if user didn't/couldn't close it
[ "$(ps aux | grep -c Origin.exe)" -lt 2 ] || killall Origin.exe
 
# Create shortcuts
POL_Shortcut "Origin.exe" "Origin - $TITLE" "" "" "Game;"
 
POL_SetupWindow_message "$(eval_gettext '$TITLE has been successfully installed.')" "$TITLECOMPLETE"
 
POL_SetupWindow_Close
exit 0

I hope I helped somebody out with runing our beloved city simulator on Linux cheeky

EDIT:I just found a new bug/error thing.When you click play in Origin and the green "play" button in the game's launcher, a broken black window shows up and takes most of the screen. This message appears a few times:

err:ole:CoInitializeEx Attempt to change threading model of this apartment from apartment threaded to multi-threaded

I fixed it by enabling the "virtual screen" option in winecfg.

EDIT 2:This error still appears but the game is working great-expect for the fact I am stuck in single player mode.

Editiert von: LinuxScripter