12 June 2013

Autodesk Revit 2013 Hotfix Script

Here is a script that will automate the installation of the new DLL files that replace the old ones. Sadly, Autodesk expects for all users to manually replace these files, even in larger corporations, like I work in. This script runs relative to to it's execution path. The only thing that has to be done is to make sure all of the DLL files are in the same directory, including the directory .\RevitServerToolCommand be present, containing the DLL files within that directory too.

Here is the link to Autodesk's website describing what this script does.

Here is the link to download the script below.

 #*******************************************************************************  
 #   Author: Mick Pletcher  
 #    Date: 12 June 2013  
 #  
 #   Program: Revit 2013 Hotfix  
 #*******************************************************************************  
 Clear-Host  

 $Global:OS  
 $Global:RelativePath  
 $FileLoc = "C:\Program Files\Autodesk\Revit 2013\Program\"  
 $DLL_01 = "RS.Common.ClientServer.Proxy"  
 $DLL_02 = "DataStorageClient"  
 $DLL_03 = "DesktopMFC"  
 $DLL_04 = "FamilyDB"  
 $DLL_05 = "GeomUtil"  
 $DLL_06 = "Graphics"  
 $DLL_07 = "GrphOGS3"  
 $DLL_08 = "CommandServiceClient"  
 $DLL_09 = "RS.Common.ClientServer.Proxy"  

 Function GetRelativePath{  
      $Global:RelativePath=(split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"  
      Write-Host $Global:RelativePath  
 }  

 Function GetOSArchitecture{  
      $Global:OS=Get-WMIObject win32_operatingsystem  
      #$Global:OS.OSArchitecture  
      #Answers: 32-bit, 64-bit  
 }  

 GetRelativePath  
 GetOSArchitecture  
 If ($Global:OS.OSArchitecture -eq "64-bit"){  
      If ((Test-Path -Path $FileLoc$DLL_01".dll") -eq $true){  
           Copy-Item -Path $FileLoc$DLL_01".dll" -Destination $FileLoc$DLL_01".orig" -Force  
           Remove-Item -Path $FileLoc$DLL_01".dll" -Force  
           Copy-Item -Path $Global:RelativePath$DLL_01".dll" -Destination $FileLoc -Force  
      }  
      If ((Test-Path -Path $FileLoc$DLL_02".dll") -eq $true){  
           Copy-Item -Path $FileLoc$DLL_02".dll" -Destination $FileLoc$DLL_02".orig" -Force  
           Remove-Item -Path $FileLoc$DLL_02".dll" -Force  
           Copy-Item -Path $Global:RelativePath$DLL_02".dll" -Destination $FileLoc -Force  
      }  
      If ((Test-Path -Path $FileLoc$DLL_03".dll") -eq $true){  
           Copy-Item -Path $FileLoc$DLL_03".dll" -Destination $FileLoc$DLL_03".orig" -Force  
           Remove-Item -Path $FileLoc$DLL_03".dll" -Force  
           Copy-Item -Path $Global:RelativePath$DLL_03".dll" -Destination $FileLoc -Force  
      }  
      If ((Test-Path -Path $FileLoc$DLL_04".dll") -eq $true){  
           Copy-Item -Path $FileLoc$DLL_04".dll" -Destination $FileLoc$DLL_04".orig" -Force  
           Remove-Item -Path $FileLoc$DLL_04".dll" -Force  
           Copy-Item -Path $Global:RelativePath$DLL_04".dll" -Destination $FileLoc -Force  
      }  
      If ((Test-Path -Path $FileLoc$DLL_05".dll") -eq $true){  
           Copy-Item -Path $FileLoc$DLL_05".dll" -Destination $FileLoc$DLL_05".orig" -Force  
           Remove-Item -Path $FileLoc$DLL_05".dll" -Force  
           Copy-Item -Path $Global:RelativePath$DLL_05".dll" -Destination $FileLoc -Force  
      }  
      If ((Test-Path -Path $FileLoc$DLL_06".dll") -eq $true){  
           Copy-Item -Path $FileLoc$DLL_06".dll" -Destination $FileLoc$DLL_06".orig" -Force  
           Remove-Item -Path $FileLoc$DLL_06".dll" -Force  
           Copy-Item -Path $Global:RelativePath$DLL_06".dll" -Destination $FileLoc -Force  
      }  
      If ((Test-Path -Path $FileLoc$DLL_07".dll") -eq $true){  
           Copy-Item -Path $FileLoc$DLL_07".dll" -Destination $FileLoc$DLL_07".orig" -Force  
           Remove-Item -Path $FileLoc$DLL_07".dll" -Force  
           Copy-Item -Path $Global:RelativePath$DLL_07".dll" -Destination $FileLoc -Force  
      }  
      If ((Test-Path -Path $FileLoc"RevitServerToolCommand\"$DLL_08".dll") -eq $true){  
           Copy-Item -Path $FileLoc"RevitServerToolCommand\"$DLL_08".dll" -Destination $FileLoc"RevitServerToolCommand\"$DLL_08".orig" -Force  
           Remove-Item -Path $FileLoc"RevitServerToolCommand\"$DLL_08".dll" -Force  
           Copy-Item -Path $Global:RelativePath"RevitServerToolCommand\"$DLL_08".dll" -Destination $FileLoc"RevitServerToolCommand\" -Force  
      }  
      If ((Test-Path -Path $FileLoc"RevitServerToolCommand\"$DLL_09".dll") -eq $true){  
           Copy-Item -Path $FileLoc"RevitServerToolCommand\"$DLL_09".dll" -Destination $FileLoc"RevitServerToolCommand\"$DLL_09".orig" -Force  
           Remove-Item -Path $FileLoc"RevitServerToolCommand\"$DLL_09".dll" -Force  
           Copy-Item -Path $Global:RelativePath"RevitServerToolCommand\"$DLL_09".dll" -Destination $FileLoc"RevitServerToolCommand\" -Force  
      }  
 }  
 Remove-Variable -Name DLL_01  
 Remove-Variable -Name DLL_02  
 Remove-Variable -Name DLL_03  
 Remove-Variable -Name DLL_04  
 Remove-Variable -Name DLL_05  
 Remove-Variable -Name DLL_06  
 Remove-Variable -Name DLL_07  
 Remove-Variable -Name DLL_08  
 Remove-Variable -Name DLL_09  
 Remove-Variable -Name FileLoc  
 Remove-Variable -Name OS  
 Remove-Variable -Name RelativePath  

Related Posts:

  • SCCM deployment with Error 1612 I was deploying a package earlier today. It took a few iterations to get everything correct. All of a sudden on the fourth update of the package, it would no longer install. It continuously failed. I thought maybe something … Read More
  • Automating Microsoft Endpoint Full System Scan upon Infection While helping to manage Microsoft Endpoint, a former colleague suggested that I setup Endpoint to automatically run a full system scan each time an infection is detected. I googled the blog posting on it and although it is… Read More
  • Failed to connect to remote distribution point We recently did a complete upgrade on all equipment in one of our remote offices. After the upgrade, I had to setup a new distribution point. I began by using Prajwal Desai's blog post on setting up a remote distributio… Read More
  • Packaging EverMap Redaction for Adobe Acrobat XI To easily deploy Redaction for Adobe Acrobat XI, I created an MSI file using the AppDeploy Repackager. There are a total of 8 files it packages up. My firm has an enterprise license, which gets written to the AutoRedact.LIC… Read More
  • Deploying Microsoft Endpoint I recently converted my firm to Microsoft Endpoint. Part of the process is including endpoint in the golden image. I wrote this powershell script that will install endpoint and then remove the necessary registry keys so it… Read More

0 comments:

Post a Comment