Archive: Getting errors "Can't open DLL for writing"


Getting errors "Can't open DLL for writing"
It seems that my installer tries to overwrite DLL's which are currently used by windows. I'm getting this error message during installation (at least from time to time):

Error opening file for writing:
"C:\WINDOWS\System32\xxx.DLL"
Hit abort to abort installation,
retry to retry writing the file, or
ignore to skip this file
Well, my installer HAS TO overwrite these files, at least if they're out of date. Is there a way to get instant access to these files or unload them from memory if currently loaded? Otherwise my installer will continue doing error messages if the files are in use.

Thanks.

You should use the UpgradeDLL macro. It will make sure the DLL will only be copied over if the version on the user's system is older than what you're trying to install and, if the file in use, will replace the file after reboot.

Unless this DLL is only used by one program (rare if it's in the System directory), this is your only way. If it is used by only one program you can ask the user to close it or close it down yourself.


Cool, that is everything I need in one single instruction.

Thanks.