how to port windows civ4 to mac osx (10.6-10.10) using wine wrappers and run more mod

z0wb13

undead
Joined
Feb 9, 2009
Messages
657
update (jan 2015): wrapper is updated to wine version 1.7.x

porting civ4: a how to in 3 easy steps.



these are instructions to install Civilization IV: Beyond the Sword for Windows on OSX (version 10.6 and up).
for step-by-step instructions on installing mods, go here.

requirements:
Civilization IV: Gold DVD for Windows (buy it from amazon)
civ4bts319 updater
civ4wrapper_yosemite

*old civ4wrapper_mavericks using wine 1.4
and even older civ4wrapper for osx 10.6-10.8

if you are installing from another version of civ4, see addendum v.

Step 1: your CoolNewWrapper!

first download the civ4wrapper from here (~300mb). next, mount the disk image file, and copy the file civ4bts319.app to you desktop, then right-click the file and choose Show Package Contents. you will see a screen that looks similar to this:


right-click on the Wineskin.app and click open. if prompted, click run an app from an unsigned developer. at the wineskin menu, click Install Software.


Step 2: installing from DVD.

click Choose Setup Executable, browse to your DVD, and choose setup.exe to begin installation. first, pick your language. wait a minute. click next, agree to a license, and then choose Custom Install. check install for all users, but uncheck register this game. keep the default file paths, click install, and find something to do for the next hour/3… like remembering to download the updater. try to stay patient, it takes about 20 mins to read everything from the DVD.


eventually, you will be prompted to click finished and, if you are installing from Civ4 Complete, asked if you would like to install the Colonization expansion pack. click cancel to save disk space if you were never going to play it anyways. wait a minute, and you will be prompted to choose the correct .exe file used in order to launch the game. it should be second choice from the top. if for any reason you need to change this path, like you wanted to play warlords for some reason, click the Configuration button and look for the field Windows EXE. the correct path reads like this:
/Program Files/2K Games/Firaxis Games/Sid Meier's Civilization 4 Complete/Beyond the Sword/Civ4BeyondSword.exe


since updating the wrapper for mavericks, i have noticed that sometimes wineskin.app and civ4bts319.app will fail to quit after the installer has finished. this means that you won't receive the prompt to choose an .exe file. it's annoying, and the inelegant solution is to force quit both programs (cmd-opt-esc). then navigate to the Wineskin Advanced window and click on the Configuration button. click on the Browse button across from Windows EXE and point to the correct file. see image below.


Step 3: updating, and Run! (... from an unsigned developer.)

back at the Wineskin Advanced window, click the Install Software button again, then point to the updater (it should be in your downloads folder). go ahead and let it run, but uncheck register this game when given the option. once that is finished, you will get an "Oops! ... Maybe the installer failed...?" message. click OK.

drag your wrapper into the Applications folder, rename it whatever you want, right-click your civ4bts319 wrapper and click open. agree to run an app from an unsigned developer. treat your wrapper like any other osx program. you're done!

although your installation should be playable at this point, go ahead and exit back to the desktop. there is a method to my madness; running civ will let it create the correct directories for saved games and mods, as well as generating the CivilizationIV.ini file.

addendum 1: CivilizationIV.ini
*note that if you have renamed civ4bts319.app, these terminal commands won't work unaltered.

the file named CivilizationIV.ini is the preferences file for civ4. here you can edit settings that will make civ4 run even more smoothly. i have included a sample .ini file in the wrapper disk image. to use it, drag it and the civ4bts319.app to your desktop, and type this into a terminal:
mv ~/Desktop/CivilizationIV.ini ~/Desktop/civ4bts319.app/drive_c/users/Wineskin/My\ Documents/My\ Games/Beyond\ the\ Sword/CivilizationIV.ini

if you want to make your own changes, drag civ4bts319 to your desktop and type this into a terminal:
open -a TextEdit ~/Desktop/civ4bts319.app/drive_c/users/Wineskin/My\ Documents/My\ Games/Beyond\ the\ Sword/CivilizationIV.ini

this will launch TextEdit and open the civ4 preference file. make sure to command-S (save) any changes. my recommendations:
; Enable voice over IP capture and playback
EnableVoice = 0

; Specify whether to play in fullscreen mode 0/1/ask
FullScreen = 0

; Set to 1 for no intro movie
NoIntroMovie = 1

