Overview

By setting the project display resolution to 0 x 0 within the Expert View the maximum resolution that is supported by the graphics card and monitor will be set during the build process.

If the build process is unable to query the graphics card or monitor a default resolution of 1024x768 is set.

Whilst this works in most scenarios some cards occasionally report a higher resolution than the attached display actually supports which may result in a blank or black screen.


Solution

Use the drivers image to deliver a script that modifies the project settings to set a static resolution for this machine type.


Procedure

Done Task
 
1. Create script
 
2. Add script to drivers image
 
3. Set custom properties
 
4. Deploy drivers image
 
5. Test updated drivers image


  1. Edit script

    Create the script below editing it as appropriate to set the required screen resolution

    ' ENGL Imaging Toolkit 
    ' Script to set the display settings to specific values for a particular machine type 
    ' Script added as a custom driver in the specific model's driver pack 
    
    ' Attach to ENGL Ztoolkit ActiveX Control 
    Set Utils     = CreateObject("ENGL.Ztoolkit.Utils") 
    
    ' Specify the required values here: 
    xMax = 1280 
    yMax = 768 
    bpp = 32 
    
    Utils.AppendLog "Setting Display Resolution to:" 
    Utils.AppendLog "xMax    : " & xMax 
    Utils.AppendLog "yMax    : " & yMax 
    Utils.AppendLog "bpp     : " & bpp 
    
    
    ' Update zmainrun.xml file to set screen resolution to defined values (Screen resolution will be set after a reboot) 
    Utils.AppendLog "   Updating zmainrun.xml" 
    EnglXmlSetElementValue "c:\ztoolkit\zmainrun.xml", "//ENGL/ImagingToolkit/BuildProcess/Branding/Display/Width", xMax 
    EnglXmlSetElementValue "c:\ztoolkit\zmainrun.xml", "//ENGL/ImagingToolkit/BuildProcess/Branding/Display/Height", yMax
    EnglXmlSetElementValue "c:\ztoolkit\zmainrun.xml", "//ENGL/ImagingToolkit/BuildProcess/Branding/Display/BitsPerPixel", bpp
    Utils.AppendLog "Update complete" 
    
    ' Function to update zmainrun.xml file 
    Function EnglXmlSetElementValue( path, xpath, value) 
    
          EnglXmlSetElementValue = 1     ' Return error 
          Set xmlDoc = CreateObject("Microsoft.XMLDOM") 
          xmlDoc.async = False 
          xmlDoc.resolveExternals = False 
          xmlDoc.load( path ) 
          If (xmlDoc.parseError.errorCode  0) Then 
               Dim myErr 
               Set myErr = xmlDoc.parseError 
               MsgBox("You have error " & myErr.reason & "(line: " & myErr.line & ", pos: " & myErr.linepos & ")") 
          Else 
               ' Get node 
               Set objNode = xmlDoc.selectSingleNode(xpath) 
    
               ' objNode.Value = value 
               objNode.Text = value 
    
               ' Save XML 
               xmlDoc.save path 
          End If 
    
          EnglXmlSetElementValue = 0     ' Success 
    
    End Function 
     Save the script as screenres.vbs then add it to a zip file named screenres.zip
  2. Add script to drivers image

    • Open Build Console
    • Select the Driver Pack you wish to update
    • Right click on the Driver Pack then select Manually add driver file
    • Populate the following information:

      Setting Value
      Driver class System
      Driver description ScreenRes
      Driver version 1.0

       Then click Next
    • When prompted browse for and import the screenres.zip file then click Next
    • Click Finish to complete the process
  3.  The driver should now be listed in the Driver Pack.
  4. Set custom properties

    • Right click on the newly imported driver then select Analyse
    • Right click on the newly imported driver then select Properties
    •  Then click Ok to save the change.
  5. Set the Command Line to %windir%\system32\wscript.exe "%SystemDrive%\ztoolkit\drivers\system\ScreenRes\screenres.vbs"
  6. Deploy drivers image

    Right-click the Driver Pack then select Create driver image

     Once the drivers image has been created successfully copy it to the appropriate folder on the imaging server.

  7. Test updated drivers image

    • PXE boot the problem machine to the Zim menu
    • Select Restore Menu
    • Select and restore the appropriate project
    • Monitor the machine as it builds. The resolution should be set correctly at the end of phase1.

If you have any problems or questions about the script or steps in this TID  please contact the ENGL support team