Appending zac.log to ztoolkit.log

When a device is registered to a ZCM zone in phase2 of the ENGL Imaging Toolkit's build process, the registration log is saved in a file called c:\ztoolkit\zac.log.

For troubleshooting purposes it might be convenient to have this information in ztoolkit.log as well. This little vbscript, to be run in phase2-after.vbs, appends the zac.log to ztoolkit.log:


Function AppendZacLogfile

  on error resume next

  Set FSO = CreateObject("Scripting.FileSystemObject").OpenTextFile("c:\ztoolkit\zac.log",1)
  strZacLogging = FSO.ReadAll()

  Status = Utils.AppendLog("phase2-after.vbs: " & strZacLogging)

  If Err.Number <> 0 then  
    'MsgBox "An error occured in routine AppendZacLogfile()"
    Status = Utils.AppendLog("phase2-after.vbs: " & "AppendZacLogfile()" & " an error occurred " & Err.Number)
    Status = Utils.AppendLog("phase2-after.vbs: " & "AppendZacLogfile()" & " successfully")
  End If
End Function

Setting a bundle requirement for Windows bundles for virtual machines

Using this vbscript in one of the ENGL phase process 0,1 or 2, you can set a System Variable which reflects where you're working in a Virtual Machine:

IsVirtualMachine = Utils.IsVirtualMachine()

If IsVirtualMachine <> 0 Then
status = Utils.SetSystemEnvironmentVariable("VIRTUALMACHINE", "true")
status = Utils.SetSystemEnvironmentVariable("VIRTUALMACHINE", "false")
End If

Then if you want to install e.g. VMware Tools in phase 3, only on Virtual Machines, you can add this requirement to the Windows bundle:

Environment Variable Value 'VIRTUALMACHINE' Equal to: true

Doing so, this Windows bundle will only be installed on virtual machines and will be skipped on physical machines.