; Disable caching of file system (may slow initialization)
DisableFileCaching = 1

; Disable caching of xml and file system (may slow initialization)
DisableCaching = 1

; Modular XML Loading
ModularLoading = 1

; Move along
CheatCode = chipotle

; Custom Screen Height, minimum: 768 - Normal resolutions can be set in-game and will be used when set to 0
ScreenHeight = *

; Custom Screen Width, minimum: 1024 - Normal resolutions can be set in-game and will be used when set to 0
ScreenWidth = *

*adjust to fit your screen. the osx menubar is 20 pixels tall.

addendum 2:running mods.
running mods was the whole point of this exercise, and the good news is that most work flawlessly, however you must very precisely follow the particular installation instructions for each one you are going to add. some mods run from the Documents/.../MODS folder, and some only from Program Files/.../Mods for reasons that i don’t even remotely understand. apparently it has something to do with how the mod was written. for a list of tested mods running under wineskin, plus step by step instructions, link to here.



addendum 3: multiplayer.
multiplayer works. the LAN lobby works for all computers running vanilla 3.19 bts, however i have experienced some issues related to running mods and playing multiplayer. if you want to connect playing mods, you will have to use the Direct IP method, and it usually takes a reload of the map after it is generated to correct any OOS errors.

addendum v: different versions.
there are several different versions of civ4 that i am aware of. once patched to version 3.19, they should all run.

the two DVD based versions are Gold (civ4 + BtS + warlords expansions) and Complete (Gold + Colonization expansion).
you could also purchase each expansion on its own. apparently there was even a 2 CD release of the base game.
gamefaqs has a guide to release dates and regions here.
archive.org maintains a list of patches here.

the steam version has a bug that you can work around by setting GameOverlayRenderer.dll to disabled in winecfg. other than that, it is reported to work well, and comes fully patched. to install it, first you you install the windows version of the steam client into the civ4wrapper, and then let said client download and install the game for you.

the "Green Pepper" version was a european re-release in jan 2010 of civ4 complete. it works, but you must use a region specific version of the 3.19 updater. it is found here and mirrored. this makes me suspect that the other regions releases might not apply the US patch, which might render the game unplayable, because versions prior to Beyond the Sword 3.19 require a disc check that wine might miss. i have found the japanese version of the patch, but have no way of verifying if it works;p

stay away from the amazon digital download option. their downloader isn't supported in wine1.4 (bug report). later versions may correct the issue but i don't have any reports on this yet.

addendum 10810: error.
since upgrading to mavericks, i have encountered a 10810 error when launching wineskin wrappers. it is related to gatekeeper. i emphatically DO NOT recommend disabling this security feature, although this would fix the problem. instead first right-click your wrapper and choose Show Package Contents. in the next window, right-click the Wineskin.app and choose open. you will be prompted to run application from unsigned developer. click agree, then press cmd-Q cmd-W (to quit wineskin and close your finder window). lastly, right-click you wrapper again, but this time choose open, and pick run... again when prompted. from now on, a standard double-click will launch your wrapper without problems.


NOTES:
Spoiler :
good news, you can skip all the tedium of learning how to use wine! i'm leaving up all the steps used in order to create a wrapper, just in case i forget how to do it, but you can skip all of the steps in this spoiler if you have downloaded it from the links above.

step 1: Download (and install) helper apps.

Xcode View in Mac App Store (lion and snow leopard users, see note1)
Wineskin Winery (click me to download)
Civ4 Beyond the Sword v3.19 Patch Download File
Microsoft XML Parser 3 Download Now CNET Secure Download

once everything is downloaded, open a Terminal window and copy paste in these commands, then press enter:
mkdir ~/Library/Caches/winetricks ; mkdir ~/Library/Caches/winetricks/msxml3 ; mv ~/Downloads/msxml3.msi ~/Library/Caches/winetricks/msxml3/
Spoiler :
in case you are unfamiliar with the terminal, i'll explain what is happening. the mkdir command makes a new directory (or folder in mac parlance). so the first two parts are creating folders named "winetricks" and "msxml3" in your Cache folder in the Library. the last part is to move (mv) the downloaded file "msxml3.msi" into the new folder. the "~" at the beginning of each line tells the computer to look inside your current user's home directory. the 3 commmands are separated by semi-colons ; like this one.



