Solved

Installing MFC

Posted on 1997-11-12
1
380 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Expand data scrubbing tool 13 32
sameEnds challenge 3 159
Line meaning 9 86
Message not shown 5 50
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 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