Solved

Installing MFC

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 85
Complete beginner needs help making a cron job 9 125
fizzArray2 challenge 1 89
Is there a simple front-end menu system. 9 102
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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