Solved

Installing MFC

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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