username667 Posted May 5, 2010 Posted May 5, 2010 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.
arwidmark Posted May 6, 2010 Posted May 6, 2010 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>
username667 Posted May 7, 2010 Author Posted May 7, 2010 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).
arwidmark Posted May 7, 2010 Posted May 7, 2010 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.
username667 Posted May 7, 2010 Author Posted May 7, 2010 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 offcscript .\CustomScripts\ScreenRes\ScreenRes.vbswpeinitwpeutil DisableFirewallcscript autoscript.vbs(Note: autoscript.vbs is what I use to carry out my PE tasks)ScreenRes.vbsOption ExplicitDim objFSO, WshShell, objFileConst wshYes = 6Const wshNo = 7Const wshYesNoDialog = 4Const wshQuestionMark = 32Const wshExclamation = 48'++++++++++++++++++++++++++++++++++++++++++++++'This is where the manufacturing information is foundDim ModelNumber, Manufacturer, strComputer, objWMIService, objItem, colItemsstrComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM Win32_BIOS",,48) For Each objItem in colItems Manufacturer = objItem.ManufacturerNextSet objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM Win32_ComputerSystem",,48) For Each objItem in colItems ModelNumber = objItem.ModelNext'++++++++++++++++++++++++++++++++++++++++++++++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, ModelNumberLowModelSet1366 = "<model set here>"ModelSet1280 = "<model set here>"ModelSet1366Low = LCase(ModelSet1366)ModelSet1280Low = LCase(ModelSet1280)ModelNumberLow = LCase(ModelNumber)'Set to 1024x768 firstWshShell.Run AbsPath & "1024x768.exe", 1, TrueDim OutputIf objFSO.FileExists ("x:\unattend.xml") Then objFSO.DeleteFile("x:\unattend.xml")End IfSet 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>" & vbCrLfElseIf 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>" & vbCrLfElse 'Nothing - leave at 1024x768End IfOutput.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.
arwidmark Posted May 7, 2010 Posted May 7, 2010 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?
username667 Posted May 7, 2010 Author Posted May 7, 2010 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.
arwidmark Posted May 7, 2010 Posted May 7, 2010 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?
username667 Posted May 8, 2010 Author Posted May 8, 2010 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.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now