step 2: Wineskin Winery, creating your CoolNewWrapper.


launch the wineskin_winery.app and click the "+" sign to install a new engine, then download WS9Wine1.4.1NoXInput2. next, update your wrapper version to 2.5.9 and then click Create New Blank Wrapper. choose a name, for this guide use civ4bts319 (you can change this later) and click OK. during this process, you will be prompted to install Gecko, but click cancel to skip it.

when everything is finished, click Reveal in Finder to see your wrapper. make sure you quit the wineskin_winery.app, then double-click your new wrapper, and choose Advanced.


Step 3: Winetricks, installing missing libraries.

after clicking on Advanced, choose Tools from the top of the menu, then click on Winetricks. next, click Update Winetricks in the lower-left of the window. then, in the middle of the screen you will see a checkbox next to Custom. click this, and then where you see (arguments) copy and paste in this line.
vcrun6 msxml3 msxml4 directx9 dotnet11 dotnet11sp1 vcrun2003 quartz devenum vcrun6sp6 corefonts tahoma

there are a few ways to do this step, and as stupid as this method sounds, it's easy.
click Run (twice), and then you just have to agree to the licenses, although one of them is in german (click ja for yes).
after winetricks has run, run it again. not everything will take on the first try. and then run it a third time;p
i'm serious! keep running the command until all you see in the output terminal is "already installed, skipping". it took me 5 tries.


Step 4: Config Utillity, setting overrides and options.

you should be back at the Wineskin Advanced settings window. look for the Config Utility (winecfg) button under the Wine Tools sublisting. in the Wine Configuration window that loads after a minute, click on the Libraries tab. now, you will have to set three overrides. type the .dll file-name (see below) into the text box under "New overrides for library:" click add and it will appear in the "Existing overrides:" list below. select each one, then, click on the "Edit..." button to change the "Load order" to the correct setting.

.dll file-names:
"gameux" (disabled)
"msvcr71" (native)
"msxml3r" (native). <=this is not a typo. click Apply, then OK.

the final step is to make a few changes to the Options in the Wineskin Advanced window. make certain to uncheck "Map User Mac OS X folders in wrapper" as this will keep all of the game saves and mods contained inside the civ4tbs319.app that you are building instead of spread all over your documents folder. i also check "Option key works as Alt" and "Try to shutdown nicely".


addendum z: ugly font fix.
don't worry about this step, because i already did it for you;p just leaving it up for reference.

drag the civ4bts319.app to the desktop and paste this last code into a terminal:
cp ~/Desktop/civ4bts319.app/Contents/Resources/drive_c/Program\ Files/2K\ Games/Firaxis\ Games/Sid\ Meier\'s\ Civilization\ 4\ Complete/Assets/res/Fonts/sylfaen.ttf ~/Desktop/civ4bts319.app/Contents/Resources/drive_c/windows/Fonts/

press return. this will fix an ugly font problem. credits to guspasho.

note1: you do not need Xcode for Lion or Snow Leopard users. if you run snow leopard or lion, the mountain lion instructions should work just as well, except that you don't have to install Xcode first as it is included in your OS build. it's really that easy; everything else should remain the same.

note2: if you are streaming any content, this can cause the download to fail, so turn off pandora for a few minutes;p

note3: strictly speaking, you don&#8217;t need all of the d3dx9 files. only d3dx9_26.dll, d3dx9_31.dll, d3dx9_32.dll, d3dx9_33.dll are required, but it&#8217;s easier doing it this way.

note4: if you select Single Player => Beyond the Sword Content with a mod loaded, you might crash to desktop. so don&#8217;t do it!

ephemera: fullscreen cursor fix
update: using the NoXInput2 version of wine should alleviate most problems with the cursor, making this fix obsolete.

i don&#8217;t like to play civ4 in fullscreen mode; it runs much better in a window. one of the problems with fullscreen is that the cursor wants to be a spinning globe or hand instead of a pointer, which i find rather annoying. i have a quick and dirty terminal fix for it:
Spoiler :
drag the civ4bts319.app to the desktop and open a terminal. cd (change directory) to where the cursor .ani files are stored, by default it should look like this
cd ~/Desktop/civ4bts319.app/Contents/Resources/drive_c/Program\ Files/2K\ Games/Firaxis\ Games/Sid\ Meier\'s\ Civilization\ 4\ Complete/Assets/res/Cursors/
once you get to the correct directory, copy and paste in the following code and press enter.
mkdir backup ; cp *.ani backup/ ; rm -v *.ani ; cp backup/Pointer.ani Pointer.ani ; cp Pointer.ani Airbomb.ani ; cp Pointer.ani Airlift.ani ; cp Pointer.ani Airstrike.ani ; cp Pointer.ani Build.ani ; cp Pointer.ani BuildLarge.ani ; cp Pointer.ani Claim.ani ; cp Pointer.ani Deplete.ani ; cp Pointer.ani Edit.ani ; cp Pointer.ani EMP.ani ; cp Pointer.ani Found.ani ; cp Pointer.ani GoTo.ani ; cp Pointer.ani Grip.ani ; cp Pointer.ani Link.ani ; cp Pointer.ani Mine.ani ; cp Pointer.ani Move.ani ; cp Pointer.ani Mutiny.ani ; cp Pointer.ani Nuke.ani ; cp Pointer.ani Ping.ani ; cp Pointer.ani Rebase.ani ; cp Pointer.ani Recon.ani ; cp Pointer.ani Repair.ani ; cp Pointer.ani RouteTo.ani ; cp Pointer.ani 'Size All.ani' ; cp Pointer.ani 'Size Diagonal 1.ani' ; cp Pointer.ani 'Size Diagonal 2.ani' ; cp Pointer.ani 'Size H.ani' ; cp Pointer.ani 'Size V.ani' ; cp Pointer.ani 'Split H.ani' ; cp Pointer.ani 'Split V.ani' ; cp Pointer.ani Stasis.ani ; cp Pointer.ani Waiting.ani


old instructions for lion 10.7 are here. they are a little less elegant, but will do the job;p
 
Is this only for Mountain Lion or will it work on Snow Leopard as well? I am running Snow Leopard and have no plans to switch to Lion or Mountain Lion in the foreseeable future.
 
Is this only for Mountain Lion or will it work on Snow Leopard as well? I am running Snow Leopard and have no plans to switch to Lion or Mountain Lion in the foreseeable future.

yes, it will run on snow leopard. just skip the part about installing Xcode as it is already included in your build (i think:mischief:). everything else should stay the same.
 
Thanks! :)
 
How do I work the in-game Alt+ keyboard shortcuts, like Alt+C to chop? I'm using the Macbook Pro keyboard and I thought Option+C or Fn+Option+C would do it but it doesn't.
 
I already have Civ 4 BTS installed on a PC (... which I bought for the express purpose of playing Civ 4).

It's not the Complete version, it's a separate Civ 4 base game and unpatched BTS install, so it sounds like it'd be a pain to repeat the install procedure on my Mac.

Is there any way to just copy the installed version from my PC over to my Mac, and run that via Wine?
 
Is there any way to just copy the installed version from my PC over to my Mac, and run that via Wine?
actually, yes you can. but im not sure how it would turn out. you would still need to make the same tweaks in winetricks to the wrapper, but if you could fit your entire 2k games folder tree onto a usb thumbdrive it might work. there is an installation option to copy an entire folder into your wrapper, and ive seen some reports of linux users doing so
the patched version removes the DRM requirements.
if you have a disc, then you should be able to install any version, but it wont run unless updated to 3.19.
if you have the steam download, it should work also. it is basically patched and DRM free.
guspasho: How do I work the in-game Alt+ keyboard shortcuts, like Alt+C to chop? I'm using the Macbook Pro keyboard and I thought Option+C or Fn+Option+C would do it but it doesn't.
ill get to work on this. the problem is with keybindings. if i could figure it out, then screenshots should work as well.
 
I don't have a mac atm. But based on my experience with civ4 on linux (also via wine), the Original-Vanilla Edition & BTS-Expansion should also work with this "wineskin" system on mac.

Just follow the instructions till Step 5, no changes necessary. For Step 5, just insert&install with the Vanilla-DVD instead of the complete edition DVD.
Then download the latest patch for vanilla, install it in the same way as is in the OP description for the 3.19-patch (Step 6). After that install BTS from DVD by the same method you used for Vanilla, then proceed with Step 6.
 
no.
the patched version removes the DRM requirements.
if you have a disc, then you should be able to install any version, but it wont run unless updated to 3.19.
Darn. That would mean digging up 6 or more old PC CD-ROMs.

Would this method work with the Amazon "digital download" PC version?
 
Darn. That would mean digging up 6 or more old PC CD-ROMs.

Would this method work with the Amazon "digital download" PC version?

you can use wineskin (specifically wine1.4.1) to run any version of the game, but there are caveats.

windows programs have lots of dependencies that are spread all over the OS. if you copy/paste your c:\programfiles\civ4 directory into a Wrapper, you will miss all of the files that get put into the win32 folder that the program also uses.

when you run the installer for civ4, it makes sure that all (actually, only most of) the files you need to run the game are installed. and indeed it will run, but earlier versions of civ4 required a DVD to be in the drive. you can make wine point to the drive, and civ will boot just like you think it should. but it's a pita, and you should be running 3.19 anyway.

for steam versions, you would need to make a Wrapper that included the windows version of the steam downloader*. then, just download and install civ4 normally, it will already be patched to 319. you will still need to tweak your wrapper (step3 in the guide) by installing msxml3 libraries. for more info...

*idk if this is actaully true. i haven't tried this myself, but since the steam version can run on wine, it must also run on a mac with xcode.

as for the amazon download, idk. but basically, just use wine to run the installer program that you get from them, run the updater, and cross your fingers. as long as you follow steps 1-4 exactly, you should be ok;p

update: i just looked at the amazon version, and it would probably work better than steam. plus, it costs $7.86 less from here. says it's DRM free, so it's probably already patched to 3.19.
 
update: i just looked at the amazon version, and it would probably work better than steam. plus, it costs $7.86 less from here. says it's DRM free, so it should be a little easier to get running.
Excellent, that's exactly the version that I was looking at.

Okay, I'll try this and give feedback about my success.

Thank you for this thread, and for your help!
 
Excellent, that's exactly the version that I was looking at.

Okay, I'll try this and give feedback about my success.

Thank you for this thread, and for your help!
The Amazon version allows you to download an Amazon-specific installer ("Sid_Meiers_Civilization_IV_The_Complete_Edition_Downloader.exe"). This installer then downloads & installs the game.

Unfortunately the Amazon installer doesn't work with exactly the same Windows libraries as the DVD installer. I'm trying to figure out how to get it to work -- now I have it able to download a lot of data, but not install the game yet, as it crashes at one point.
 
@ guspasho: the combination to chop is command+option+C.

alt=cmd+opt
ctrl=ctrl (build fort is CTRL+F)
shft=shft (build windmill is SHFT+W)

Thanks! I also discovered there's an Wineskin advanced option that converts the option key in to the alt key, so I just enabled that.

I thought I'd try out mods but I'm having difficulty. I've tried selecting Single Player > BTS Content, and Advanced > Load a Mod, I've tried moving all mods to the ~/Documents/My Games/BtS/MODS folder but it crashes crashes to the desktop in each case. Launching a game with the mod selected in the INI works though, is this the only way to get mods to work?
 
There may be a problem with selecting the mod from within the game menus, because that causes the game to relaunch to load the mod. I'm no expert on WINE, but guess it's possible that the game doesn't know how to relaunch itself if it's running under WINE.
 
PS. Windows players who want to be able to launch with different mods create separate shortcuts with the required mod specified in the command line in each shortcut. I don't know whether there's a way to do this in WINE.
 
PS. Windows players who want to be able to launch with different mods create separate shortcuts with the required mod specified in the command line in each shortcut. I don't know whether there's a way to do this in WINE.

I'd *love* to know how to do this without creating a completely separate installation. This and being able to take screenshots are the only two problems I have left.
 
This wineskin page indicates that you can set EXE flags in the configuration screen (that's what you would have to use to specify a mod)
 
This wineskin page indicates that you can set EXE flags in the configuration screen (that's what you would have to use to specify a mod)

From what I can tell, I think I'd still have to manually edit that whenever I wanted to switch between mods.

Maybe the Mac equivalent of a batch file will do it, a different batch file to edit the INI to select the mod I want and then run the app. Batch files on OS X are new to me so I'll have to look in to it. Mainly I only want to switch between RFC and BUFFY right now, so I don't expect needing many.

I'm going to look in to this route and report back if I figure it out, but I don't have any experience with Mac batch files or scripting, so if anyone else knows how to do this already and with little effort, by all means let me know :)
 
Top Bottom