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

FNP

Chieftain
Joined
Nov 2, 2009
Messages
70
Location
ashore
i'm sure i'm not following you FNP. you can assign any drive letter you want, are you having a problem running the 3.19 updater?

update: i just came across this :

if this is the case, then i'm not exactly sure what you need to do. the person that posted the above message did not specify what their disc was named or what the installer was looking for.

try this (it will attempt to make wine point to your cd): right click your civ4bts319 and Show Package Contents. double-click the Wineskin.app that you find inside. choose Advanced, then Tools, and click on Config Utility (winecfg).
here are some pictures to help assign a drive:


OK got it to point to the correct files. Now it crashes on startup. "encountered a serious problem and needs to close". Looking at log: it says there is an illegal instruction in 32 bit code.

I'm starting over and will see if plain vanilla Civ IV will work, then get on with patches and updates.

Thanks
 

z0wb13

undead
Joined
Feb 9, 2009
Messages
657
OK got it to point to the correct files. Now it crashes on startup. "encountered a serious problem and needs to close". Looking at log: it says there is an illegal instruction in 32 bit code.
Thanks

i saw this
Unhandled exception: page fault on write access to 0x0000001b in 32-bit code (0x7dee2b69).
Using pthreads (wine-pthread) cleared that up for me.
unfortunately i don't really know what it means:mischief: and i can't test it right now.

try this: add mscoree.dll to the windows/system32 folder in your wrapper. you can find it here. some people running off of the cd versions were having trouble that sounds like what your seeing.

I'm starting over and will see if plain vanilla Civ IV will work, then get on with patches and updates.

actually, don't do this. use disk utility to make .cdr images of your cds and keep all three images mounted as you are attempting this. you might need to take a few whacks at this problem and your HD will load new installations faster than having to copy from discs.

after making a wrapper with all of the changes/winetricks, copy/duplicate it and then run the installers. once you get a stable version running, then go ahead and clear off your HD.

i also really advise against running vanilla civ4 version 1.0.x or whatever. instead, patch BtS all the way up to 3.19 and try a Test Run. sometimes problems arise when using wine to access different volumes on the same drive, and also there might be a bug in the installer program itself, making things even more confusing. version 3.19 had a bunch of bug fixes and optimizations that definitely improved stability. just use the latest and greatest;p
 

tldavis92

Chieftain
Joined
May 19, 2013
Messages
6
yes, the game needs those missing libraries to run correctly, consistently.

my advice, which i take no responsibility for;p would be to:

1. install xcode
2. install wineskin
3. download SteamInstaller.msi
4. create a wrapper (use wine 1.4.1NoXInput2)
5. use winetricks,winecfg and advanced options to tweak the wrapper (steps 3 & 4 in the guide)
6. install the steam client:
under Wineskin Advanced=>Configuration, click Install Software
choose setup.exe and install Steam client from .msi file
go to Configuration (look at the picture) chose correct exe path and set flag "-no-dwrite". click the Test Run button
steam will auto-update, just like every time you connect to steam
steam may freeze, force quit if the updater seems to hang and relaunch
eventually i was able to enter my credentials, i got a text message on my phone to verify the new "machine"
from here i was able to click around pretty normally, look at my purchases, etc.
=============== after this point i have not tried anything that follows. good luck!
7. install civ version whatever. i think on steam there is civ4 vanilla for $20, and complete is $30 neither requires an update, sfaik
8. delete the "-no-dwrite" flag under Configuration and change the Windows EXE to something like:
c:/ProgramFiles (x86)/Steam/SteamApps/common/.../.../Civ4BeyondSword.exe
9. at this point, civ should be installed and running. go back to step 6 in the guide, skipping the bit about running the updater.

let me know if this works, i have no idea if steam's DRM is going to be a problem, but from my experience it works as advertised.
that is to say, you only need to log in to download your games, you don't have to be online to play them.
it would be kind of neat if the steam achievements would still work with this setup.

one last thing, you can make a batch.bat file to launch two programs at the same time in wine, so if steam has to be running, this would be the solution. also, the steam client throws up GameOverlayRenderer.dll errors, so don't run it if you don't have to.

This is working up to step 8. I got the windows EXE to point to the right address, but then what do I do? Do I press install software and if so what file do I point to?
 

z0wb13

