Jump to content

Add 1366x768 Support to WinPE


username667

Recommended Posts

Hi,

I'm wondering if it's possible to to add the new 16:9 native res of 1366x768 to a WinPE environment without adding a display driver.

For instance the standard VGA adapter supports 1280x800 (16:10) so I can use an EXE to set that res within PE, but if I try and set 1366x768 then I get no change. I can only imagine that this particular resolution isn't supported by the standard VGA adapter that WinPE uses.

Does anyone know of any way to either add support to the WinPE registry, hack the vga.sys file or create a new INF file for vga.sys so that I can re-add the standard VGA driver back to the WinPE environment with native 1366x768 support? Or am I going to have to wait for Windows 7 SP1 and it's associated PE version to be released?

Cheers.

Link to comment
Share on other sites


You can use unattend.xml to set the screen resultion in WinPE, it's still up to the driver. Here is a sample, just name the file unattend.xml and store it in the root of the WinPE image,

<?xml version="1.0" encoding="utf-8"?>

<unattend xmlns="urn:schemas-microsoft-com:unattend">

<settings pass="windowsPE">

<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">

<Display>

<ColorDepth>16</ColorDepth>

<HorizontalResolution>1024</HorizontalResolution>

<RefreshRate>60</RefreshRate>

<VerticalResolution>768</VerticalResolution>

</Display>

</component>

</settings>

</unattend>

Link to comment
Share on other sites

Thank you for the suggestion arwidmark, unfortunately it doesn't solve my problem. Perhaps I should have explained a little clearer.

When I boot into PE I then use DMI to look up the manufacturer and model name of the hardware, then based on the hardware name change the resolution as needed.

So when my PE boots I run an EXE to set the screen res to 1024x786 which is my default, then if a model = XXXXX then change to 1280x800 elseif model = YYYYY then change to 1366x786.

This works with the 1280x800 res because that appears to be supported by vga.sys, but the 1366x768 doesn't do anything (as I'm assuming the vga.sys throws an error to the process as it isn't listed as a supported res).

Link to comment
Share on other sites

Well, you can inject video drivers into WinPE even though it's not that common.

As for using the unattend.xml, if you have startnet.cmd calling your script to found out the hardware model, you can use it to generate the unattend.xml file on the fly (X: is writable, scratchspace), and then when you call wpeinit it will parse unattenx.xml and set the screen resolution.

Link to comment
Share on other sites

My apologies, I figured that the XML file would have read on OS load (PE) rather than with the wpeinit command.

I have tried your suggestion, outputting an XML file and changing the x and y values according to the screen size associated with the model detection, unfortunately it has not worked.

So as part of my Startnet.cmd, I call my script, which now does a 1024x786 exe command first (my default setting) then outputs the unattended example listed in this post, and if it's 1366 model then output that res, and if it's a 1280 model then output that res.

Startnet moved on past my script and runs the wpeinit command but the screen res doesn't change for either of the scenarios. I have confirmed that the unattend.xml file sitting in the root of X:\ is there and I have also confirmed that it is correct (with the correct quote marks in the correct places) as per the earlier post. I have also tried running wpeinit manually once I've confirmed that the xml file is created, but still nothing.

Startnet.cmd:


@echo off
cscript .\CustomScripts\ScreenRes\ScreenRes.vbs
wpeinit
wpeutil DisableFirewall
cscript autoscript.vbs

(Note: autoscript.vbs is what I use to carry out my PE tasks)

ScreenRes.vbs


Option Explicit

Dim objFSO, WshShell, objFile

Const wshYes = 6
Const wshNo = 7
Const wshYesNoDialog = 4
Const wshQuestionMark = 32
Const wshExclamation = 48

'++++++++++++++++++++++++++++++++++++++++++++++
'This is where the manufacturing information is found
Dim ModelNumber, Manufacturer, strComputer, objWMIService, objItem, colItems
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_BIOS",,48)
For Each objItem in colItems
Manufacturer = objItem.Manufacturer
Next
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystem",,48)
For Each objItem in colItems
ModelNumber = objItem.Model
Next
'++++++++++++++++++++++++++++++++++++++++++++++

Dim AbsPath:AbsPath = Replace(WScript.ScriptFullName, WScript.ScriptName, "") 'has trailing '\'

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")

Dim ModelSet1366, ModelSet1280, ModelSet1366Low, ModelSet1280Low, ModelNumberLow

ModelSet1366 = "<model set here>"

ModelSet1280 = "<model set here>"

ModelSet1366Low = LCase(ModelSet1366)
ModelSet1280Low = LCase(ModelSet1280)
ModelNumberLow = LCase(ModelNumber)

'Set to 1024x768 first
WshShell.Run AbsPath & "1024x768.exe", 1, True

Dim Output
If objFSO.FileExists ("x:\unattend.xml") Then
objFSO.DeleteFile("x:\unattend.xml")
End If
Set Output = objFSO.CreateTextFile("x:\unattend.xml")

