Search code examples
comwindows-installer

Short filenames in LocalServer32 entries


I have a Component in an installer Project (created with an old Installshield Version).

The Class table entry in the MSI is created correct. But when the installer runs the entry in the registry (LocalServer32) is created with a short 8.3 Name.

What can I do so that the entries in the registry are made with the full 32bit long filename?

The problem behind it:

My component tries to locate localized DLLs with the filename. But when the component is launched with the 8.3 filename the fielname returned by GetModuleFilenameis also in 8.3 format. So when it just appends DEU to the name and changes the extension to DLL to locate the localized DLLs this sometimes fails. And I can not modify this component. (I.e. CompenentName.exe tries to find CompenentNameDEU.dll)

When I register the component manually (ComponentName.exe -register) the entries are made with the full long filename and everything works perfect.


Solution

  • A way around your problem is to use the GetLongPathName() API to convert the path to the long version of the filename.

    This should work regardless of whether the argument is a shortened 8.3 path or whether it's already a long path.