Microsoft KB Archive/300920

{|
 * width="100%"|

PRB: Files with Long-Format File Names Are Not Installed Correctly on Windows 95/Windows 98

 * }

Q300920

-

The information in this article applies to:


 * Microsoft Windows Installer, versions 1.0, 1.1, 1.2, used with:
 * the operating system: Microsoft Windows 95
 * the operating system: Microsoft Windows 98

-

SYMPTOMS
On Windows 95 or Windows 98, when you are installing files with long file names that are already running in memory, the files will be saved to Wininit.ini and the system will reboot after the installation. After the reboot, the files included in Wininit.ini will be copied using the default short file name format by Wininit.exe. The installed application may not run because it cannot find the files it is looking for if it expects the long file name format.

CAUSE
Windows 95 and Windows 98 use Wininit.ini to move, replace, or delete files that are currently in use. Wininit.ini is processed by Wininit.exe before the protected mode disk system is loaded. Long file names are only available when the protected mode disk system is running. This problem is caused by a limitation in Wininit.exe that does not support the long file name format. This issue is addressed in Windows NT and Windows 2000 because these operating systems support the use of the Win32 API MoveFileEx that supports long file names.

RESOLUTION
There are two possible ways to work around this problem. The first is: before the installation takes place, make sure that all the files that will be installed with long file names are not in use, so that the Installer will able to replace them using the long file name format.

The other way to work around this problem is to write a custom action in the .msi file. The custom action will do the file copy rather than letting the Wininit.ini do it. Use the custom action to copy files to a temporary directory and write an entry to the RunOnce key in the registry that will call a utility (a program or a script) that will copy the files to the correct folder after the reboot.

STATUS
This behavior is by design.

Step to Reproduce Behavior
The following is the most common of several different ways to reproduce the problem:


 * 1) Create an .msi package for an executable application. The application will depend on a DLL with a long file name (longer than 8 characters).
 * 2) Install the original .msi package on Windows 95 or Windows 98.
 * 3) Run the application so that the DLL that has a long file name is loaded into the memory.
 * 4) Create an .msi package that will upgrade the previous .msi package. The upgrade .msi will contain an upgraded version of the same DLL that is in the original .msi package.
 * 5) Install the upgraded .msi package.
 * 6) You will then be asked to reboot after installing the upgraded .msi package because of files in use during the installation. Do so.
 * 7) After the reboot, try to run the application again. The application will fail to run, and an error message will appear that says that the application cannot find the DLL with the long file name. If you browse to the folder that contains the DLL you will notice that the name of the DLL has been changed to a default short file name (the first 6 characters are the same as the first 6 characters of the long file name, followed by &quot;~N&quot;, where N is a positive integer).