How To Remove Problems with
the Vista/Windows 7 UAC and VirtualStore
VirtualStore (or Virtual Store, for the less careful 'searchers' among us :)) is an important feature in the Vista and Windows 7 operating systems. However, it often creates problems for a Med2 (or RTW) installation, because of having been released before Vista and Windows 7 came out, and thus not having been designed with this feature in mind. This post will outline how to prevent any further VirtualStore problems for your Med2 installation.
How it works:
VirtualStore creates what's called a "virtualization" -- a fictious presence of a file or a folder in some location, but its actual location being somewhere else. As a simple example, you will see that if you intend to regenerate your Med2 sound pack files, they will not appear in /data/sounds:
And yet your game won't crash either. The sound files missing above will be generated -- in a hidden VirtualStore folder, deep within c:/User/AppData; AND, here is the kicker -- your game won't recognize that they were secretly moved. The operating system leaves invisible markers in the original folder, for the program to load the files from their new location, and continue working correctly (loading all the right sounds from the above generated sound files, not realizing that they're not even contained in its /data/sounds/ folder anymore).
Although VirtualStore causes a lot of crashes for Med2, believe it or not it actually works as it is supposed to, and serves a worthwhile function. It is meant to be a good 'programming practice' for game designers (unfortunately Med2 and RTW were written before Vista's appearance). The reason it is there is this: to add an extra layer of protection for Program Files. With Vista and Windows 7, an attentive user will notice that some folders receive an extra layer of securiy, and Program Folders is one of them. To manually copy a folder into Program Files requires a special Administrative permission, and this is done so that stray programs do not intermix with worthwhile and legitimate ones that you can know and trust. All programs within Program Files are supposed to be entirely trustworthy, after all, if you can't trust your Program Files, whom can you trust? This extra layer of protection ENSURES that your Program Files is intact.
Here is the problem however: programs like to read and write little data files for themselves. Word processors write and save drafts of your documents; graphics programs write temporary files for themselves; games write and generate save files, etc. And they are obviously designed to create these little convenience files within their own folder. Now you can see the problem that this creates, at least in principle, if you wish to ensure complete stability for everything within Program Files. The initially installed files may be perfectly correct and legitimate, but subsequent files may be corrupt, or malicious, or both. It is simply impossible to tell. At the same time it is impossible to forbid programs to write their own little convenience files either, as 99% of those files are perfectly legitimate.
Thus the Microsoft guys have happened upon a solution: move EVERYTHING that the program generates to an off-site location, so that Program Files itself remains completely unchanged from when the program was initially for the very first time installed. Yet, obviously the programs themselves must never know their data was moved; this movement of all new content happens under the hood, and without knowledge by either the program or the user. Usually it works well. Unfortunately it sometimes wreaks havoc on Med2 mods.
How to fix it:
1) One solution is to disable the whole Vista/Windows 7 UAC (the service which dims your computer whenever any program decides to acquire a little too much power for itself). Now this is highly unadvisable, as UAC (especially in Windows 7), is an extremely powerful feature, and very potent against preventing viruses and malware from taking over your computer. By removing it you're bringing your PC down to a windows XP or even a windows 98 level. You really don't want to do that.
2) Another solution is to disable the VirtualStore feature alone. This is done by going into your computer's Security Policy:
And disabling the last item. Now if you notice, it is actually part of UAC, which is why disabling the whole UAC seems to fix our issue. But after all, VirtualStore does serve a worthwhile function, and disabling it here unfortunately doesn't always fix problems for your Med2 install.
3) Instead, there is solution that avoids having to disable any Vista/Windows 7 features altogether. How? By removing the security concerns about your Med2 install. You will tell the operating system that Med2 is trustworthy in your opinion, and that the OS won't need to worry about virtualizing its files to protect you!
This fixes your Med2 problem, without having to in any way disable or remove the UAC or VirtualStore, and allowing them to serve their other worthwhile functions.
You might want to consider going into C:\Users\[user name]\AppData\Local\VirtualStore\Program Files, and deleting the Med2 folder, so there's no confusion for the game, and also to save space.
P.S.:
October 18, 2010, 09:04 AM
Gigantus
Re: How To Fix UAC and VirtualStore Problems
This goes into my "Fixes and Mods" file as reference, thanks.
Have you thought to ask irishron to make a sticky for that in the technical forum?
October 18, 2010, 12:06 PM
Ishan
Re: How To Fix UAC and VirtualStore Problems
Nice Sig1 and Gig is right it should be a sticky in the M2-Technical help.:)
And about the 3 point to make it easier one can easily do it with a right click and and a left click but i forget how it was.:(
October 19, 2010, 08:05 PM
SigniferOne
Re: How To Fix UAC and VirtualStore Problems
Thanks guys, I'll see if the mods want to sticky there.
I am not aware of changing permissions by a simple right-click...
October 19, 2010, 08:12 PM
irishron
Re: How To Fix UAC and VirtualStore Problems
Changing permissions with a single click does not exist. You did a very good job explaining it.
If the higher powers decide this needs to be stuck, I suggest all tech forums as it affect them.
October 19, 2010, 11:34 PM
Gigantus
Re: How To Fix UAC and VirtualStore Problems
I am not much of a geek, can you explain how to get to into the security settings in the third screenshot?
October 20, 2010, 12:35 AM
Ishan
Re: How To Fix UAC and VirtualStore Problems
Quote:
Originally Posted by Gigantus
I am not much of a geek, can you explain how to get to into the security settings in the third screenshot?
Lies u are as much as a Geek as we are Gig.:laughter:
And that's simple 2 methods for it:-
Press the start key in you keyboard and type Local in it's search box and u will see the Local Security Policy icon on top.
Another trick is Via run command Press http://02d9656.netsoljsp.com/SarcMar...ey_windows.png+R. We get the Run command box and in it type secpol.msc and that will open up the local security policy control window.:)
I'm so happy i never get to tell something techy to gigantus.:bounce:
Quote:
Originally Posted by SigniferOne
Thanks guys, I'll see if the mods want to sticky there.
I am not aware of changing permissions by a simple right-click...
Ok i guess it's my lucky day i found a cool reg entry in my PC it was in my portable earlier so that's why i was unable to find it. Sig if u want i can attach it in your OP.:)
It has 2 .reg entires all you have to do is put this in your registry that is:-
Double click Add Take Ownership Option.reg file after that whenever we right click we get the option of Take Ownership. We select it and done and nothing else is required in step 3 mentioned.
And then we can also uninstall or remove this option from our right click pop up box by double clicking uninstall.reg.
It's pretty handy.:D
And in the End Yes we want a sticky it's cool and will help dozens of players that come asking for help in the M2 Technical help.:)
October 20, 2010, 06:42 AM
SigniferOne
Quote:
Originally Posted by Gigantus
I am not much of a geek, can you explain how to get to into the security settings in the third screenshot?
If you're in Windows 7, press start, and in the textbox, type "security". You should see something like "Local Security Policy". I didn't elaborate on this step, as I don't recommend it in the post above, but I mentioned it for completeness' sake.
Quote:
Originally Posted by Ishan
Double click Add Take Ownership Option.reg file after that whenever we right click we get the option of Take Ownership.
Ah, now I know what you meant by the right-click thing.
Quote:
Ok i guess it's my lucky day i found a cool reg entry in my PC it was in my portable earlier so that's why i was unable to find it. Sig if u want i can attach it in your OP.:)
Thanks, it's okay, I generally don't recommend downloading stray registry entries on the internet. Plus it's not like users need to "take ownership" every single day :) It's just one step, for Med2, and I don't recommend it for any other programs to be honest; people go overboard with disabling UAC, taking ownership of everything, which kind of breaks the intent of programs being safe and untouchable.
October 20, 2010, 07:20 AM
irishron
Re: How To Fix UAC and VirtualStore Problems
Quote:
Originally Posted by SigniferOne
Thanks, it's okay, I generally don't recommend downloading stray registry entries on the internet. Plus it's not like users need to "take ownership" every single day :) It's just one step, for Med2, and I don't recommend it for any other programs to be honest; people go overboard with disabling UAC, taking ownership of everything, which kind of breaks the intent of certain progrems being safe and untouchable.
I agree with you on this. I do it on my personal computer for personal reasons and it's a security level I don't trust even Microsoft with.
November 09, 2010, 12:22 PM
kapiszon10
Re: How To Fix UAC and VirtualStore Problems
LOL i'm on win 7 and when i try to allow full control and modyfy some files say : access denied:(
November 09, 2010, 01:03 PM
irishron
Re: How To Fix UAC and VirtualStore Problems
Are you logged in as Administrator? Do you have ownership of the Sega folder?
November 10, 2010, 07:54 AM
kapiszon10
Re: How To Fix UAC and VirtualStore Problems
There is only one account on this pc so it looks like that i'm administrator.
November 10, 2010, 08:02 AM
Ishan
Re: How To Fix UAC and VirtualStore Problems
By default the admin is always disabled on vista and win 7, XP also but can't remember.
Did you use the attachment that i linked in Post#7?
That will fix the problems.
November 10, 2010, 08:52 AM
kapiszon10
Re: How To Fix UAC and VirtualStore Problems
Which attachment ?
November 10, 2010, 09:00 AM
irishron
Re: How To Fix UAC and VirtualStore Problems
At the bottom of the post where it says "Attached Files".
November 10, 2010, 09:39 AM
kapiszon10
Re: How To Fix UAC and VirtualStore Problems
i know but i dont know in which post it is.
November 10, 2010, 09:46 AM
Squid
Re: How To Fix UAC and VirtualStore Problems
Quote:
Originally Posted by Ishan
By default the admin is always disabled on vista and win 7, XP also but can't remember.
Did you use the attachment that i linked in Post#7?
That will fix the problems.
Quote:
Originally Posted by kapiszon10
i know but i dont know in which post it is.
Perhaps a closer examination of the reply is in order.
November 10, 2010, 09:56 AM
kapiszon10
Re: How To Fix UAC and VirtualStore Problems
oh it worked now with this file but it didnt resolve my modding problem.
November 10, 2010, 10:14 AM
irishron
Re: How To Fix UAC and VirtualStore Problems
Right-click and see if it set read-only.
November 10, 2010, 10:25 AM
kapiszon10
Re: How To Fix UAC and VirtualStore Problems
I uncheck read only sega folder than i clicked apply but when i click properties its again read only :(