If InStr(ModelSet1366Low, ModelNumberLow) Then
'Run 1366 Res Change
Output.Write "<?xml version=" & Chr(34) & "1.0" & Chr(34) & " encoding=" & Chr(34) & "utf-8" & Chr(34) & "?>" & vbCrLf
Output.Write "<unattend xmlns=" & Chr(34) & "urn:schemas-microsoft-com:unattend" & Chr(34) & ">" & vbCrLf
Output.Write "<settings pass=" & Chr(34) & "windowsPE" & Chr(34) & ">" & vbCrLf
Output.Write "<component name=" & Chr(34) & "Microsoft-Windows-Setup" & Chr(34) & " processorArchitecture=" & Chr(34) & _
"x86" & Chr(34) & " publicKeyToken=" & Chr(34) & "31bf3856ad364e35" & Chr(34) & " language=" & Chr(34) & "neutral" & Chr(34) & _
" versionScope=" & Chr(34) & "nonSxS" & Chr(34) & " xmlns:wcm=" & Chr(34) & "http://schemas.microsoft.com/WMIConfig/2002/State" & Chr(34) & ">" & vbCrLf
Output.Write "<Display>" & vbCrLf
Output.Write "<ColorDepth>16</ColorDepth>" & vbCrLf
Output.Write "<HorizontalResolution>1366</HorizontalResolution>" & vbCrLf
Output.Write "<RefreshRate>60</RefreshRate>" & vbCrLf
Output.Write "<VerticalResolution>768</VerticalResolution>" & vbCrLf
Output.Write "</Display>" & vbCrLf
Output.Write "</component>" & vbCrLf
Output.Write "</settings>" & vbCrLf
Output.Write "</unattend>" & vbCrLf
ElseIf InStr (ModelSet1280Low, ModelNumberLow) Then
'Run 1280 Res Change
Output.Write "<?xml version=" & Chr(34) & "1.0" & Chr(34) & " encoding=" & Chr(34) & "utf-8" & Chr(34) & "?>" & vbCrLf
Output.Write "<unattend xmlns=" & Chr(34) & "urn:schemas-microsoft-com:unattend" & Chr(34) & ">" & vbCrLf
Output.Write "<settings pass=" & Chr(34) & "windowsPE" & Chr(34) & ">" & vbCrLf
Output.Write "<component name=" & Chr(34) & "Microsoft-Windows-Setup" & Chr(34) & " processorArchitecture=" & Chr(34) & _
"x86" & Chr(34) & " publicKeyToken=" & Chr(34) & "31bf3856ad364e35" & Chr(34) & " language=" & Chr(34) & "neutral" & Chr(34) & _
" versionScope=" & Chr(34) & "nonSxS" & Chr(34) & " xmlns:wcm=" & Chr(34) & "http://schemas.microsoft.com/WMIConfig/2002/State" & Chr(34) & ">" & vbCrLf
Output.Write "<Display>" & vbCrLf
Output.Write "<ColorDepth>16</ColorDepth>" & vbCrLf
Output.Write "<HorizontalResolution>1280</HorizontalResolution>" & vbCrLf
Output.Write "<RefreshRate>60</RefreshRate>" & vbCrLf
Output.Write "<VerticalResolution>800</VerticalResolution>" & vbCrLf
Output.Write "</Display>" & vbCrLf
Output.Write "</component>" & vbCrLf
Output.Write "</settings>" & vbCrLf
Output.Write "</unattend>" & vbCrLf
Else
'Nothing - leave at 1024x768
End If

Output.Close

(Note: the 1024x786.exe is a VB6 command that I programmed up using some legacy VB6 screen res module)

If I use my created 1280x800.exe it does work, but my 1366x768.exe doesn't. Neither mode in this xml try has worked.

Thanks for you time so far.

Link to comment
Share on other sites

I tested with the posted unattend.xml in a vmware guest, and setting the screen resolution to 1366 x 768 using unattend.xml worked just fine.

As you found out you do need to start wpeinit.exe after updating/creating the unattend.xml file.

I also tested the unattend.xml you generate via the script you posted and it works fine too.... It set's the screen resolution nicely to 1366 x 768.

Did you try importing the video driver for the card into WinPE?

Link to comment
Share on other sites

I didn't import the card driver as I was trying to use the standard vga driver, I suspect that it doesn't support the res I want to do. Do you happen to know how much space adding standard Intel, nVidia and ATI driver support to a PE image takes up? So far I'm adding about 10mb of network and usb3 drivers, so my PE image is about 155mb. I'm PXE booting the image, so increasing the image by 20mb or more would be counterproductive to having my screen displaying at the correct resolution (I'll just keep using it at 1024x768 to keep the size down).

Thanks.

Link to comment
Share on other sites

Adding video drivers will increase the size with at least 30 - 40 MB...

I tried on a few physical machines, and 1400 x 1050 worked fine on them (using the standard VGA driver), maybe you can use that instead of 1366 x 768?

Link to comment
Share on other sites

Adding video drivers will increase the size with at least 30 - 40 MB...

I tried on a few physical machines, and 1400 x 1050 worked fine on them (using the standard VGA driver), maybe you can use that instead of 1366 x 768?

I might give that a go, thanks heaps for your time.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...