undead
Joined
Feb 9, 2009
Messages
657
This is working up to step 8. I got the windows EXE to point to the right address, but then what do I do? Do I press install software and if so what file do I point to?

click test run. that should start the Civ4BeyondSword.exe and hopefully something should happen... otherwise, launch it from steam.

you only need to use the install software button to get the steam client set up, and then use the client to download and install the game files.
 

tldavis92

Chieftain
Joined
May 19, 2013
Messages
6
So Civ4 seems to load up flawlessly. But then the problem is that when I try to exit Civ4 I get a black screen with the civ loading window over it and it doesn't go away. The only way out is to force quit.

Also, I wasn't able to follow step 7 because the terminal couldn't find the file. I tried browsing for it manually but can't get past user/applications/wineskin. The only file I see at that point is civbts319. How do I get to the path that looks like it's coming out of windows?
 

z0wb13

undead
Joined
Feb 9, 2009
Messages
657
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 :)

i figured out how to do this, it's right there in the wineskin advanced window under tools:blush:. there is a button called Custom Executable Launcher Maker

from here you can basically make a short cut. in the picture above, i made a link to the Colonization remake, and when you click save you get a little .app file inside your wrapper. you can rename colony.app or whatever, and drag it out of the wrapper to run it from anywhere.


you can use the method to have autolaunch options for mods, also. choose a name, anything works here. browse to the correct exe file (so if you are using a mod for warlords or BtS, make sure you point to that version). then set an EXE flag to make your mod launch at start.

 

z0wb13

undead
Joined
Feb 9, 2009
Messages
657
How do I get to the path that looks like it's coming out of windows?

right click (or control left click) on the civ4bts319 app and Show Package Content. the correct path is:

~/Applications/Wineskin/civ4bts319.app/Contents/Resources/drive_c/...

and then work it out from there. you can also use the terminal if you are familiar with how it works.

as for the problems in step 7: the first part, all it does is copy a font file from the civ folder to the windows Fonts folder. you can do this "manually" from the finder. try doing a search for sylfaen.ttf but you MUST do the search from inside the civ4bts319 (NOT this mac) or you won't find it.

the second part i would think should work correctly, unless the steam version keeps the CivilizationIV.ini file in a different place than it normally would. to fix it, again show package content, and then do a search within that package for the ini file. when you find it, right-click and choose textedit as your preferred program.

But then the problem is that when I try to exit Civ4 I get a black screen with the civ loading window over it and it doesn't go away. The only way out is to force quit.

well, that's not so bad. i don't have that problem, so it's probably something to do with the steam version, not wine. could you post a screen shot? also, are you launching civ4 directly, or are you using the steam client to launch civ? in other words, what does your windows EXE path look like under Configuration options in Wineskin Advanced?
 

tldavis92

Chieftain
Joined
May 19, 2013
Messages
6
right click (or control left click) on the civ4bts319 app and Show Package Content. the correct path is:

~/Applications/Wineskin/civ4bts319.app/Contents/Resources/drive_c/...

and then work it out from there. you can also use the terminal if you are familiar with how it works.

as for the problems in step 7: the first part, all it does is copy a font file from the civ folder to the windows Fonts folder. you can do this "manually" from the finder. try doing a search for sylfaen.ttf but you MUST do the search from inside the civ4bts319 (NOT this mac) or you won't find it.

the second part i would think should work correctly, unless the steam version keeps the CivilizationIV.ini file in a different place than it normally would. to fix it, again show package content, and then do a search within that package for the ini file. when you find it, right-click and choose textedit as your preferred program.



well, that's not so bad. i don't have that problem, so it's probably something to do with the steam version, not wine. could you post a screen shot? also, are you launching civ4 directly, or are you using the steam client to launch civ? in other words, what does your windows EXE path look like under Configuration options in Wineskin Advanced?

Found it, thanks! The game seems to run great. The problem with having to force quit is less of a deal now that the game is run in a window; I can just option-click on the icon to dump it.

I'm running the game directly as Civ4 without launching through Steam, but it does log me into Steam when I launch the game. That must be their DRM kicking in.

Going to try out some mods now. Thanks again!
 

sgi

Chieftain
Joined
May 28, 2013
Messages
6
Hi,

many thanks for this tutorial. However, it doesn't work at all on the two very recent computers I tried it (both on Mountain Lion 10.8.3); as it is the first time I use winetricks it is entirely possible I missed completely something.

