Last Friday I had the pleasure of being contacted by a customer who was in the middle of a Lync 2010 deployment.

The scenario:

  • Windows XP, Windows 7x86  & Windows 7x64 client.
  • Some computer do already have Office Communicator 2007 installed which must be uninstalled.

Solution, creating a task sequence:

  • Conditions to only unstall Communicator 2007 if it is installed.
  • Condítions to control whether to install the x86 or the x64 version of Lync 2010

The result:

Almost everything worked out as expected, except for 20% of the computers that failed during the Install Lync software step. In the log files it showed the installation was complaining about open files. One thing I have learned during the years, is that log files are you friend, but they can also be deceiving and sometime lead you down the wrong road. My problem was not an open file, and the task sequence worked on 80% of the computers. Second step in troubleshooting (after reading the logs) is performing a manual attended installation on one of the workstations that failed. It turned out that Lync wouldn’t install and still complained about open files. After a little investigation I found out that the computers that failed all previously had Office Communicator 2005 installed, and the upgrade to Office Communicator 2007 for some reason didn’t do a very could cleanup job.

For whatever resaon the Lync 2010 installation also checks for this old Communicator 2005 registry key HKCR\Installer\Products\034DA5EBC0E93424BAF3958353688955  and with this key Lync complains about open files and stops the installation.

Solution to that was to add a new step to the task sequence that deletes the registry key. Below VB script was created as a package and added as a Install Software step.

On Error Resume Next 

Const HKEY_CLASSES_ROOT = &H80000000

strComputer = "." 
strKeyPath = "Installer\Products\034DA5EBC0E93424BAF3958353688955" 

Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") 

DeleteSubkeys HKEY_CLASSES_ROOT, strKeypath 

Sub DeleteSubkeys(HKEY_CLASSES_ROOT, strKeyPath) 
objRegistry.EnumKey HKEY_CLASSES_ROOT, strKeyPath, arrSubkeys 
If IsArray(arrSubkeys) Then 
For Each strSubkey In arrSubkeys 
DeleteSubkeys HKEY_CLASSES_ROOT, strKeyPath & "\" & strSubkey 
End If 
objRegistry.DeleteKey HKEY_CLASSES_ROOT, strKeyPath 
End Sub 

Thanks to Claus for helping out with the script.