Question
I get this Error: 'Steam.exe (Main Exception): ERROR: delete of steam.exe failed,Win32 Error 5 'Access is denied'
Answer
If you get one of these errors when you install or update Steam:
Steam.exe (main exception): ERROR: deleted Steam.exe but the file is still there
Steam.exe (main exception): ERROR: delete of Steam.exe failed, Win32 Error 5 "Access Denied"
The problem is caused by one of several things.
#1 You have some program running on your system that is preventing the old Steam.exe from being deleted.
This usually is a program like Cybersitter, WindowBlinds, spyware, a virus/trojan, a Firewall program or Security software of some kind that identified, tracked or hooked the original (out of date) version of Steam.exe when it ran the first time.
Programs like cybersitter and WindowBlinds hook all the input and output from running programs, often including all the network accesses and then record, track, or modify what is happening.
In the case of cybersitter and many trojan/virus/worm/spyware programs, they are snooping to see what you are doing and recording it or censoring it or sending it off to someplace for marketing research.
WindowBlinds is looking for things that it can "prettify".
Virus programs of course modify the Steam executables so they have these problems among many others.
In these cases, they grab hold of the old Steam.exe and when it tries to pass control to the new Steam.exe they aren't smart enough or perhaps fast enough to let go, so thus we get the error:
Steam.exe (main exception): ERROR: delete of Steam.exe failed, Win32 Error 5 "Access Denied"
Firewalls and anti-virus programs are looking at the fact that there was a Steam.exe running with one signature but suddenly there is a new Steam.exe running with a different signature - which just happens to be the same sort of thing that happens if your Steam.exe just got infected with a virus or trojan.
In this case, they may do a number of different things, from preventing the new Steam.exe from running, preventing the Steamtmp.exe from being renamed, even restoring the old Steam.exe back again in place of the one that was just downloaded and renamed.
That would give us this error:
Steam.exe (main exception): ERROR: deleted Steam.exe but the file is still there
What you have to do is take steps to prevent these programs from getting their grubby hands on your Steam install and messing with it.
1. Remove all virus/trojan/worms
2. Remove all spyware
3. Disable cybersitter (and anything like it)
4. Disable or uninstall WindowBlinds and any other theme programs like that.
5. Properly configure your Firewall and Anti-Virus programs,
This may mean removing all references to Steaminstaller.exe, Steamnew.exe, Steamtmp.exe, hl.exe, etc. and setting the monitoring level to low or medium (or temporarily off).
6. Temporarily disable Security monitoring software or configure it so it won't bother the steam install process.
Worst-case problems might require you to temporarily uninstall these programs to get them to let go, especially if you have old versions or pieces from previous uninstalled versions still running (and you don't know it).
#2. You have an existing Steam install that you are overwriting.
In this case, there might be an existing Clientregistry.blob file and perhaps registry entries that might be confusing the install process.
Especially if you have recently moved the Steam installation from one directory path to another or from one disk to another (or from one computer to another), you might very well have the update trying to go to the old directory because that is where the registry and the blob file were originally created and they still point there.
In this case, make sure you always delete the ClientRegistry.blob file when you move/transfer your Steam install.
#3. You restored a previous version of your Steam install off of a CDROM Backup.
When you copy files off of a CDRom, there is a very good chance that the files on your disk will get the "Read Only" bit set.
If you attempt to update a Steam install and any of the files are marked read-only (the GCF files as well) you will likely get one or more error messages and a failed update.
Make sure you clear all the read-only bits from all files you copy.
#4. The ownership permissions on the original Steam installation files are different from your current O/S login credentials.
This can happen especially if a parent or older brother/sister did the original Steam installation using their operating system login rights and you are attempting to modify the installation without those same rights or your O/S login account doesn't have ADMIN privileges.
One last thing here is XP system restore - if you do a restore you will be restoring old versions of Steam and this may re-invoke the problems again.
See
here for more details.