Solved

Installing MFC

Posted on 1997-11-12
1
377 Views
Last Modified: 2013-11-19
I need to install the MFC dlls. They may be in use at that time. I've seen other installation programs asking the user to restart the machine, and the installation have then been completed during Windows 95/NT startup.
How do I do that? Where can I find information about it?
0
Comment
Question by:roar
1 Comment
 

Accepted Solution

by:
Vance Kessler earned 100 total points
ID: 1309829
I had to do the same thing myself.  Under NT there is a special function to do this (which I'll explain in a minute).  Under Win95 you have to update a special INI file.  I would recommend trying the MoveFileEx call first and if it fails to do the INI thing as a backup.  That way it will work best on both NT and Win95.

-------------
Windows NT:

Use the MoveFileEx function to install DLLs in use.

Windows 95:

If you can't copy over a DLL (a normal CopyFile fails) then you must copy the new DLL to a temporary file.  You then update the WININIT.INI file (in the Win95 Dir) to tell Win95 to replace the old file once it restarts.  There may already be a WININIT.INI file so just use PrivateProfileWriteString() functions.  You basically put in an entry that renames the temp file to the real DLL name.  You do this by putting an entry in the [rename] section of the INI file.  In the form:

DestinationFileName=SourceFileName
 

An example WININIT.INI would look like:
-------------------------
[rename]
C:\WINDOWS\SYSTEM\wsock32.dll=C:\WINDOWS\SYSTEM\MySock32.tmp
-------------------------

This would replace the original wsock32.dll with my new one which is temporarily called MySock32.Tmp.  Note that you must only use short filenames in the INI file.  You may put as many entries as you wish in this file.

If you want to delete a file put in an entry like this:

NUL=c:\Windows\OldFile.Jnk
 


When the system is restarted, it searches for a WININIT.INI file and, if it finds one, runs WININIT.EXE on the file. After processing the file, WININIT.EXE renames it to WININIT.BAK.

The DestinationFileName and SourceFileName must both be short (8.3) names instead of long filenames because WININIT.EXE is a non-Windows application and runs before the protected mode disk system is loaded. Because long filenames are only visible when the protected mode disk system is loaded, WININIT.EXE won't see them, and therefore, won't process them.

0

Featured Post

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

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 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