Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Registry key to force Windows to use short filenames

Registry key to force Windows to use short filenames

  • Comments 6

I thought this was interesting - there is a way that you can globally force Windows to use short filenames (also known as 8.3 filenames because they were limited to 8 characters for the name and 3 characters for the extension) or alternatively allow Windows to use long filenames that are not bound to the 8.3 naming restrictions.  This is the key name and value:

  • Key name: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem
  • Value name: Win31FileSystem
  • Data type: REG_DWORD

Setting this value to 0 will allow Windows to use long filenames.  Setting this value to 1 will force Windows to use short filenames.

When you use the SHORTFILENAMES property in Windows Installer, that is the equivalent of forcing 8.3 filenames but only for a single MSI installation.  This registry key controls 8.3 file naming for the entire system, and I have seen this be the cause of 1325 errors ('[2]' is not a valid short file name) when installing MSI packages in some rare cases.

Some setup authors do not pay attention to the setting in the file table for the short file name value and inadvertantly provide a short file name that is greater than 8 characters long.  Then when someone tries to install that MSI on a system that has the Win31FileSystem value = 1 or the SHORTFILENAMES property set, they get a 1325 error.  For example, you will see this if you try to install Visual Studio .NET 2003 on a machine that has this registry value set because we did not pay enough attention to the short file name values we provided in the MSI.  One of the files has a short file name value of "Microsoft" which has 9 characters instead of 8.

 

  • Use the ICE validation rules, then you will discover these sort of issues - and you might be able to qualify for "Designed for Windows XP" :)
  • Say you did a SHORTFILENAMES only install, wouldn't that be likely to break your app anyways? e.g. if it has a call to LoadLibrary with a long filename, how will it be able to locate a file that's been installed with a different, short filename?

  • Hi Stephen - I'm not sure how an application would behave in a scenario like this, but I'm also not sure why you would want to install using the SHORTFILENAMES flag when you know your code uses long file names internally.  I'd suggest trying out a test scenario if you are considering trying to support this.

  • PingBack from http://www.keyongtech.com/3666505-valid-short-file-name

Page 1 of 1 (6 items)
Leave a Comment
  • Please add 6 and 8 and type the answer here:
  • Post