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).
Why it's there:
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!
Here is how do to it:
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.:
Last edited by Gigantus; July 07, 2017 at 07:07 AM.
Reason: Restored some pictures, again
"If ye love wealth greater than liberty,
the tranquility of servitude greater than
the animating contest for freedom, go
home from us in peace. We seek not
your counsel, nor your arms. Crouch
down and lick the hand that feeds you,
and may posterity forget that ye were
our countrymen."
Thanks guys, I'll see if the mods want to sticky there.
I am not aware of changing permissions by a simple right-click...
"If ye love wealth greater than liberty,
the tranquility of servitude greater than
the animating contest for freedom, go
home from us in peace. We seek not
your counsel, nor your arms. Crouch
down and lick the hand that feeds you,
and may posterity forget that ye were
our countrymen."
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.
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 +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.
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.
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.
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.
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.
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.
Last edited by Ishan; October 20, 2010 at 08:27 AM.
Reason: double post
"If ye love wealth greater than liberty,
the tranquility of servitude greater than
the animating contest for freedom, go
home from us in peace. We seek not
your counsel, nor your arms. Crouch
down and lick the hand that feeds you,
and may posterity forget that ye were
our countrymen."
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.
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.
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.
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.
Under the patronage of Roman_Man#3, Patron of Ishan Click for my tools and tutorials
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein