HOF Mod and Vista compatiblity issue?

shyuhe

Deity
Joined
Nov 30, 2006
Messages
6,062
Location
Gone fishing for the summer
I'm not sure if this goes here or under tech support. I got a new computer recently that runs vista. I installed civ 4 and patched up through BTS 3.13. BTS 3.13 runs fine - I haven't encountered any problems. However, if I try to run Vanilla civ using the 1.74 HOF mod, I run into problems. When I try to edit the game options (either through in-game or through advanced -> options), I can't exit out of that screen. I click on exit but it doesn't register. I don't have this problem in BTS (I can change the options freely in BTS). Any ideas on what may be causing this problem? Thanks.
 
This a known access issue. I dug this up from the support thread:

That was the plan but I needed to know DaV's user set up before proceeding.

These insructions apply to Windows Vista.

For a single user machine the process is pretty straightforward as there is no need to implement file shares.

It goes like this

Right Click on the Firaxis Games directory in the C:\Program Files path and select the Properties option. In the first tab labeled "General" are two checkboxes at the bottom - one is labeled Read Only and should be greyed. Clear it so the check box is empty, then click the Apply button. A dialog box with two radio buttons will appear, select the all folders, all subfolders and all files button. Click okay and :coffee: and :smoke:

This will take a while as the machine processes all those files.

When that has finished in the same Properties dialog box click the security tab. In the scroll box labeled Group or user names you will find various names. Click on Users.

The scroll box at the bottom will show all Permissions assigned to the Users group for this set of files. If the permission do not include Full Control click the Edit button just above the scroll box. That opens another dialog box that allows you to change User Group permissions. Select the Users group in the upper scroll box and then check the Full Control check box in the lower scroll box. Click Apply. Get some more :coffee:

You should be good to go.

For a Vista OS with multiple User accounts you also need to set up Sharing on the Firaxis Directory in the Program Files path, the Civilization 4 directory and the Mods directory and the HoF Mod directory.
 
I'm not sure if this goes here or under tech support. I got a new computer recently that runs vista. I installed civ 4 and patched up through BTS 3.13. BTS 3.13 runs fine - I haven't encountered any problems. However, if I try to run Vanilla civ using the 1.74 HOF mod, I run into problems. When I try to edit the game options (either through in-game or through advanced -> options), I can't exit out of that screen. I click on exit but it doesn't register. I don't have this problem in BTS (I can change the options freely in BTS). Any ideas on what may be causing this problem? Thanks.

I just installed on a brand new Vista laptop and had all the problems...those missing dlls, etc. IIRC, The problem with the options not closing was fixed by telling it to run as Administrator. (Rt-click, properties, check the box)
 
Thanks Denniz! I tried looking for a solution but I must have missed this thread. It works fine now and I can reattempt the gauntlets :D
 
I just installed on a brand new Vista laptop and had all the problems...those missing dlls, etc. IIRC, The problem with the options not closing was fixed by telling it to run as Administrator. (Rt-click, properties, check the box)

Yeah... I'm really starting to hate some of the Vista features and I've only had it for two days :lol: It keeps on asking me for the admin password when I'm installing/moving files and it gets annoying after a while. I swear I'm just going to run my computer on admin all the time soon...
 
Yeah... I'm really starting to hate some of the Vista features and I've only had it for two days :lol: It keeps on asking me for the admin password when I'm installing/moving files and it gets annoying after a while. I swear I'm just going to run my computer on admin all the time soon...

I'm also annoyed by all the popups.
Even if you are an admin user, Vista still runs the programs as a regular user unless you tell it to run with Admin privledges.
 
BTS 3.13 runs fine on my new PC with Vista. However, when I added HOF-3.13.001 several things stopped working:

1) No User Interface when the game map is displayed. Units are visible and can be moved, but the interface the surrounds the map is completely gone.

2) Again in map view, none of the function keys does anything, except F11 which functions normally. F11 just switches between normal perspective view and aerial (cloud) view.

3) In the main menu, clicking on the Civilopedia menu item has no effect.

I'd try the potential fix mentioned above, but I don't understand it. It doesn't explain what the problem (bug) is; it dives right in explaining how to work around the bug, but doesn't say what application or Vista administrative function is being used to apply the fix. Are the files read only and should they be read/write? Can the fix be applied to just the HOF Mod directory?

