Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Setting up file associations for Civ4 BTS with Steam

I've got a Steam installation of Civ4 Beyond The Sword, so I don't need to worry about the DVD being exposed to environmental hazards such as young children.

One drawback of using Steam is that it doesn't set up proper file associations for .Civ4BeyondSwordSave files, so you cannot double-click on a saved game and automatically launch BTS to load it. Very annoying, and a quick search showed me that several others have had the same problem, without finding an immediate resolution.

Just associating the files with Civ4BeyondTheSword.exe, which is buried somewhere deep in the Steam folder, does NOT work. That just ends up launching the game without loading the savegame. An additional command-line argument is needed, and there's no easy way to specify that on Windows 7, as far as I can tell.

So just in case others are facing the same issue, here is how to solve this. (Who knows, maybe I'll draw some more traffic to twowayserf as well.)

Create a file in the same folder as your steam.exe file, typically C:\Program Files (x86)\Steam, called civ4bts.bat, and edit it using a program like notepad. The file is a batch script, and should read exactly as follows:

"%~dp0\steam.exe" -applaunch 8800 /fxsload=\"%1\"

Then right-click on a .Civ4BeyondSwordSave file in windows explorer, choose Open with->Choose default program... and navigate to civ4bts.bat, choosing that script as your default program. Now you'll have the normal behaviour, where double-clicking on a saved game launches BTS and loads the saved game.

(Disclaimer: Maybe there's a less clunky way to fix this, by modifying the registry or some such, but if so I haven't found it.)
If you know what I mean.
Reply

Wow, thanks zakalwe!

For anyone else doing this, the double quotes at either end of the text are genuinely part of the text that needs to be in the file.
Reply

Ah yes, very clever zak. thumbsup
Reply

It is pretty annoying that the Steam version doesn't create proper associations for the savegame files. It was possible to manually add them in Windows XP via Explorer, but in e.g. Vista and Win7 it needs to be done via registry (afaik).

I think I extracted the entries created by the DVD version from the registry myself after I "upgraded" the game to the Steam version a few years ago when it was on sale, or maybe I found them online somewhere (can't find much info on this anymore), but I'll attach the file here to this post. Perhaps it'll still be of some use to people and hopefully they can find it here.

Naturally, the pathnames may need to be changed to correspond to the actual Steam and Civ IV installation directories in case they differ from the default. Also, you may not need all entries if you'll only ever play BtS -- but for the sake of completeness the file includes all associations.

I've confirmed these working with Windows 7 SP1 (fully patched). Note, that the '/fxsload=\\\"%1\\\"' actually needs six backslashes so that the entry in registry will end up looking like: /fxsload=\"%1\" (first one escaping the second '\' and the 3rd escaping the quote mark). The funny thing is, that it actually used to work with just '/fxsload=\"%1\"' which means the entry in registry would look like: /fxsload="%1". At some point, when I ran new updates from Windows Update, double clicking the save file would only load the game to the main title screen, but not the save. Adding escapes to the quotation characters in the registry entry itself fixed that problem.


Attached Files
.txt   civ4_save-file_associations.txt (Size: 4.01 KB / Downloads: 12)
Reply

Hello, crewd. Looks like that was your first post. Welcome to the forums. smile
Reply

Has anyone tried this with Windows 8 and confirmed that it works?

In case that questions doesn't make it clear, I have Windows 8 and it doesn't work. It loads a command prompt window and it closes very fast so it's hard to catch but it says something about not working or able to read the batch file.
Reply

Open a normal command prompt (Search for "cmd") then navigate to the location of your civ4bts.bat, and then type in the name of the script (civ4bts.bat) to execute the batch script within your command window. That will mean that the window won't close when the script crashes and you can see the error message.

If you have trouble navigating to the location of your civ4bts.bat using the command line then you can find the location of the file using the normal folder navigation in Windows then SHIFT + right click there and choose the "Open Command Window here" option.
Reply

(October 14th, 2014, 16:51)dazedroyalty Wrote: Has anyone tried this with Windows 8 and confirmed that it works?

In case that questions doesn't make it clear, I have Windows 8 and it doesn't work. It loads a command prompt window and it closes very fast so it's hard to catch but it says something about not working or able to read the batch file.

I can confirm that this works in windows 8. A command prompt does come up and close quickly, but then it loads correctly.


Thanks Zak! Very useful smile
Erebus in the Balance - a FFH Modmod based around balancing and polishing FFH for streamlined competitive play.

Reply



Forum Jump: