VMware THIN4-CL-C Getting Started Guide - Page 17

Windows XP SP1 Microsoft extended the length for ShellExecute in SP2., process COM failure

Page 17 highlights

Introduction to VMware ThinApp „ Short path names work around Windows API path length limitations. Many Windows API functions have limitations on the maximum string length they can handle for paths. For example, on Windows XP SP1, a ShellExecute API command cannot handle a string length longer than 128 characters. Often the registry is used to store a value such as Command + Parameters. The following entry for Office 2003 is an example: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\ois.exe\shell\Edit\command DefaultValue = C:\PROGRA~1\MICROS~3\OFFICE11\OIS.EXE /shellEdit "%1" If the executable file name plus the parameter is greater than 128 characters, the command fails on Windows XP SP1 (Microsoft extended the length for ShellExecute in SP2). For example, the following command exceeds 128 characters (168 chars): C:\Program Files\Microsoft Office\OFFICE11\winword.exe c:\documents and settings\Greogory Appleblaught\My Documents\Draft 34 April 6 2006 Master License Agreement.doc The same path is much smaller using short path names (85 characters): C:\Progra~1\Micros~3\OFFICE11\winword.exe c:\docume~1\Greogo~1\MyDocu~1\Draft3~1.doc The use of short path names in the registry is very common. For example, Microsoft Office installs hundreds of short path name references in the registry. Short path names are not consistent across PCs and are also highly dependent on installation order. For example, installing Microsoft Office after installing Microsoft Visual Studio can create identical short path names that refer to different locations. Installing Microsoft Office followed by Microsoft Visual Studio generates: c:\progra~1\micros~1 and c:\progra~1\micros~2 c:\progra~1\micros~1 = c:\Program Files\Microsoft Office c:\progra~1\micros~2 = c:\Program Files\Microsoft Visual Studio When capturing a snapshot of an application's installation, VMware ThinApp writes a number of short path name values to the registry as described above. Moving the application to a different PC or installing additional applications on the same PC might affect the short path name values that the underlying operating system provides. Virtualization solutions that are based on filter drivers do not have the ability to control short path name values because they are generated by the Windows file system. Because of this, a capture on one PC has a good chance of failing when moved to another PC or when executed later on the same PC after other applications have been installed. Common areas of failure that occur when proper short path name support is not available include: „ In‐process and out‐of‐process COM failure - The application tries to create COM objects and fails because the registry values point to the in‐process or out‐of‐process COM server no longer point to the correct location. „ An MSI is executed to reinstall an application even though it was fully installed - msi.dll performs an integrity check for all MSI installed components requested by an application. If msi.dll detects that a DLL or data file is not located at the same location that it was originally installed to, it kicks off a reinstallation procedure to try to correct the problem. „ Child processes fail to execute - Many child process applications are executed using registry values that point to short path names. If the values do not point to the correct location, the child process fails to launch. This often renders an application unusable. „ An application fails to load - Applications might fail or do not load properly because they cannot locate the installation path or shared DLL paths using registry data. „ An application indicates there are missing data files - An application might display error messages relating to missing files because it can no longer locate a file using a short path name pointer from the registry. VMware, Inc. 17

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

VMware, Inc.
17
Introduction to VMware ThinApp
Short path names work around Windows API path length limitations. Many Windows API functions have
limitations on the maximum string length they can handle for paths. For example, on Windows XP SP1,
a ShellExecute API command cannot handle a string length longer than 128 characters. Often the registry
is used to store a value such as Command + Parameters. The following entry for Office 2003 is an example:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\ois.exe\shell\Edit\command DefaultValue =
C:\PROGRA~1\MICROS~3\OFFICE11\OIS.EXE /shellEdit "%1"
If the executable file name plus the parameter is greater than 128 characters, the command fails on
Windows XP SP1 (Microsoft extended the length for ShellExecute in SP2).
For example, the following command exceeds 128 characters (168 chars):
C:\Program Files\Microsoft Office\OFFICE11\winword.exe c:\documents and settings\Greogory
Appleblaught\My Documents\Draft 34 April 6 2006 Master License Agreement.doc
The same path is much smaller using short path names (85 characters):
C:\Progra~1\Micros~3\OFFICE11\winword.exe c:\docume~1\Greogo~1\MyDocu~1\Draft3~1.doc
The use of short path names in the registry is very common. For example, Microsoft Office installs hundreds
of short path name references in the registry.
Short path names are not consistent across PCs and are also highly dependent on installation order. For
example, installing Microsoft Office after installing Microsoft Visual Studio can create identical short path
names that refer to different locations.
Installing Microsoft Office followed by Microsoft Visual Studio generates:
c:\progra~1\micros~1 and c:\progra~1\micros~2
c:\progra~1\micros~1 = c:\Program Files\Microsoft Office
c:\progra~1\micros~2 = c:\Program Files\Microsoft Visual Studio
When capturing a snapshot of an application’s installation, VMware ThinApp writes a number of short path
name values to the registry as described above. Moving the application to a different PC or installing
additional applications on the same PC might affect the short path name values that the underlying operating
system provides.
Virtualization solutions that are based on filter drivers do not have the ability to control short path name
values because they are generated by the Windows file system. Because of this, a capture on one PC has a good
chance of failing when moved to another PC or when executed later on the same PC after other applications
have been installed.
Common areas of failure that occur when proper short path name support is not available include:
In
process and out
of
process COM failure
– The application tries to create COM objects and fails
because the registry values point to the in
process or out
of
process COM server no longer point to the
correct location.
An MSI is executed to reinstall an application even though it was fully installed
– msi.dll
performs
an integrity check for all MSI installed components requested by an application. If
msi.dl
l detects that a
DLL or data file is not located at the same location that it was originally installed to, it kicks off a
reinstallation procedure to try to correct the problem.
Child processes fail to execute
– Many child process applications are executed using registry values that
point to short path names. If the values do not point to the correct location, the child process fails to
launch. This often renders an application unusable.
An application fails to load
– Applications might fail or do not load properly because they cannot locate
the installation path or shared DLL paths using registry data.
An application indicates there are missing data files
– An application might display error messages
relating to missing files because it can no longer locate a file using a short path name pointer from the
registry.