My problem arises when I ask to execute the exe file on the DVD: I get the message "Oops! No new executable found! Maybe the installer failed?"

What is really weird is that I obtain this with the complete DVD; I also have a vanilla Civilization IV which runs itself without any issue.

I have tried around several tricks to make it work, without success:
. In the list of libraries, only the xml related one appear, not all the others related to directx. If before using Winetricks I set a Windows more recent than Windows XP, they do appear as in the screenshot, but I get the error message anyway.
. I have tried DirectX9 or D3Dx9_, with the same result.
. When I install DirectX, I have a message that the checksum fails. So I have tried to download independently directx_feb2010_redist.exe and put it in the correct location; I avoid the message but the error remains.
. A test log prints the message err:ole:CoGetClassObject class {6bf52a52-394a-11d3-b153-00c04f79faa6} not registered. I haven't found which dll would solve this, but my old Civ4 vanilla works anyway, so I guess this is not the core of my problem.
. I have installed in winetricks the library one after the other. When I did it en masse, some dialogs weren't opened. A problem I consistently have concerns dotnet11sp1: there is a message asking to mimic a reboot. If I say yes I have an error message issued, if I say no my problem is not solved.
. I have tried both 1.4.1 and 1.4.1NoXInput2, as the screenshots aren't entirely consistent about them. Both fails equally.

So I must admit I'm completely stuck; I have no idea what to try next to solve this. What is really frustrating is that apparently I'm the only one experiencing those specific mishaps.

Many thanks for any advice that could help me make the installation work.
 

z0wb13

undead
Joined
Feb 9, 2009
Messages
657

ok. so nothing is installing. that's why you are seeing the "Oops! No new executable found! Maybe the installer failed?" message. make sure to point to the correct installer, in the case of the complete DVD, it's called "setup.exe" without quotes. if you point to "autorun.exe" you might run into problems.

. I have tried both 1.4.1 and 1.4.1NoXInput2, as the screenshots aren't entirely consistent about them. Both fails equally.

my first attempts to install this use wine 1.4.1, but i found out later that 1.4.1NoXInput2 works better for full-screen mode. don't worry about this anyway, because you can always change your wine engine if something better comes along.

. When I install DirectX, I have a message that the checksum fails. So I have tried to download independently directx_feb2010_redist.exe and put it in the correct location; I avoid the message but the error remains.

make sure to click Update Winetricks before you try this step. however, i'd bet that you are streaming content while attempting these downloads. if this is the case, then stop! i have also encountered checksum errors using winetricks if i'm also streaming music, etc. so don't do it! otherwise, you can download the files that you need and put them into:
~/Library/Caches/winetricks/blahblahblah/whatever.installer
note that blahblahblah is hardcoded to winetricks. if your download fails, there is probably going to be a folder in the tree to show you what you need, so just put the file you want in that spot, and then rerun winetricks. HOWEVER!!! you shouldn't need to do this, and i don't recommend it.

Spoiler :
open ~/Library/Caches/winetricks/
type that into a terminal if you really want to look at the files in the finder.


. In the list of libraries, only the xml related one appear, not all the others related to directx.
i just rewrote the whole part about using winetricks. hopefully this new method is a little bit easier to follow, although it does feel a bit like banging your head against the wall.

A problem I consistently have concerns dotnet11sp1: there is a message asking to mimic a reboot. If I say yes I have an error message issued, if I say no my problem is not solved.

could you post a screenshot? idk about this one; ive never noticed it. ultimately, you shouldn't worry about this one until you have the game up and running. the really crucial dll is msxml3, as i've gotten the game to run with only this one tweak.
 

sgi

Chieftain
Joined
May 28, 2013
Messages
6
Thanks for your quick and thorough reply.

I have tried the new instructions you gave, without success (by the way it is likely you forgot corefonts in your list).

The problem is in fact very likely related to my connection: the checksum for both DirectX and dotnet1 keeps failing, so it downloads again... I will therefore try to download it from another place and see if it works better.

I wasn't streaming during the downloads, merely browsing, and during my last attempt I even kept from doing so.

I tried again to download independently the files, but the dotnetfx I fetched wasn't clearly the same one and it tried to download it.

I'll let you know once I've tried downloading from elsewhere.