Summarizing:

What is the Vista bug that is activated by the HOF Mod. Is it activated by anything else? Or is the bug actually in the HOF Mod itself?

What exactly is the procedure that works around this bug? (I'd like to clearly understand it, before applying it.)

Similar problems with Civ4 and Warlords:

I have exactly the the same problem with Civ4 1.74 & HOF-1.74.002 and
Warlords 2.13 & HOF-2.13.002 as well.

Sincerely,

Sun Tzu Wu
 
I noticed that the HOF-1.74.002 folder is read only (in the properties window), so I tried to make it read/write by removing the checkmark and applying the change to just the folder itself. It looks like the folder is read/write now, but clicking OK and right clicking on the folder again to bring up the properties, one can see that it is still read only. What kind of operating system or filesystem handles permissions like this. I'm using an account with administrator privileges, so I don't understand how this can be.

Is there a Vista Service (daemon) switching the folder right back to read-only or is Vista lying about changing the folder to read/write?

It seems that I can't even try to apply the suggested fix for the "HOF Mod and Vista compatibility issue.

Isn't there a SP for Vista now? How does one ch

Sun Tzu Wu

P.S.

Could my problem result from the HOF ini being unwriteable? I can see that it is read/write, but the HOF folder is read only. Does Vista do the right thing -- the folder is read only and the ini file is read/write, so writes to the file succeed or does it do the wrong thing -- apply the folder's permissions to the files (and folders) it contains and cause writes to the ini to fail?
 
Denniz,

I tried everything you suggested on the Vista Fixes tab of the HOF Mod page, but it had no effect as far as I can see (tested only Civ4 & HOF-1.74.002).

Does Vista SP1 need to be installed? I'm not sure whether SP1 is installed or not. I thought the System selection in the Control Panel would indicate this, but I see nothing there; I thought that's where MS Windows 2000 showed the SP installation number.

Sun Tzu Wu

P.S. I found out that the read only attribute on folders in Vista can not be changed and it doesn't affect the folder itself, but only the files it contains as follows. If simple sharing is not disabled, all folders in Vista will always have the read only attribute set; it can't be changed and it is only applied to files inside the folder or inside the folder and all subfolders as selected when the Apply button is clicked. (Search for "read-only" in http://support.microsoft.com/kb/812003).
 
I turned on logging, as Denniz described in page 57 of the HOF support thread.

I made copies of the logs (except those that didn't change) at three distinct points:

*-su.log - Start Up (after Civ4 loaded)

*-cp.log - Civilopedia (after Civilopedia item failed access within Main menu)

(I started a custom game, pressed the F6 key, and exited via ESC, CR, CR.)

*.log - Civ4 exit

The final PythonErr.log file became 22MB in size, so I omitted it from the archive in the hope that it wouldn't be needed to diagnose this problem.

Sun Tzu Wu
 
Here's the 22MB final PythonErr.log file.

The line

ERR: Call function onEvent failed. Can't find module CvEventInterface

is repeated in it several thousand times.

So, it compressed down to 81.6KB, so I decided it could be attached after all.

I should have expected a very good compression ratio for log files. Duh.

Sun Tzu Wu
 
The errors were in between the repeated lines about CvEventInterface. Basically the HOF Mod is trying to read your registry to find the path to your "My Documents" folder. (For example, mine is "C:\Documents and Settings\Dennis\My Documents"). It is used to construct the path to the save file folder for the save options in the HOF Options.

Code:
	def __getRegValue(root, subkey, name):
		key = _winreg.OpenKey(root, subkey)
		try:
			value = _winreg.QueryValueEx(key, name)
			return value[0]
		finally:
			key.Close()
			
	myDocuments = __getRegValue(_winreg.HKEY_CURRENT_USER,
					r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",
					"Personal")
I don't have Vista so I don't know a whole lot about it but everything in the Vista procedures was worked out a while ago so I don't know what effect SP1 would have on things.

Make sure your user has admin rights and you have User Access Control (UAC) turned on. It could be one of those that is preventing the read.

Someone else had this same error recently. Unfortunately, I don't remember the details.
 
The errors were in between the repeated lines about CvEventInterface. Basically the HOF Mod is trying to read your registry to find the path to your "My Documents" folder. (For example, mine is "C:\Documents and Settings\Dennis\My Documents"). It is used to construct the path to the save file folder for the save options in the HOF Options.

Like this one?

File "<string>", line 1, in ?

Code:
	def __getRegValue(root, subkey, name):
		key = _winreg.OpenKey(root, subkey)
		try:
			value = _winreg.QueryValueEx(key, name)
			return value[0]
		finally:
			key.Close()
			
	myDocuments = __getRegValue(_winreg.HKEY_CURRENT_USER,
					r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",
					"Personal")

Do I need to understand this code to fix this issue?

I don't have Vista so I don't know a whole lot about it but everything in the Vista procedures was worked out a while ago so I don't know what effect SP1 would have on things.

I should effectively had SP1 installed the night I set up the machine, because it is setup to auto-update and it would have installed SP1 plus all important updates thereafter.

Make sure your user has admin rights and you have User Access Control (UAC) turned on. It could be one of those that is preventing the read.

Yes, User Account Control is active. I used the first account that Vista created on first boot. It is an Administrator account.

Someone else had this same error recently. Unfortunately, I don't remember the details.

It might be easier/faster if I try to debug this on my own. However, I know nothing about how the HOF Mod does its magic. If you point me in the right direction, I may be able to determine the cause of this issue. Is this a reasonable approach?

Sun Tzu Wu
 
The message that tells me what was happenning:
Code:
  File "HOFContext", line 37, in ?
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
[COLOR="Red"]  File "HOFContext", line 30, in __getRegValue[/COLOR]
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
WindowsError

You don't need to understand the code. I just geeked out a little bit there. :blush:

I found the reference I was thinking of: http://forums.civfanatics.com/showthread.php?t=268662. The player claims to have solved his problem by creating a new user account. I am not sure what he did or why it made a difference.

I am afraid that Vista security is a black box to me. It may be that the default account has something different/invalid about it's registry entry for the "My Documents" folder.

You could check the registry to see what is in there:
  • run "regedit"
  • look in the "HKEY_CURRENT_USER" tree
  • drill down to "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
  • look for the "Personal" key's value
 
You could check the registry to see what is in there:
  • run "regedit"
  • look in the "HKEY_CURRENT_USER" tree
  • drill down to "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
  • look for the "Personal" key's value

There is no registry item called "Personal" in the key "Shell Folders".

What should the value and type of the registry item "Personal" be?

The "Shell Folders" registry key contains the two registry items:

1] (Default), REG_SZ, (value not set)

2] !Do not use this registry key, REG_SZ, Use the SHGetFolderPath or SHGetKnownFolderPath function instead

It appears that Microsoft doesn't want developers to use the "Shell Folders" key to get a path in Vista.

Sun Tzu Wu
 
The solution is creating a second user with Administrator privileges and copying the Civ4 ini file you want to use into the My Games/../<Civ4> folder.

This account has the expected value of the "Personal" registry item and everything works as expected.

Apparently, Microsoft doesn't want people to use the first (Administrator) account created at the first boot of a system for running normal application and games.

Warning for Foul :mad: Language: The following message (paragraph) is for mature viewers only ...

Spoiler :
Thanks Microsoft for making my first few days of using Vista like visting Serbia in the winter in a swim suite! Your blah blah is our passion, but "blah blah" really means "frustration & pain". An account restricted to administration should be more clearly identified as such (by a background screen that says just that over and over for example.) I could write a thesis on why Vista is a poorly designed inoperative system ...

End of Rant

I feel better now.

Sun Tzu Wu
 
Denniz,

Please update the HOF Mod page / Vista Fixes tab to state that the very first Administrator account can't be used to run Civ4, Warlords or BTS with its respective HOF Mod. The second (or later) Administrator account (verified) or any User account (not verified) can be used to run with the HOF Mod.

Thanks,

Sun Tzu Wu
 
Denniz,

Please update the HOF Mod page / Vista Fixes tab to state that the very first Administrator account can't be used to run Civ4, Warlords or BTS with its respective HOF Mod. The second (or later) Administrator account (verified) or any User account (not verified) can be used to run with the HOF Mod.

Thanks,

Sun Tzu Wu

I believe the above is only in regards to those who have installed the service pack. My HOF runs fine without the service pack, but other things [non-civ] are going nuts. I may have to install the pack, or just go back to xp.
 
Back
Top Bottom