Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Installing MFC

Posted on 1997-11-12
1
Medium Priority
?
385 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
Vance Kessler earned 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

610 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