Best regards, and thank you for your help!
 

z0wb13

undead
Joined
Feb 9, 2009
Messages
657
I have tried the new instructions you gave, without success (by the way it is likely you forgot corefonts in your list).
fixed. good catch.

The problem is in fact very likely related to my connection: the checksum for both DirectX and dotnet1 keeps failing, so it downloads again... I will therefore try to download it from another place and see if it works better.

you might try deleting the files found under ~/Library/Caches/winetricks/ except for msxml3 since you know that one is right, and then trying again. i've had checksum errors sometimes, and i'm not sure what causes it, although streaming music seems to have an effect. this picture might help you:



once everything is setup right, this is what you should see. hopefully;p
 

sgi

Chieftain
Joined
May 28, 2013
Messages
6
I've tried the process elsewhere, and this time no checksum error of any sort.

However, the final result remains the same: it doesn't work...

Here is a message about Dotnet 1.1:

"You just simulate a Windows reboot to complete the installation of Microsoft .NET Framework 1.1. Click Yes to do this now or No if you want to restart later".

Clicking on yes leads to error but in the end it said it is correctly installed...

So I've run out of ideas for now... I think I will give it a try in few days, but I must admit I'm quite fed up at the moment.

Really thank you for all your help and advices!

Best regards,
 

sgi

Chieftain
Joined
May 28, 2013
Messages
6
Just one more question... I assumed all along that wine was installed in the Winetricks app, but the more I'm digging the more I'm doubting this...

I have currently (quite recently in fact) a new error message in Test Run:

"The X11 driver is missing. Check your build!"

A Google search highlights two possible causes:
. Wine run as root. Not my case.
. WIne not completely installed.

I've been on wineticks page, and ran the download script; it fails due to wineserver not found.

The only point that tells me it would be too simple an explanation is that my vanilla Civilization IV CD was working...
 

z0wb13

undead
Joined
Feb 9, 2009
Messages
657
Just one more question... I assumed all along that wine was installed in the Winetricks app, but the more I'm digging the more I'm doubting this...
you aren't installing wine, per se; when you download a new wine engine, you can create a new installation package. wine is not an emulator. it isn't a program that you install, it just sort of passes windows instructions through to linux and your processor. it's more of a library?:confused: http://wiki.winehq.org/Debunking_Wine_Myths

I have currently (quite recently in fact) a new error message in Test Run:

"The X11 driver is missing. Check your build!"
okay, i think :crazyeye: that you are having a problem your wine engine. in wineskin winery.app delete your installed engine and try to download it again. or it could be an issue with Xcode, in which case you should uninstall/reinstall it. if this still doesn't fix things, you should try XQuartz. i have this on my system, and it could be making the difference. however, i've managed to build this installation on machines that only have Xcode installed.

The only point that tells me it would be too simple an explanation is that my vanilla Civilization IV CD was working...

was?!?! working...
 

sgi

Chieftain
Joined
May 28, 2013
Messages
6
you aren't installing wine, per se; when you download a new wine engine, you can create a new installation package. wine is not an emulator. it isn't a program that you install, it just sort of passes windows instructions through to linux and your processor. it's more of a library? http://wiki.winehq.org/Debunking_Wine_Myths

Thanks for the clarification... My question was induced by the winetricks installation I tried from the script available on the site https://code.google.com/p/winetricks: I got the message wineserver not found. And looking in the script itself it was when a wineserver library was looked at in a /usr/lib* folder.

okay, i think that you are having a problem your wine engine. in wineskin winery.app delete your installed engine and try to download it again. or it could be an issue with Xcode, in which case you should uninstall/reinstall it. if this still doesn't fix things, you should try XQuartz. i have this on my system, and it could be making the difference. however, i've managed to build this installation on machines that only have Xcode installed.

XCode is working as expected (I am a developer and therefore use it routinely; the very last version is currently installed). Xquartz is also installed on both my computers.

