18 July 2013

SCCM: Deploying Autodesk Revit 2013

In order to deploy the Revit 2013 through SCCM, you will need to have the detection method setup. I used the msi product codes listed below. This is the complete list of all the applications that Revit Building Premium installs in the exact order as listed below. I entered all of the msi product codes below just to make sure the package was completely installed before SCCM marked it as successful.

For the deployment script, I used the VBScript I wrote, listed below, to install the package. I had to write a VBScript to install Revit because setup.exe opens up another instance of itself and then closes the original instance. This causes SCCM and MDT to think that it has completed, when it has not. The script pauses for several seconds and then looks for the setup.exe again to get around this. The script will also run from any location, as I have it to use the relative path at when it was executed from.

You can download the script from here.

Autodesk® Design Review 2013
{153DB567-6FF3-49AD-AC4F-86F8A3CCFDFB}

Autodesk® Revit® 2013
{7346B4A0-1300-0510-0409-705C0D862004}

AutoCAD® 2013
{5783F2D7-B001-0000-0102-0060B0CE6BBA}

Autodesk® Navisworks® Simulate 2013
{F17E30E2-7ED4-0000-8A8E-CAB597E3F8ED}

Autodesk® 3ds Max® Design 2013
{7D65612F-53B4-0409-85AA-21DF5A8E9455}

Autodesk® Showcase® 2013
{A15BFC7D-6A90-47E6-8C6E-D51B2929D8C8}

AutoCAD® Architecture 2013
{5783F2D7-B004-0000-0102-0060B0CE6BBA}

Autodesk® SketchBook® Designer 2013
{3CB60177-D3D2-4E9C-BE4D-8372B34B4C7F}

Autodesk® Inventor® Fusion 2013
{FFF5619F-2013-0064-A85E-9994F70A9E5D}

Autodesk® SketchBook® Designer for AutoCAD® 2013
{7B42AD25-3D13-4422-A445-F5E18BD963FC}

Autodesk Material Library 2013 - Medium Image Library
{58760EEC-8B6A-43F4-81AA-696E381DFADD}

Autodesk® Backburner 2013
{3D347E6D-5A03-4342-B5BA-6A771885F379}

Autodesk Inventor Server Engine For 3ds Max Design 2013
{BC66B242-DF13-1664-851B-00123612ED98}

3dsMax Composite 2013
{2F808931-D235-4FC7-90CD-F8A890C97B2F}

Autodesk® Revit Interoperability for 3ds Max 2013
{06E18300-BB64-1664-8E6A-2593FC67BB74}

Autodesk® Civil View 2013
{FE6DCC8D-427F-405C-A779-C93B6D9F77A5}

Autodesk® Essential Skills Movies for 3dsMax Design 2013
{62CBE596-1BB8-4D7B-A056-103287BAD1C4}

Autodesk Cloud sync
{EE5F74BC-5CD5-4EF2-86BA-81E6CF46A18F}


 '*******************************************************************************  
 '   Author: Mick Pletcher  
 '    Date: 20 November 2012  
 '  Modified:  
 '  
 ' Description: This will install Revit 2013  
 '*******************************************************************************  
 Option Explicit  
 REM Define Global Variables  
 DIM Architecture : Set Architecture = Nothing  
 DIM INIFile    : INIFile     = "bldg_premium_full_Relative.ini"  
 DIM InstallFile  : InstallFile   = "setup.exe"  
 DIM TempFolder  : TempFolder    = "c:\temp\"  
 DIM LogFolderName : LogFolderName  = "bldg_premium_full"  
 DIM LogFolder   : LogFolder    = TempFolder & LogFolderName & "\"  
 DIM NewformaExist : NewformaExist  = False  
 DIM RelativePath : Set RelativePath = Nothing  
 REM Define the relative installation path  
 DefineRelativePath()  
 REM Disable File Security Warning  
 DisableWarning()  
 REM Map Drive Letter  
 MapDrive()  
 REM Create the Log Folder  
 CreateLogFolder()  
 REM Install RAC  
 InstallRevit()  
 REM Enable File Security Warning  
 EnableWarning()  
 REM Cleanup Global Memory  
 GlobalMemoryCleanup()  
 '*******************************************************************************  
 '*******************************************************************************  
 Sub DefineRelativePath()  
      REM Get File Name with full relative path  
      RelativePath = WScript.ScriptFullName  
      REM Remove file name, leaving relative path only  
      RelativePath = Left(RelativePath, InStrRev(RelativePath, "\"))  
 End Sub  
 '*******************************************************************************  
 Sub MapDrive()  
      REM Define Local Objects  
      DIM oShell : SET oShell = CreateObject("Wscript.Shell")  
      REM Define Local Variables  
      DIM DeleteDrive  : DeleteDrive  = "net use z: /delete /Y"  
      DIM MapDriveLetter : MapDriveLetter = "net use z:" & Chr(32) & Left(RelativePath, InStrRev(RelativePath, "\")-1)  
      oShell.Run DeleteDrive, 1, True  
      oShell.Run MapDriveLetter, 1, True  
      RelativePath = "z:\"  
      REM Cleanup Local Variables  
      Set DeleteDrive  = Nothing  
      Set MapDriveLetter = Nothing  
      Set oShell     = Nothing  
 End Sub  
 '*******************************************************************************  
 Sub CreateLogFolder()  
      REM Define Local Objects  
      DIM FSO : Set FSO = CreateObject("Scripting.FileSystemObject")  
      If NOT FSO.FolderExists(TempFolder) then  
           FSO.CreateFolder(TempFolder)  
      End If  
      If NOT FSO.FolderExists(LogFolder) then  
           FSO.CreateFolder(LogFolder)  
      End If  
      REM Cleanup Local Variables  
      Set FSO = Nothing  
 End Sub  
 '*******************************************************************************  
 Sub DetermineArchitecture()  
      REM Define Local Objects  
      DIM WshShell : Set WshShell = CreateObject("WScript.Shell")  
      REM Define Local Variables  
      DIM OSType : OSType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")  
      If OSType = "x86" then  
           Architecture = "x86"  
      elseif OSType = "AMD64" then  
           Architecture = "x64"  
      end if  
      REM Cleanup Local Memory  
      Set WshShell = Nothing  
      Set OSType  = Nothing  
 End Sub  
 '*******************************************************************************  
 Sub CheckFreeSpace()  
      REM Define Local Objects  
      DIM oShell : Set oShell = CreateObject( "WScript.Shell" )  
      REM Define Local Variables  
      DIM strComputer : strComputer = "."  
      DIM SystemDrive : SystemDrive = oShell.ExpandEnvironmentStrings("%SystemDrive%")  
      Set objWMIService = GetObject("winmgmts:" _  
           & "{impersonationLevel=impersonate}!\\" _  
           & strComputer & "\root\cimv2")  
      Set colDisks = objWMIService.ExecQuery _  
           ("Select * from Win32_LogicalDisk")  
      For Each objDisk in colDisks  
           If objDisk.DeviceID = SystemDrive then  
                Wscript.Echo "DeviceID: " & objDisk.DeviceID  
                Wscript.Echo "Free Disk Space: " _  
                     & objDisk.FreeSpace  
           End If  
      Next  
      REM Cleanup Local Memory  
      Set oShell   = Nothing  
      Set strComputer = Nothing  
      Set SystemDrive = Nothing  
 End Sub  
 '*******************************************************************************  
 Sub DisableWarning()  
      REM Define Local Objects  
      DIM oShell : Set oShell= CreateObject("Wscript.Shell")  
      DIM oEnv  : Set oEnv = oShell.Environment("PROCESS")  
      oEnv("SEE_MASK_NOZONECHECKS") = 1  
      REM Cleanup Memory  
      Set oShell = Nothing  
      Set oEnv  = Nothing  
 End Sub  
 '*******************************************************************************  
 Sub EnableWarning()  
      REM Define Local Objects  
      DIM oShell : Set oShell= CreateObject("Wscript.Shell")  
      DIM oEnv  : Set oEnv = oShell.Environment("PROCESS")  
      oEnv.Remove("SEE_MASK_NOZONECHECKS")  
      REM Cleanup Memory  
      Set oShell = Nothing  
      Set oEnv  = Nothing  
 End Sub  
 '*******************************************************************************  
 Sub InstallCpp()  
      REM Define Local Objects  
      DIM oShell : SET oShell = CreateObject("Wscript.Shell")  
      REM Define Local Variables  
      DIM Switches : Switches = Chr(32) & "/passive /uninstall /norestart /log" & Chr(32) & LogFolder & "InstallC++.log"  
      DIM Install : Install = RelativePath & "AdminImage\3rdParty\x86\VCRedist\2010\vcredist_x86_NEW.exe" & Switches  
      DIM NoWait  : NoWait  = False  
      DIM Wait   : Wait   = True  
      oShell.Run Install, 1, True  
      REM Cleanup Local Memory  
      Set Switches = Nothing  
      Set Install = Nothing  
      Set NoWait  = Nothing  
      Set oShell  = Nothing  
      Set Wait   = Nothing  
 End Sub  
 '*******************************************************************************  
 Sub UninstallCpp()  
      REM Define Local Objects  
      DIM oShell : SET oShell = CreateObject("Wscript.Shell")  
      REM Define Local Variables  
      DIM Switches  : Switches  = Chr(32) & "/passive /uninstall /norestart /log" & Chr(32) & LogFolder & "UninstallC++.log"  
      DIM Uninstall01 : Uninstall01 = RelativePath & "AdminImage\3rdParty\x86\VCRedist\2010\vcredist_x86.exe" & Switches  
      DIM Uninstall02 : Uninstall02 = RelativePath & "AdminImage\3rdParty\x86\VCRedist\2010\vcredist_x86_NEW.exe" & Switches  
      DIM NoWait   : NoWait = False  
      DIM Wait    : Wait  = True  
      oShell.Run Uninstall01, 1, True  
      oShell.Run Uninstall02, 1, True  
      REM Cleanup Local Memory  
      Set Switches  = Nothing  
      Set Uninstall01 = Nothing  
      Set Uninstall02 = Nothing  
      Set NoWait   = Nothing  
      Set oShell   = Nothing  
      Set Wait    = Nothing  
 End Sub  
 '*******************************************************************************  
 Sub InstallRevit()  
      REM Define Local Objects  
      DIM oShell : SET oShell = CreateObject("Wscript.Shell")  
      REM Define Local Variables  
      DIM Switches : Switches = Chr(32) & "/qb /I" & Chr(32) & RelativePath & "AdminImage\" & INIFile & Chr(32) & "/language en-us"  
      DIM Install : Install = RelativePath & "AdminImage\" & InstallFile & Switches  
      DIM NoWait  : NoWait  = False  
      DIM Wait   : Wait   = True  
      oShell.Run Install, 1, True  
      Call WaitForInstall()  
      REM Cleanup Local Variables  
      Set Install = Nothing  
      Set NoWait  = Nothing  
      Set oShell  = Nothing  
      Set Switches = Nothing  
      Set Wait   = Nothing  
 End Sub  
 '*******************************************************************************  
 Sub WaitForInstall()  
      REM Define Local Constants  
      CONST Timeout = 3000  
      CONST Timepoll = 500  
      REM Define Local Variables  
      DIM sQuery : sQuery = "select * from win32_process where name=" & Chr(39) & InstallFile & Chr(39)  
      DIM SVC  : Set SVC = GetObject("winmgmts:root\cimv2")  
      REM Define Local Variables  
      DIM cproc  : Set cproc  = Nothing  
      DIM iniproc : Set iniproc = Nothing  
      REM Wait until Second Setup.exe closes  
      Wscript.Sleep 30000  
      Set cproc = svc.execquery(sQuery)  
      iniproc = cproc.count  
      Do While iniproc = 1  
           wscript.sleep 5000  
           set svc=getobject("winmgmts:root\cimv2")  
           sQuery = "select * from win32_process where name=" & Chr(39) & InstallFile & Chr(39)  
           set cproc=svc.execquery(sQuery)  
           iniproc=cproc.count  
      Loop  
      REM Cleanup Local Variables  
      Set cproc  = Nothing  
      Set iniproc = Nothing  
      Set sQuery = Nothing  
      set SVC   = Nothing  
 End Sub  
 '*******************************************************************************  
 Sub GlobalMemoryCleanup()  
      REM Define Local Objects  
      DIM oShell : SET oShell = CreateObject("Wscript.Shell")  
      REM Define Local Variables  
      DIM DeleteDrive : DeleteDrive = "net use z: /delete /Y"  
      oShell.Run DeleteDrive, 1, True  
      Set Architecture = Nothing  
      Set INIFile    = Nothing  
      Set InstallFile  = Nothing  
      Set LogFolder   = Nothing  
      Set LogFolderName = Nothing  
      Set RelativePath = Nothing  
      Set TempFolder  = Nothing  
      REM Cleanup Local Memory  
      Set DeleteDrive = Nothing  
      Set oShell   = Nothing  
 End Sub  

0 comments:

Post a Comment