View Full Version : Interface Issues after BUG Install


ruff_hi
Apr 17, 2008, 07:59 AM
There are a bunch of threads (http://forums.civfanatics.com/showthread.php?t=157088&page=9) dealing with interface issues (ie no interface) following a BUG install. The problem is that BUG cannot find its ini file and so everything gets screwed up. Why can't BUG find the ini file - sometimes it is missing registry entries, other times it is because the user has an unusual install location (my progs on C drive, my docs on D drive).

There is an active BUG report on our SF acct (here (https://sourceforge.net/tracker/index.php?func=detail&aid=1928716&group_id=202755&atid=982854)) that also includes some back and forth.

Do we have a solution for this? Or will our users keep on having these problems?

ruff_hi
Apr 17, 2008, 08:02 AM
I think that we should include some error handling code so that if the ini file isn't found, it pops up a dialog box telling the user that it cannot find the ini file. It should probably list the paths where it tried to find it too - helpful for debugging purposes.

As a final fall back position - we could include a file (CvBUGPaths.py) that contains variables that the user edits, then the 'get ini file' file can use that information as a last resort.

Not perfect - but at least it will let the user have control over this error without having to dig through all of the 'get ini file' code.

EmperorFool
Apr 17, 2008, 07:17 PM
Those are brilliant suggestions. I'll take a look at the code to see how the error occurs and ways to provide better info to the user.

Bleys
Apr 19, 2008, 10:17 PM
There are a bunch of threads (http://forums.civfanatics.com/showthread.php?t=157088&page=9) dealing with interface issues (ie no interface) following a BUG install. The problem is that BUG cannot find its ini file and so everything gets screwed up. Why can't BUG find the ini file - sometimes it is missing registry entries, other times it is because the user has an unusual install location (my progs on C drive, my docs on D drive).

There is an active BUG report on our SF acct (here (https://sourceforge.net/tracker/index.php?func=detail&aid=1928716&group_id=202755&atid=982854)) that also includes some back and forth.

Do we have a solution for this? Or will our users keep on having these problems?
Sorry if this isnt the correct place to ask this question, but I am trying to install the BUG mod and having all kinds of problems. Basically, no interface at all. I have Civ IV: Complete, and it installs the game in "C:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Civ4BeyondSword.exe", and then additional information is in "C:\Documents and Settings\Owner\My Documents\My Games\Beyond the Sword".

Both places have a MODs folder. Where should I be installing BUG? I have tried all sorts of things, but I keep ending up with no interface whatsover when the game starts, and no ability to get into Options, neither the in-game menu nor CTL-ALT-O.

I want to install a version of BUG that will allow me to play SGs without everyone else having to load the MOD. I also want to be able to run the HoF MOD when necessary as well, for BotM's and Gauntlet entries and such. Is that possible?

I am not computer illiterate, but I am no expert either. I have searched the forums for an answer to the no-interface thing, but I didnt look all that hard, was overly frustrated from other computer problems as well as this MOD. Please help me, the HoF mod installs and plays fine. I have had to uninstall and reinstall Civ IV a couple times now, and still the same problem. Any help would be appreciated.

alerum68
Apr 19, 2008, 10:58 PM
BUG Mod and HoF mod can't be loaded together. Currently BUG should be instealled in your Documents and Settings folder. If you run the installer it should install it in the proper directory. try backing up your current customassets folder in your documents folder, then run the installer and see what happens.

EmperorFool
Apr 19, 2008, 11:17 PM
@Bleys - How did you install BUG, the .exe installer or manually? And your other mods (like HoF), are they stored in a "mods" folder or in CustomAssets? Specifically, does the CustomAssets folder in your "My Games\BtS" folder have any .py files?

To do what you want, BUG should be installed in either "mods" directory, preferably the one in "My Docs" I think. Similar problems to yours involving Civ Complete were a result of it using different reg keys. We fixed those, so I suspect rather that two mods are clashing.

The installed folder should look like this:


My Games\
Beyond the Sword\
Mods\
BUG Mod\
BUG Mod.ini
Assets\
Artwork\ Python\ Res\ XML\
CustomDomAdv\
CustomDomAdv.txt

Make sure it's "Assets" and not "CustomAssets". If it's the latter, rename it.

To help us determine the problem, please do the following.


Open CivilizationIV.ini in your "My Games\BtS" folder.
Set the "LoggingEnabled" option to "1" and save the file.

; Enable the logging system
LoggingEnabled = 1

Launch the game, admire the missing interface (my apologies for the inconvenience), and exit the game.
Post the contents of the "PythonErr.log" file -- not "PythonErr2.log" -- located in the "logs" directory where you found the .ini file.

Bleys
Apr 19, 2008, 11:28 PM
Well, I installed it directly into the My Docs\My Games\BTS folder, so I could use it for SG games. I renamed my CustomAssets folder to CustomAssetsOld.

I also found the posts about editing the registry, and that seems to have mostly fixed it as far as I can tell. The interface is back on, just by adding that INSTALLDIR line to my registry. However, the Options screen accessed by CTRL-ALT-O is on and wont exit. I seem to recall seeing some posts about that as well.

It seems some of the issues with Complete are still there, unless I downloaded the wrong installer. I used the .EXE installed, not the ZIP. I did not install it as a separate MOD in the MODs folder, should I?

Edited note: I do not have the HoF mod or Blue Marble loaded with the current install of Civ IV Complete I am using right now. Just trying to get the BUG Mod working first.

Bleys
Apr 20, 2008, 12:25 AM
OK I think I have it. I used C:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword as the INSTALLDIR line, and the BUG Mod.ini is in C:\Documents and Settings\Owner\My Documents\My Games\Beyond the Sword. I think its working properly now. I will let you know if I have any other problems.

I do still wish to know if I have messed up my ability to play HoF games, since I did not install BUG as its own MOD, I installed it directly over the standard game (for SG purposes, thats how you do it, so others in your SG dont need to have the BUG mod to play my saves, and vice-versa?)

I also installed Bhruics patch, which I already know is not compatible with the HoF MOD, but I have been swapping the DLLs in and out for my SGs.

Now, before I even install the HoF MOD at all, I am going to re-install Blue Marble, and hope that works as well. Thanks for the quick redponse to my post, BTW, I was actually still looking for a solution when I posted the question, with the intention of editing it if I found an answer. You guys were too quick though! The people on these boards never cease to amaze me with their helpfulness.

EmperorFool
Apr 20, 2008, 02:51 AM
Glad you figured it out (the reg key and the .ini file). I thought we had the reg key issue with Civ Complete nailed down, but I have been away from the project for several months. I guess that was just creative misremembering on my part. ;)

I'm sorry, you are correct about putting it into the CustomAssets folder to work with SG games. My bad. I was thinking it would interfere with HoF, which it may still.

When you install BlueMarble (I haven't used it since starting the BUG Mod to avoid conflicts), it puts its art files in the CustomAssets folder if I remember correctly. If you can see the BlueMarble textures when you play the HoF mod, then I expect BUG to conflict with HoF. The reason is that HoF and BUG modify some of the same files.

In that case, you could start your HoF games with the "Lock Modified Assets" option checked. Maybe the HoF crew does that automatically -- I only played one HoF game so far. Actually, since they give you the save file, you have no chance to do that, so hopefully they do and the option is saved in the file.

After working that through, I realize that you should be able to answer the question easily. When you play HoF games, do you see BlueMarble textures? If not, BUG should not conflict with HoF. If so, they may conflict. Sorry I can't give you an absolute answer. You may just have to try it out. Even so, if there is a conflict, you can use Ruff's CustomAssets switcher program.

Edit: If you don't mind, could you possibly post the reg keys that Civ Complete did create, if any? Thanks in advance!

Amra
Apr 20, 2008, 05:05 AM
Out of curiosity, have you guys ever tried changing the CvPath file as described here?

http://forums.civfanatics.com/showthread.php?p=6722256#post6722256

EmperorFool
Apr 20, 2008, 05:16 AM
Yes Amra, that's what we originally did to handle Civ 4 Complete. Now I remember. Here's the code:


subkey = r"Software\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword"
dir = __getRegValue(_winreg.HKEY_LOCAL_MACHINE, subkey, "INSTALLDIR")
if (not dir):
subkey = r"Software\Firaxis Games\Sid Meier's Civilization 4 Complete"
dir = __getRegValue(_winreg.HKEY_LOCAL_MACHINE, subkey, "INSTALLDIR")

This solved the problem for someone at the time, but we tried a few things. Perhaps the person with the problem (yes I'm being lazy and avoiding searching for the post) may have added a reg key as that seems familiar. That's why I asked for Bleys's registry keys.

Ruff's idea of actually displaying the reg keys and/or paths being searched when a problem arises at game launch is a great one. It's on my list. :)

Edit: Now that I think of it, the install directory should only be necessary if the .ini file cannot be found in "My Games\BtS". Hmm, looking at the code I see that it doesn't check the mods directories. Wow, I just need to rewrite that entire module and be done with it.

ruff_hi
Apr 20, 2008, 05:24 AM
I (obviously) play with BUG. I also play HOF games. Further, I use BlueMarble. Here is my set up ...

HOF as a MOD under the 'my progs' Civ4 directory - need to run the game as a MOD within the game with 'Lock Modified Assets' to get your games accepted BUG in customassets under the 'my docs' Civ4 directory Blue Marble in customassets (the same customassets for BUG!!!) under the 'my docs' Civ4 directory - it does not conflict with BUG If you have the BUG version of your customassets active, BUG will be loaded if you have not checked 'Lock Modified Assets' and it will not interfere with others playing without BUG (in-game log bug aside) If you want to play with Blue Marble under the HOF mod, then create a customassets-HOF directory under the 'my docs' Civ4 directory, install Blue Marble there and swap it in or out depending if you are playing HOF games or not (it does load, even if 'Lock Modified Assets' is checked)

EmperorFool
Apr 20, 2008, 07:20 AM
This makes me believe that checking "Lock Modified Assets" only ignores some of the CustomAssets subdirectories -- probably Python and XML. That bodes very well for BUG.

Your synopsis above would make a great beginning to an entry in a FAQ as I'm sure many people want to run BUG and play HoF games, but may be afraid to install BUG. BlueMarble as well.

BTW, where do you check "LMA" when you are using a HoF save game? When you start a new game, it's an option. But when someone starts the game for you, do you have to set it somewhere else as well? I see our .ini has this entry:


# Custom XML and Python from user folder are not loaded
NoCustomAssets = 0

That clearly only takes effect when playing BUG as a mod (otherwise Civ never sees the setting). I assume the HoF mod .ini has the same entry. Is that all it takes? Since there's a setting when starting a new game, I suspect it gets stored in the save file and overrides any other setting.

Also, given your description, it seems you could install both BlueMarble and BUG into your CustomAssets folder and still use HoF just fine. As you said, it will ignore the Python and XML (from BUG) and only use the art from BM. It sounds to me like this is what you do, but your last item mentioned swapping CA folders so I wasn't sure.

ruff_hi
Apr 20, 2008, 08:31 AM
This makes me believe that checking "Lock Modified Assets" only ignores some of the CustomAssets subdirectories -- probably Python and XML. That bodes very well for BUG.

...

Also, given your description, it seems you could install both BlueMarble and BUG into your CustomAssets folder and still use HoF just fine. As you said, it will ignore the Python and XML (from BUG) and only use the art from BM. It sounds to me like this is what you do, but your last item mentioned swapping CA folders so I wasn't sure.Typically, HOF games are single player games and saves aren't shared. You HAVE TO CHECK locked assets if you want your HOF game accepted. The locked assets is stored as part of the game settings in the save. I hadn't noticed that MB was coming thru (well, I had - but I hadn't put it together), thus implying that locked assets only excludes some files in the customassets folder.

My last item is redundant.

EmperorFool
Apr 20, 2008, 09:14 AM
Typically, HOF games are single player games and saves aren't shared. You HAVE TO CHECK locked assets if you want your HOF game accepted.

For the one HoF game I played (though I looked at a couple previous ones that worked the same way), we were given initial save files to use. We didn't generate our own map. Do other ones tell you only the settings but let you generate your own map? Seems like you couldn't compare games or scores that way.

Oh ya, I played two games. My one and only Immortal game was a HoF game, and I did pretty well. They tweaked the map slightly (as they usually do apparently) to make your starting position more defensible, but the real key was playing extra carefully and taking fewer chances. It was a good learning experience to be sure. I'll have to play another one soon. :)

The other one I played was with Ragnar, and I screwed myself early on with stupid city positions and being beat to the only sources of Iron nearby by two turns. I got trounced pretty hard by Capac's exceedingly superior navy and bailed on the game.

Bleys
Apr 20, 2008, 09:30 AM
I am actually not interested in playing random HoF games for the various gauntlets and such, the games I like to play are the "BTS Game of the Month", known as BotMs. They are saves created by the HoF moderators that each player downloads and must be played with the HoF MOD and according to HoF rules in order to be entered.

Thats a minor thing though, my main goal is a MOD that I can use in SGs, because a group of us are trying a new kind of SG, a "Best Ball Scramble" SG, where each player plays a round, then there is a discussion about which is the "best" save, and each player then plays the next round, but from the "Best Ball" position. If you have ever played in a Golf Scramble tournament, then you know what I mean. So I needed a MOD that could play saves and that others could play from my saves as well.

It got late last night, so I didnt do much more than get ready to try loading Blue Marble, play some to ensure its working, then load the HoF MOD, and try playing one of the previous BOTMs to see how BM and BUG are handled. I am confident I can get it all running accurately and smoothly, especially now that I see ruff_hi has a similar set-up.

Regarding my registry, I can post my data, but I will tell you now that I found the same thing that others found, Complete does not have entries for the individual expansions as "INSTALLDIR". They dont exist at all. I wonder if there is a way to install Complete to be certain that no registry editing is needed, but I dont see it. I have no programming skill whatsoever, and I am not all that comfortable editing my registry. The posts that I found outlined the procedure in enough detail though, so I was confident I could handle adding a single line to a single entry.

EmperorFool
Apr 20, 2008, 09:39 AM
That's right; the HoF games I played were Warlords GotMs; thanks for the reminder. You should have no trouble there as Ruff has pointed out.

The tricky part with the SGs is that there is still this really random but nasty bug where non-BUG users experience a crash when they open the in-game event log window (ctrl-tab) for a save game from a BUG user. Ruff thought he narrowed it down the SimCutie's Extended Color Table and backed out the changes, but he's seen it happen again since with a saved game from the new release of BUG. :(

Ruff, when it happens with a particular save file, is it consistent with that save? Or can you restart Civ, reload the file, and open the event log without crashing? Crashing sucks to be sure, but if you can get by it by restarting, it might be livable for now. If it kills that game for all non-BUG players, it sucks much more.

The trick with Civ Complete is that BUG needs to find its .ini file. Someone suggested earlier that we fall back to a file containing a string pointing to the location; the idea being that users will be more comfortable editing a text file than their registry.

alerum68
Apr 20, 2008, 09:43 AM
Speaking of the HoF mod, and our own... I haven't played a HoF or GOTM since C3C... what mods do they contain that we don't? Also, I have avoided it for the simple fact that I didn't want to modify the registry, but with the installer I have, I'm pretty sure I can edit the users registry to ensure that correct path is there, but haven't wanted to play around with users registries. What do you guys think about doing that?

EmperorFool
Apr 20, 2008, 09:54 AM
I'm pretty sure I can edit the users registry to ensure that correct path is there, but haven't wanted to play around with users registries. What do you guys think about doing that?

The problem is that I wouldn't know what to put into their registry. You'd have to search the user's hard drive for the Civ executable, or look in "My Documents\My Games" for "Beyond the Sword" or "Civilization 4 Complete". Actually, that could be done in the game easily.

The problem occurs if they installed BUG (as mod or CustomAssets) inside their install directory rather than in "My Games". In that case, they need to tell us where it's located if the registry does not. Can you do a "Please locate civ.exe" thing in the installer?

Another option is to provide a .reg file containing the InstallDir key. Registry files are simple text files that you can edit with Notepad to change the value and then double-click to have it put into your registry. It's less ideal and more error prone, but it is fairly straight-forward.

alerum68
Apr 20, 2008, 09:59 AM
I haven't looked yet, but I'll see what I can do about locating another Installer. I've been thinking about switching over to NSIS scripts, and I know they are powerful enough to do this, just seem like a PITA to learn, when I have Clickster already set up perfectly. Anyway, I'll play around with Clickster and see what I can do.

XP still uses .REG files? I haven't had to run one of those since... 3.11 I think.:p

EmperorFool
Apr 20, 2008, 10:09 AM
I wouldn't waste too much effort on a new installer unless you really think it's needed. I'm hopeful we can resolve this issue satisfactorily by sacrificing a goat or something simple like that.

Another simple option is to put it in "My Documents\My Games" directly, outside "Bts" or "Civ 4 Complete" rather than in it. This way we never need to know what version of the game they installed. I assume the installer can do that easily enough (put just the .ini file there).


My Documents
My Games
BUG Mod
BUG Mod.ini
The BUG Mod Help.chm
GNU Public License.rtf
CustDomAdv
Beyond the Sword / Civ 4 Complete
CustomAssets

Actually, I kinda like that idea.

Wait a minute . . . where does the installer put the files itself? How does it know the name of the folder??

Bleys
Apr 20, 2008, 10:12 AM
The tricky part with the SGs is that there is still this really random but nasty bug where non-BUG users experience a crash when they open the in-game event log window (ctrl-tab) for a save game from a BUG user. Ruff thought he narrowed it down the SimCutie's Extended Color Table and backed out the changes, but he's seen it happen again since with a saved game from the new release of BUG. :(
Currently, at least 3 of our group of 5 use the BUG mod, including myself (now, thanks again for this awesome tool). I am going to push the others to use it as well, to eliminate any potential conflicts, but there is a catch. We are planning to play these new-fangled SGs on the Strats and Tips forum, and even have "Guest Players" join the fun for future games or even rounds. I would hate to crash them, but I suppose a warning about checking the events log may be enough.

Speaking of the HoF mod, and our own... I haven't played a HoF or GOTM since C3C... what mods do they contain that we don't?
MODs included in the HoF package can be found here. (http://hof.civfanatics.net/civ4/mod.php#credits) It is also not compatible with Bhruics patch . . . sort of. The HoF mod WILL run with or without the patch installed, but games saved by players with the patch cannot be loaded by those who do not have the patch installed, and vice-versa. There is an assets error message and the game crashes to desktop. I discovered this when I first went to use the MOD. I had the patch installed, and was able to play with the MOD normally for non-GOTM games, but I could not load any of the BOTM saves, nor could I load HoF games that others had submitted to "check them out" (something thats pretty cool to do, those guys play some crazy styles, and use Map-Finder for insane starts, etc). Unloading Bhruic patch was all it took to be able to open both the GOTMs and the games uploaded by other players, but the minute I did that, I could no longer load my own previous saves created when the patch was installed.

Hope that made sense, LOL.

alerum68
Apr 20, 2008, 10:15 AM
The installer now simply users #MyDocuments#\My Games\Beyond The Sword to locate the directory. It doesn't currently pull anything from the actual registry. The options are to define the install directory, pull it from the registry, or from an .ini file.

Looked at the MODs in the HoF... seems like we have everything they have, plus a few goodies. One thing I like is the russian translations! wish we could get some more translations done.:p

alerum68
Apr 20, 2008, 10:22 AM
Wait a second... they said they found a fix for Civ4 Complete!!!

ruff_hi
Apr 20, 2008, 10:24 AM
interesting comments ...

1) the scramble game has been played a number of times. Search for 'concurrent SGs". I started one (http://forums.civfanatics.com/showthread.php?t=163415) and others have also played them.

2) the in-game log error is always there. It isn't a random event. Open a game with vanilla BtS that someone has used BUG for and hit Ctrl-Tab - bang!

3) HOF mod contains pretty much what we contain except they haven't been expanded like we have (ie alerts). They do have some additional features (map finder, zoom) that are linked to the DLL.

4) As long as we can find the my docs directory, we could just put the ini file there and be done with it. Getting sick of trying to find everyone's my docs/civ4 directory. Edit: EFool had the same idea - I support that!

alerum68
Apr 20, 2008, 10:33 AM
alright, so you want to put the bugmod.ini file inside the root documents folder?

Also, I can make one installer that has different versions that can be installed from 1 file... It's set up so you have a registered and shareware version, but I'm sure it can be modified to have a standard BTS install and a CIV4 Complete install.

Bleys
Apr 20, 2008, 10:33 AM
I wouldn't waste too much effort on a new installer unless you really think it's needed. I'm hopeful we can resolve this issue satisfactorily by sacrificing a goat or something simple like that.

Another simple option is to put it in "My Documents\My Games" directly, outside "Bts" or "Civ 4 Complete" rather than in it. This way we never need to know what version of the game they installed. I assume the installer can do that easily enough (put just the .ini file there).


My Documents
My Games
BUG Mod
BUG Mod.ini
The BUG Mod Help.chm
GNU Public License.rtf
CustDomAdv
Beyond the Sword / Civ 4 Complete
CustomAssets

Actually, I kinda like that idea.

Wait a minute . . . where does the installer put the files itself? How does it know the name of the folder??
The installer defaults to My Docs\My Games\Beyond the Sword folder.

The My Docs\My Games folder has a folder for each expansion, so there is a My Docs\My Games\Beyond the Sword folder,
a My Docs\My Games\Warlords folder,
AND a My Docs\My Games\Sid Meier's Civilization 4 Complete folder.

The game files themselves are in C:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete,

but the expansions are in subfolders of that folder, like this:

C:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword
C:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Warlords

Does that make a difference? There are no BTS or Warlord folders in the My Docs\My Games\Sid Meier's Civilization 4 Complete folder, in fact, I am now wondering if BM or Civ Scale stuck some of these folders in themselves. I do know that when I went to load Blue Marble and Civ Scale I had to tell them where the installation of the Civilization4.exe file was, it did not "find" it on my system.

Hope some of this info helps, and doesnt confuse, since I am pretty clueless about a lot of this stuff. I could get DOOM deathmatches to run on 2400 baud Modems on a 386sx back in the day though! Ah those were the days, 4 MBs of RAM was a LOT, LOL.

EmperorFool
Apr 20, 2008, 11:03 AM
That was very helpful, Bleys. The directory structure installed using the non-complete versions of Civ4 are exactly the same, except in place of "Sid Meier's Civilization 4 Complete" you see "Sid Meier's Civilization 4" (I think, I installed to "C:\Games\Civ4" cuz that's just how I roll. :P

Since BUG only works with BtS, we could insist that it gets installed in "My Docs\My Games\Beyond the Sword" . . . either as "CustomAssets" or "Mods\BUG Mod". We can do as we do now and keep the .ini and other files inside the BtS folder.

Why were we having such problems with CivComplete? I do remember that initially we wanted the mod to find the .ini file whether it was in the install or "My Docs" folders and as either CustomAssets or a mod -- being too flexible I think. Is there any reason not to limit it to "My Docs" at least? Whether or not we have an option to install it in the mods subfolder is a side issue, but probably a nice thing to do.

Does anyone see any problems with this?

If not, should we go with it or switch to the new outside-the-BtS-folder option Ruff and I just suggested? It would still be inside a folder inside "My Games" -- separate from BtS but not in your face in "My Docs". I see no technical reason to do it; it's mostly Aesthetics (leads to Literature, Drama).

alerum68
Apr 20, 2008, 11:10 AM
Alrighty then... I'm thinking of something here, and want to see what you guys think....

The installer will allow you to have different install versions, (Minimum, Normal, and Full), and those versions can be named whatever you want.

What I'm thinking if have 1 version that is normal BTS BUG. Version 2 will be Civ Complete BUG. Version 3 will be BTS BAT. Version 4 will be Civ Complete BAT.

One installer, ~100kb.

We just have the user download the files needed after the install program is run. The question I have though is where will we store the files? Can we allow direct access to the SVN? Should we have it so the user will download the current SVN build, regardless of it's current working status, or create a secondary directory containing just the current working version...

If not, the option should still work for 2 installers, without downloading. One for BUG that has BTS version and Civ Complete Version, and 1 for BAT.

Suggestions or ideas guys?

edit: Alright I just need to know where we need to install this for Civ4 Complete, that will allow it to work, and if any registry keys need to be changed. If they do need to be changed, what values work?

EmperorFool
Apr 20, 2008, 11:42 AM
I have come to the conclusion that we can ignore Civ 4 Complete entirely. We should install all files into "My Docs\My Games\Beyond the Sword" (see my previous post).

As for merging the BUG and BAT installs, I am still against it. No sense making someone download BAT if they only want BUG given that BAT is huge and BUG is tiny. Is that still the case?

I don't quite understand your idea about downloading from SVN. The user would download a minimal install program that contains no BUG/BAT files -- just an .exe installer? And then the installer would grab the install files from SVN?

That should be possible, but I would rather not force users to use the bleeding edge. It makes committing to SVN require more safety checks. I much prefer being able to put up minimally-tested code on SVN so others can try it out if they want. SVN access is just HTTP, BTW, so there's no reason we couldn't store the released versions elsewhere (not in SVN please).

But I think we're over-complicating it. The installer should be pretty straight-forward: the user choose to install as CustomAssets or a mod. No need to worry whether or not they have the Complete version. No registry entries are required.

alerum68
Apr 20, 2008, 11:51 AM
actually they can't download from the .svn. I'd have to compile a .bin file.

Just so I got it all right on the dirs... put all "support" files in a My Games\BUG Mod folder. What about the UnitNaming.ini? Shouldn't that be moved to the BUG Mod folder, instead of BTS?

Bleys
Apr 20, 2008, 12:01 PM
Why were we having such problems with CivComplete? I do remember that initially we wanted the mod to find the .ini file whether it was in the install or "My Docs" folders and as either CustomAssets or a mod -- being too flexible I think. Is there any reason not to limit it to "My Docs" at least? Whether or not we have an option to install it in the mods subfolder is a side issue, but probably a nice thing to do.
I think the problem with Complete is in the registry. It does not place a separate entry for "INSTALLDIR=C:\Documents and Settings\Owner\My Documents\My Games\Beyond the Sword\". Manually adding that line in the HKEY_LOCAL_MACHINE\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword solved all my problems.

Your idea of an install into the My Games folder directly, instead of the sub-folder of My Documents\My Games\Beyond the Sword\ may work, I have no clue.

Heh, I am actually enjoying helping you guys figure this out, so if you have any questions, please ask them. I am getting more and more confident that I actually may have some data that will help you get to the bottom of this.

I do know that Civ IV:Complete is still not widely being used, because its not available over-the-counter in the USA yet. I ordered my copy from an importer named GoGamer, who got the version being sold in England, so the only issue I have seen with it is in the spelling of some words (colour and such). I never purchased a copy of Vanilla, in fact I only started playing Vanilla in November of 07 through a game simulator service called GameTap. After realizing I had likely found something to keep my interest for many many months, I looked for the Complete version, which was only available in Europe at the time. Eventually I was nudged toward GoGamer, and got Complete the last week of January, 08.
.
I am guessing that when Complete releases in the states, you may find that more people will be running into this problem.

alerum68
Apr 20, 2008, 12:11 PM
Would you mind testing the installer for me when we get it all set up Bleys? Will post it here and let you give it a shot to see if it works.

Bleys
Apr 20, 2008, 12:30 PM
Sure, no problem. Should I uninstall everything first? I have already installed Complete, BUG, BM, and CivScale, as well as editing my registry.

Actually, I can try to install it on my Laptop, which only has Complete and HoF on it, no BM, no Civ Scale. I will check its registry to be sure it also has the same lack of INSTALLDIR that the machine I have been having trouble has.

EmperorFool
Apr 20, 2008, 12:32 PM
I'm leaning toward adding a "BUG Mod" folder to hold the INI and help files. It would be a sibling of the "Docs\Games\BtS" folder. This way all the files that get modified when changing settings will live outside BtS. If they need to reinstall BtS for whatever reason, it would be easier for them recover. Could the installer be set up not to overwrite files in the "BUG Mod" folder -- only those in CustomAssets?

Of course, when it's installed as a mod, it makes more sense to put everything in that one mod folder. Wow, I'm really indecisive today. :confused:

I will look at the code to make sure we can remove all references to the registry. The only reason for it was to locate the actual program installation directory where the EXE and Assets are stored, but we don't need to store anything there, so we should be able to ditch it. That would make the Civ Complete problem magically disappear.

alerum68
Apr 20, 2008, 12:53 PM
Here, take a look at this file. I made it so it will install the BUG Mod Folder, and then when you do Mods it will make 2 Bug MOD folders... on in Mods and one in MyGames. Do we run into the Civ Complete problem when the game is loaded from a Mod, or only from the CusAss directory? If not I can modify it so it will keep the support files with the Bug Mod folder within the Mods directory. I already have it set up now so the .INI files aren't overwritten if they are already there, and can make it so if we make changes to the INI we can have it overwrite again.

EmperorFool
Apr 20, 2008, 01:04 PM
I just mucked up CvPath to ignore the registry and only look for files in "My Games\BUG Mod" and it works fine. The files we access are


BUG Mod.ini
Adv Unit Naming.ini
CustomDomAdv\CustomDomAdv.txt
Autolog\ (created automatically by Autologger)
The first three should be installed by the installer. It should put them in "My Games\BUG Mod" in all cases (mod and CustomAssets install). KISS

I'll rewrite CvPath and trim the cruft later, but here's the minimally-tested version if anyone wants to play with it. Just replace the entirety of "CustomAssets\Python\Contrib\CvPath.py" with this:


## Copyright (c) 2006, Gillmer J. Derge.

## This file is part of Civilization IV Alerts mod.
##
## Civilization IV Alerts mod is free software; you can redistribute
## it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (at your option) any later version.
##
## Civilization IV Alerts mod is distributed in the hope that it will
## be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## See the GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Civilization IV Alerts mod; if not, write to the Free
## Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
## 02110-1301 USA

__version__ = "$Revision$"
# $Source$

"""Implements a collection of utility methods and variables for determining
the location of Civilization 4 components.

The following variables are exposed.

* activeModName: the name of the currently active mod or None if no mod has
been loaded.

NOTE: activeModName does not currently work in a completely automated
fashion. There does not appear to be a way to determine the active mod
programmatically from Python code. A mod that wishes to export its name
to this module must create a Python module called CvModName that contains
a string variable named modName set to the name of the mod. A sample
CvModName is shown below.

# CvModName.py
modName = "American Revolution"

Of course, a CvModName Python module should only be used if the mod is
indeed installed in the Mods directory, not when it is installed in
CustomAssets. Furthermore, if the value of the modName variable does not
correctly match the mod directory name, the path variables will not be
set properly.

* userDir: the user's Civilization 4 directory, typically
C:\Documents and Settings\User\My Documents\My Games\Sid Meier's Civilization 4

* userAssetsDir: <userDir>\CustomAssets

* userModsDir: <userDir>\Mods

* userActiveModDir: <userDir>\Mods\<activeModName>

* userActiveModAssetsDir: <userDir>\Mods\<activeModName>\Assets

* installDir: the Civilization 4 installation directory, typically
C:\Program Files\Firaxis Games\Sid Meier's Civilization 4

* installAssetsDir: <installDir>\Assets

* installModsDir: <installDir>\Mods

* installActiveModDir: <installDir>\Mods\<activeModName>

* installActiveModAssetsDir: <installDir>\Mods\<activeModName>\Assets

* assetsPath: a list containing all Assets directories that appear on the
game's load paths. Typically [userAssetsDir, installAssetsDir] or
[userActiveModAssetsDir, installActiveModAssetsDir, userAssetsDir, installAssetsDir]

* pythonPath: a list containing all directories that appear on the
game's Python load path. The game's Python module loader does not support
Python packages, so this list includes not only the Python subdirectory
of each element of the assetsPath but also all non-empty subdirectories.

"""


import os
import os.path
import sys

if (sys.platform == 'darwin'):
""" Mac OS X """
def _getUserDir():
return os.path.join(os.environ['HOME'], "Documents", "Civilization IV")

def _getInstallDir():
import commands
civ4name = "Civilization IV.app/Contents/MacOS/Civilization IV"
str = commands.getoutput("ps -xo 'command' | grep " + "'" + civ4name + "'")
m = str.find(civ4name)
if (m >= 0):
installDir = str[0:m]
return installDir
else:
import _winreg
""" Windows """
def __getRegValue(root, subkey, name):
key = _winreg.OpenKey(root, subkey)
try:
value = _winreg.QueryValueEx(key, name)
return value[0]
finally:
key.Close()

def _getUserDir():
myDocuments = __getRegValue(_winreg.HKEY_CURRENT_USER,
r"Software\Microsoft\Windows\CurrentVersion\Explorer \Shell Folders",
"Personal")
return os.path.join(myDocuments, "My Games")

def _getInstallDir():
subkey = r"Software\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword"
dir = __getRegValue(_winreg.HKEY_LOCAL_MACHINE, subkey, "INSTALLDIR")
if (not dir):
subkey = r"Software\Firaxis Games\Sid Meier's Civilization 4 Complete"
dir = __getRegValue(_winreg.HKEY_LOCAL_MACHINE, subkey, "INSTALLDIR")
return dir


activeModName = None
try:
import CvModName
activeModName = CvModName.modName
except:
pass

userDir = os.path.join(_getUserDir(), activeModName)

userAssetsDir = os.path.join(userDir, "CustomAssets")

userModsDir = os.path.join(userDir, "Mods")

userActiveModDir = None

userActiveModAssetsDir = None

installDir = _getInstallDir()

installAssetsDir = os.path.join(installDir, "Assets")

installModsDir = os.path.join(installDir, "Mods")

installActiveModDir = None

installActiveModAssetsDir = None

assetsPath = [userAssetsDir, installAssetsDir]

if (activeModName != None):
userActiveModDir = os.path.join(userModsDir, activeModName)
userActiveModAssetsDir = os.path.join(userActiveModDir, "Assets")
installActiveModDir = os.path.join(installModsDir, activeModName)
installActiveModAssetsDir = os.path.join(installActiveModDir, "Assets")
assetsPath.insert(0, userActiveModAssetsDir)
# YAUGM changes begin
# assetsPath.insert(1, installActiveModAssetsDir)
assetsPath.insert(2, installActiveModAssetsDir) # now goes after CustomAssets!
# YAUGM changes end

pythonPath = []
for dir in [os.path.join(d, "Python") for d in assetsPath]:
for root, subdirs, files in os.walk(dir):
if (len(files) > 0):
pythonPath.append(root)

# YAUGM changes begin

# Designed for GreatPersonMod, returns absolute path for
# a relative path to Assets dir if and only if fileName is
# found in the location specified.
# see _test() for example.
def getPath(relPath, fileName):
for filePath in [os.path.join(d, relPath) for d in assetsPath]:
if os.path.isfile(os.path.join(filePath, fileName)):
return filePath
return ""

# Designed for Ruff's Cobbled SG Modpack 1.2b, returns list
# of potential locations for the ini file. This is called by
# CvConfigParser.py. File locations are listed in reverse
# assetsPath order so that userDir\Mods overrides CustomAssets
# overrides installDir\MODS.
# Use like this: files = CvPath.getINIPathForCvConfigParser("RuffMod.ini")
# Note: CvConfigParser.py is no longer used in Ruff's Cobbled SG Modpack 2.0+,
# but this is still useful for many of TheLopez's mod components.
def getINIPathForCvConfigParser(fileName):
if (fileName != None):
filenames = [os.path.join(os.path.dirname(dir), fileName)
for dir in assetsPath]
filenames.reverse()
return filenames
return None

# Designed for Ruff's Cobbled SG Modpack 2.0.x(w), return the path
# to an ini file which should be located just outside one of the
# directories in the assets path. This is called from RuffModControl.py
def get_INI_File(szINIFileName):
return os.path.join(userDir, szINIFileName)

# YAUGM changes end

def _test():
print "activeModName = " + str(activeModName)
print "userDir = " + userDir
print "userAssetsDir = " + userAssetsDir
print "userModsDir = " + userModsDir
print "userActiveModDir = " + str(userActiveModDir)
print "userActiveModAssetsDir = " + str(userActiveModAssetsDir)
print "installDir = " + installDir
print "installAssetsDir = " + installAssetsDir
print "installModsDir = " + installModsDir
print "installActiveModDir = " + str(installActiveModDir)
print "installActiveModAssetsDir = " + str(installActiveModAssetsDir)
print "assetsPath = "
for dir in assetsPath:
print " " + dir
print "pythonPath = "
for dir in pythonPath:
print " " + dir

# YAUGM changes begin
print "greatPeopleArtPath = " + getPath("art\\GreatPeople", "Great Person.dds")
print "RuffMod.ini location: " + get_INI_File("RuffMod_2w.ini")
configFilePath = getINIPathForCvConfigParser("")
configFilePath.reverse()
print "configFilePath = "
for filePath in configFilePath:
print " " + filePath
# YAUGM changes end

if __name__ == "__main__":
_test()

Bleys
Apr 20, 2008, 04:07 PM
Here, take a look at this file.
Is this the one you want me to test, or did you want me to wait. I am not in a hurry to update my laptop with BUG, since I am only planning to use it for write-ups while my stronger desktop actually has the games. As my skill level has improved, so has the length of games, and complexity of the late-game positions, and my poor little 512 MB RAM laptop just chokes. Desktop has 2 gig, and a strong video card, so I am blasting through turns that were taking 3-7 minutes to process before.

So let me know when you feel like you have it solved for Complete, and I will run it. I know my laptop JUST has Complete + HoF.

BTW, you may be getting a few more fans, since a thread I started on another board is seeing a lot of action. I linked back to this thread so folks who run into the problem can resolve it. So far, I am REALLY enjoying this MOD, it would be well worth it even if I had to run is as an actual loaded MOD. Blue Marble is amazing too, its like playing a whole new game, heh.

alerum68
Apr 20, 2008, 05:26 PM
Let's wait for EF to finish the changes to CivPath.py, but once that is done, then yes, BUG should finally be 100% compatible. This installer will give you the option to install into the CA or MODs folder. Also, it has an uninstaller so if you decided you want to undo it, or it doesn't work, it'll be cake to uninstall.

Thanks for the plug in the other thread! Glad you're enjoying using it too... BTW - Whats the other thread?;)

alerum68
Apr 20, 2008, 08:39 PM
I commited your changed Path file after I tested it and got it working. Another perk of this: It will locate the INI file now, no matter if it's loaded from the CA or Mods directory... will make it much easier for Mod Makers to merge now as well.

I think I may have asked before, but anyone a WoT Fan?

alerum68
Apr 20, 2008, 08:49 PM
Here is what I believe to be a working copy of the the install creator, with updated to revision 623. Has the new MA, and the updated Path file, and lets you install it in the mods directory, or the CA directory. It will also install the new BUG Mod dir, but remember to .bak your other files, then delete them after.

So go ahead, and test this out!

alerum68
Apr 20, 2008, 09:46 PM
slight issue with this new way of doing the ini folder... not only does the Bug Mod.ini have to be in this folder, but so does all the mods .ini's. I tried running Bat Mod with the new format, and the result was CTDs until I copied a default copy of the Bat Mod.ini into the Bug Mod folder.... It may make it difficult for some mod makers to package this with a zip or rar file. Anyway we can make it just Bug specific, so it pulls the other .ini from their respective mod folder?

Other then that, it worked great, and seems to hold all values that I use in my default BUG game... is a good thing in my mind, because that means the settings for all Mods that use our settings will stay the same... no more need to spend forever getting your unit renaming right for each mod.;)

I just got a bad hint from the xml. Hint #3 showed the txt string... and umm... how am I going to package the .zip file myself? I don't know a way to make it extract to different paths for different files.

EmperorFool
Apr 20, 2008, 11:49 PM
That's why I am going to write our own trimmed-down version of CvPath. By modifying CvPath, it makes it harder for other mod authors (and our own BAT mod) to integrate BUG. Better to have our own new module (probably BugPath).

Our other option is to assume the folder inside "My Games" is called "Beyond the Sword". The registry is used to find that currently, and that's what is causing the problem -- the missing registry key. Assume the name, and we don't need to look at the registry.

I think I'm going to stick with the previous plan -- put everything into a "BUG Mod" folder. Other mods will continue to use CvPath to find their own .ini files (or use our method if they want).

alerum68
Apr 21, 2008, 12:09 AM
I like the Bug Mod folder option best myself, but like I said going to still be hard to package it in a zip file.

EmperorFool
Apr 21, 2008, 12:23 AM
Going to still be hard to package it in a zip file.

I didn't catch that earlier, but it's a good point. We have to assume the folder name "Beyond the Sword" either in code or in the ZIP. I'd say it's easier to have the user move an incorrectly-placed folder (a la the ZIP) rather than edit the registry or a Python file. So let's go with the separate "BUG Mod" folder.

alerum68
Apr 21, 2008, 12:24 AM
I can edit the registry from the installer.

EmperorFool
Apr 21, 2008, 12:34 AM
We'd still be assuming the name "Beyond the Sword", but worse we'd have to assume they have Civ Complete, or can the installer check for an existing registry key first?

Here's the logic:


If the key "...\Sid Meier's Civilization 4 Complete" (key A) exists and it contains an "INSTALLDIR" value
If the key "...\Sid Meier's Civilization 4 Complete - Beyond the Sword" (key B) exists but it doesn't contain an "INSTALLDIR" value
Copy key A's "INSTALLDIR" to key B, appending "\Beyond the Sword" to it.

We have to assume the name "Beyond the Sword" somewhere; there's no way around it. If you install using a different language, does it translate that name into the language? I expect not, but if it does, we need to address that.

alerum68
Apr 21, 2008, 12:43 AM
I can make an option so if they know they have Civ Complete they can run that version within the installer, and that will update the registry values. I thought it went to the My Docs\My Games\Beyond The Sword by default even for Civ Complete, so the only location we really need to add to the registry will be the new key to allow it to work in Civ Complete, which will not be a problem to let the User check which version they are running.

As for editing the Reg keys, I can find any root key, and the actual program key and subkey. I can change all the values, and also set it to not overwrite existing entries. Send me an IM on Yahoo real quick, and I'll show you what I can do with the program a bit easier.

BornSlippy
Apr 21, 2008, 08:37 AM
I read through this and now I'm so confused. I went to that link in the first post but that was more progamming stuff that I'm clueless about. I just want my interface fixed so I can use BUG/BAT...

So I downloaded BAT and installed it to my 'main' Civ4 folder, i.e. c:/games/civ4 etc. No dice - more to the point, no interface. I didn't even know about the existence of the other Civ4 folder in My Games before I read this thread. Then I installed it there. Now it seems to work on a couple of unit skins that have changed, but the interface is still missing.

I know I'm not giving you much to go on here, but as I said this thread has me really confused as to what's what and what you need. :)

This is where I put my second install:
C:\Documents and Settings\Larsen\Mine dokumenter\My Games\Beyond the Sword\MODS

Inside that folder there's a "BAT Mod" folder, plus the .ini files to both BAT and BUG which I put there.

The first install went here:
C:\Spill\Civilization 4 Complete\Beyond the Sword\Mods

Only mod folders here.


I'm sure I'm missing something obvious, so forgive me in advance for wasting your time. (Positive attitude, I know)

:)

Bleys
Apr 21, 2008, 09:32 AM
See this (http://forums.civfanatics.com/showthread.php?t=272338) thread for the current workaround. It involves editing your registry, but its pretty simple.

Check the CTRL-ALT-O options screen though, be sure you can exit it. You may have the string in the registry pointing to Program Files\2KGames and the actual MOD loaded in My Docs\My Games. If BUG cant find its INI file in Program Files\2KGames, you wont be able to close the options screen.

ruff_hi
Apr 21, 2008, 07:53 PM
Sorry if this isnt the correct place to ask this question, but I am trying to install the BUG mod and having all kinds of problems. Basically, no interface at all. I have Civ IV: Complete, and it installs the game in "C:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Civ4BeyondSword.exe", and then additional information is in "C:\Documents and Settings\Owner\My Documents\My Games\Beyond the Sword".Actually - the issue that you are having could be caused by installing a copy of Civ4 complete in the US. Its only legally on sale outside of the US which means that ...

Bleys
Apr 22, 2008, 09:11 AM
Actually - the issue that you are having could be caused by installing a copy of Civ4 complete in the US. Its only legally on sale outside of the US which means that ...
Well, I considered this, actually, I am not a person who supports software piracy in any way, shape or form, but I checked into the GoGamer site, and as far as I can tell, its perfectly legal for them to import copies and re-sell them within the US. I saw a lot of copies of Complete available on eBay and other auction sites from less-than-reputable suppliers, especially in Asia (Thailand, to be specific, seems to have a considerable piracy problem), and did not buy from them despite their low pricing. I even refused to accept the offer from an online friend who lives in Europe to buy it for me and mail it over, because I felt it wasnt proper. I have another friend who actually works at Microsoft who offered to pick me up a copy at the company store (2KGames is owned by MS) and I didnt accept because it felt "wrong". But GoGamer is legit, and I was assured by that same MS employee friend it was perfectly legal to buy my copy from them.

Back on topic, I am fairly convinced the issue lies in the installation of the game itself. If you install BTS through the "normal" method, starting with Vanilla, then adding Warlords, then adding BTS, each expansion will have its own INSTALLDIR line in the registry.

But Complete is considered a single install, and as such, only has a single INSTALLDIR registry entry. The individual expansions are all lumped into one, in fact, when you install Complete, you arent even given an option to install them separately, the only choice is "Install the entire game".

BUG's installer is written with the idea that each expansion has its own INSTALLDIR, and since thats not the case, the mod cannot find the proper files when checking for installations. Blue Marble has a similar problem, since it cannot find Civ IV when you first go to install it, you have to direct it to your .exe file manually.

EmperorFool
Apr 22, 2008, 07:16 PM
With the fixes I made earlier today (in SVN now), there is no dependency on the INSTALLDIR registry entry to locate the INI files. We still need to decide if we want the files to live in "My Games\BUG Mod" even when they install as a mod, but that won't change the fact that this bug has been put to bed. :)

A couple other random thoughts. Thailand and most of Asia have no copyright laws, and hence no copyright violation (a.k.a. piracy), but you probably would be breaking U.S. laws bringing the copy into the states. Having a friend buy a legal copy in Europe and mailing it to you, however, can't possibly be illegal or immoral. The law restricting U.S. distribution is merely a contract between the distributor and the retailers -- not a copyright law.

Regardless, I hope you paid full price for BUG and feel you got your money's worth. :lol:

alerum68
Apr 22, 2008, 10:07 PM
Awesome EF! I think the easiest way to manger the BUG Mod Dir is to have it reside in the My Docs\My Games\BTS folder. Bleys has confirmed that it makes a different My Docs folder for the game, and each expansion pack, so Civ Complete, and I'm assuming Civ Gold, will have this folder to put it into. It will still make it a PITA for a MOD maker to added, unless we did an if statement that would check first the Mod folder for the BUG Mod Directory, and if no located there will go to the root BTS directory. That should allow it to be installed in the CA or MODs directory.

And everyone pays for BUG... didn't they read the little bit I added to the GPL in the installer? At the end they agree to sell us their souls for use of the BUG Mod.:)

Bleys
Apr 23, 2008, 07:30 AM
The law restricting U.S. distribution is merely a contract between the distributor and the retailers -- not a copyright law.

Regardless, I hope you paid full price for BUG and feel you got your money's worth. :lol:
Thats exactly what my friend at MS said as well, and he said GoGamer was reputable, so it was a pretty good bet that their copies were obtained legally. Overall, it was only 5 bucks more from GoGamer than from my friend at MS with his company discount (I didnt accept his offer because he isnt supposed to do stuff like that for friends) so I jumped on the chance to buy Complete from a reputable source.

I was very happy at the price (slightly more than the Euro versions of Complete), and the product. And I am VERY pleased with this MOD, it saves me a LOT of trouble playing RPCs and such other games, not having to constantly take them into the WB to play as a Scenario with a MOD loaded. BUG has a lot more info than HoF as well. Price was solid too ;)

EmperorFool
Apr 23, 2008, 07:55 AM
I didnt accept his offer because he isnt supposed to do stuff like that for friends.

When I worked at Sony, the employee store actively encouraged you to bring in friends and family (it was in the name of the store) to buy stuff. :)

EmperorFool
Apr 23, 2008, 08:03 AM
See my latest thread (http://forums.civfanatics.com/showthread.php?t=272658) for the resolution to this annoying issue.