I can try what you suggest, but I have done many times now the trick of removing/reinstalling from scratch (after removing the adequate folders in Library/Cache and Library/Application\ Support.


was?!?! working...

As I said in my very first post, I have a complete DVD and a vanilla CD ROM. The vanilla CD-rom ran as expected when I choose Install Software (the only problem with it is that I can't use the program as there is a problem with CD detection, but I didn't dig it as my goal is to use the DVD with Beyind the Sword).

The DVD on the other hand never worked past the Install Software step.

Thanks anew for your help!
 

sgi

Chieftain
Joined
May 28, 2013
Messages
6
I've finally managed to make it work. The recipe: I have installed it completely on a Windows computer and have copied the folder on an external hard drive. I have then chosen the option "Copy a folder" inside Wineskin, and it works perfectly well.

I guess the problem was somehow related to my optical drive: I have a late 2012 iMac, which doesn't provide a native optical drive. I have an external one, but maybe Wineskin can't cope with it (in the setup it was always indicated as "Network share"instead iof CD-ROM, and I couldn't modify it. If I deleted it and create a new one with CD-ROM it was taken into account but another "Network share" to the DVD path was nevertheless recreated.

Another note for those using a recent Mac (with Ivy bridge chipset specifically): it seems Wine can't cope well with it until 1,5.9 (there is for instance a message about a CPU performance problem for the sound -see for instance https://discussions.apple.com/thread/4072881?start=0&tstart=0)

So on my installation I have asked a very recent Wine library and it works quite well (the 1.5.27 - I've also had problems with 1.5.28 and 1.5.29).

I hope it might help someone else.

Thanks again for your help, z0wb13.

Best regards!
 

z0wb13

undead
Joined
Feb 9, 2009
Messages
657
I guess the problem was somehow related to my optical drive: I have a late 2012 iMac, which doesn't provide a native optical drive. I have an external one, but maybe Wineskin can't cope with it (in the setup it was always indicated as "Network share"instead of CD-ROM, and I couldn't modify it. If I deleted it and create a new one with CD-ROM it was taken into account but another "Network share" to the DVD path was nevertheless recreated.

i tried this, and ran into the same problem you had at first. your solution works great, but there are two other ways to do this. the easiest is to make a .dmg file with disk utility and then copy it onto the computer without a drive.

the other way is to get wine to "see" your remote disc. this is how i did it:

0. put your disc into the old computer, then go to the new computer.
1. use Finder to mount the DVD as a remote disc. make sure it shows up on your desktop (or mounts, whatever)
2. double-click the wineskin.app inside the wrapper, and then go to wineskin advanced menu.
3. go to Tools, then Config Utility, then click on the Drives tab.
4. click auto-detect, apply, then OK.
5. wine should be able to see your DVD and installation should proceed normally.

note that this was tried using a 20-inch Mid 2007 and a 21.5-inch Late 2012 iMac, both running 10.8.4 mountain lion. it works. disc images also work.

also, the approach you took (installing on windows, then copying the entire directory into a wrapper) is a perfectly acceptable alternative. but if you don't have a windows machine, you can still make it work with only macs.
 

Alphadj

Chieftain
Joined
Jul 21, 2013
Messages
1
Hi guys,
thanks for this guide, very helpful. Btw, I have a big problem at the 5th step, when I select "setup.exe" everything goes wrong:







This is what I've done: downloaded the file "civ4wrapper.dmg" -> application folder -> clicked "advanced" and then "install software" -> "Choose Setup Executable" -> "setup.exe".

Have I done something wrong?

Thanks for your help ;)
 

Mr. Sulu

Liberal Democrat
Joined
May 3, 2011
Messages
193
Okay, so I followed the steps, but by Step 5 I ran into problems. I first set up my executable, which I am pretty sure is correct. But, I was confused by Step 6, as I couldn't figure out how to update the game. But, I also could not find the files that the executable pointed to, I looked through my Mac but while there was a file named Program Files, I could not find a file named 2K Games, and couldn't find any files after. But, the weird thing is that my civ4bts319 app, when I press it actually loads the game in windows, but I can't find the files for that either. So, right now I can't find my files and that I fear I might have botched the download somewhere. Then, when I tried to do a test run through Wineskin Advanced it gave me two logs, and one of them said

fixme:ntdll:server_ioctl_file Unsupported ioctl 24000 (device=2 access=1 func=0 method=0)
fixme:msg:pack_message msg 14 (WM_ERASEBKGND) not supported yet
fixme:msg:pack_message msg 14 (WM_ERASEBKGND) not supported yet
Note: Those faces are supposed to be colons, I don't know what happened there

So, any help you could give me is appreciated greatly
 
Top Bottom