Solved

OverWriting Comctl32.dll during setup

Posted on 1998-10-30
11
214 Views
Last Modified: 2013-12-26
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.
0
Comment
Question by:AnswerTheMan
11 Comments
 
LVL 2

Expert Comment

by:mkmccreary
Comment Utility
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,
Martin
0
 
LVL 5

Author Comment

by:AnswerTheMan
Comment Utility
yes i've try that.
not working.
windows using the version installed on windows\system ONLY
0
 
LVL 4

Expert Comment

by:mcix
Comment Utility
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:

http://support.microsoft.com/support/kb/articles/q179/3/65.asp


0
 
LVL 5

Author Comment

by:AnswerTheMan
Comment Utility
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 ?
0
 
LVL 4

Expert Comment

by:mcix
Comment Utility
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...
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Expert Comment

by:Poddy
Comment Utility
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)

NUL=C:\WINDOWS\SYSTEM\Comctl32.dll
C:\WINDOWS\SYSTEM\Comctl32.dll=C:\WINDOWS\SYSTEM\Comctl32.new

Reboot the machine
0
 
LVL 5

Author Comment

by:AnswerTheMan
Comment Utility
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.
0
 
LVL 2

Expert Comment

by:chris_a
Comment Utility
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!
0
 
LVL 6

Expert Comment

by:anthonyc
Comment Utility
Answerman:

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.

Anthony
0
 
LVL 5

Author Comment

by:AnswerTheMan
Comment Utility
have u try to unregister a dll while in use by the os ??

0
 
LVL 1

Accepted Solution

by:
tommy_boy earned 100 total points
Comment Utility
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.




0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now