• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

OverWriting Comctl32.dll during setup

Using VB5 setup wizard, i must Overwright on the user's machine, the file Comctl32.dll.
the setup wizard can't do that because this file is in use
by windows all the time, and can't be overwritten while
windows is running.
so, i have to do it manually, from DOS, be4 or after the setup.
BUT - i want to give the user an easy installation, without
those manuvers.
i'm sure i can write an app. that will make a restart and then copy it in DOS mode, but i'm looking for a way to make it In the installation itself.
1 Solution
Have you tried installing the version of the Comctl32.dll that you need to the application path.  Maybe that way you can leave the current version intact, but still use the version you need.

Just a thought,
AnswerTheManAuthor Commented:
yes i've try that.
not working.
windows using the version installed on windows\system ONLY
You might try using the RunOnce registry key.  Basically, you could write a BAT file to copy and register the DLL the next time the machine is booted.

Here is a KB article about it:


The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

AnswerTheManAuthor Commented:
BAt file is allright, but to do this i have to force the autoexec.bat to run this file be4 win95 is loaded, so i have to add a line in autoexec.bat.
how can i do that ? u see, i don't have a fisically access to the
client machine.
and suppose i will know how to add that line - how would i delete it after one use ?
Or shell i tell the client he must have IE3.0(at least), on his
machine be4 installing my application (IE3.0 installs that file)
? is that a logical demand ?
I was referring to the RunOnce registry key from the knowledge base article I posted.  It is a way to make it run your bat file one time the next time the computer is re-started...
If you are running under NT, use MoveFileEx

If you are running under 95/98
Copy the file with a different name
Make an entry in the [rename] section of C:\windows\WinInit.ini
(create it if it doesn't exist)


Reboot the machine
AnswerTheManAuthor Commented:
i appreciate your answers fellows, but u don't get the picture :
i'm, shipping the setup on a CD 5000 miles away from my location
and can't be present on instalation.
the client computers have older version of the file, and he is
a typical user which i can't trust to do all those manuvers.
i need the setup program to do that.
if there is no way - i can tell him to install ie3.0 (free d\l)
on his machins preior to my app instalation. this will do the work for me.
still have time and waiting for ideas.
I never use the VB setup thing anymore, I always use Wise, to do what you require in wise is a sigle click. There MUST be a similar function in the setupkit, otherwise the programmers would be too embarrassed to ship it!

The comctl32.dll being used is NOT necessarily the one in Windows/System.  It is the one that is registered, which just happens to be in Windows/System.  This is what you do.  Include Regsvr32 with your setup.  Unregister the DLL in the windows/system.  (this is doable) then copy your comctl32.dll somewhere other than windows system (say the install dir) and use regsvr32 to register it.  You are done.

I think Microsoft has a comctl32 installer that you can include with your application that does this kind of stuff.

AnswerTheManAuthor Commented:
have u try to unregister a dll while in use by the os ??

A simple solution may be to have a bat file run from the users autoexec.bat

1) After installing, make a copy of the users autoexec.bat file, and create a bat file in the temp direcotry.  In that bat file place the folowing code (change the paths depending upon the users config):
copy c:\temp\...dll c:\windows\system\...dll
delete c:\....\autoexec.bat
rename c:\.....\autoexe.bak *.bat

2) Modify the users autoexec.bat file and add the code to run the above bat file.
3) restart the users pc
4) when the user restarts the autoexec will be run, the file will be copied and the system will clean itself up (ie autoexec will be reset).  Why do you think a lot of installs require you to resart the PC in order for changes to take effect.

Let me know ho wyou get on.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now