Archive: Why Does RegDLL Uses Short Filenames


Why Does RegDLL Uses Short Filenames
I've determined that RegDLL translates long filenames into short names before actually registering the DLL. For example, "LongName.ocx" gets registered (in the Registry) as "LongNa~1.ocx".

Can RegDLL be forced to use the long name?

This use of short names is causing a problem when I run my patch installer that patches, for example, LongName.ocx. Using my patch procedure, the short name becomes "LongNa~2.ocx", which of course is not registered ("~1" is registered from the original install, not "~2").

This change in short name happens because I patch into a temporary name of "LongName.ocx~patched", and if all files are patched without error, I then delete the original "LongName.ocx" and rename the patched version "LongName.ocx~patched" to the correct name of "LongName.ocx". My goal is to leave the original in place as long as possible.

Joe A.


RegDLL itself doesn't use short file names. When using /REBOOTOK on Windows 9x, the file names are translated to short file names if the action is done after reboot because of a limitation of Windows 9x.


This is happening on Windows XP, and in a situation that does not require a reboot to get the file installed. It is on the very first install that the short name is used in the registry (NOT in the directory for the filename as that maintains the long name, it's using the short name just in the registry). What else could impact this? Here's the code I'm using, pretty simple:

[code]
; Must set to here to find dependent DLLs for the .ocx.
SetOutPath "$INSTDIR\${BIN}"
ClearErrors
RegDLL "$INSTDIR\${BIN}\BCGTimeIntervals.ocx"
[code]

Thanks,
Joe A.


Well, if the RegDLL itself triggers the registry value creation, then it's the the OCX itself that is writing that short file name. Nothing is written to the registry by NSIS when you use the RegDLL command.


kichik, your absolutely right (as usual) about this not being a RegDLL issue. I just unregistered the OCX and used regsvr32 to register it, and I get the same thing -- it gets registered with the short name. I then stepped through the registration code (it's using MFC), and I don't see how that's happening, unless some Windows API is doing it during registration (doubtful), but it is NOT an NSIS issue. Thanks again for your help, it's much appreciated.

Joe A.