jazzyjeff Posted March 16, 2017 Posted March 16, 2017 (edited) Hey, I am wondering if somebody could assist me with this please? Goal: I'd like to customize the imaging process of an OS deployment in SCCM. I would like it to display the custom backgrounds that I have created (and successfully have working) only. I don't want the "Installation Progress" GUI displaying if at all possible. What's working: I have the task sequence working, and I am using BGInfo to change between the different images when the task sequence reaches a specific step in the process. What's not working: I have added a step where it will run a command line "WindowHide.exe" "Installation Progress", and this will work for bit, but once the next step of the task sequence loads, the GUI comes back. Now I could load repeat the step after each step, but that on it's own also creates a progress bar, so it is defeating the purpose I am hoping to run a script that will loop through the enter process checking for the GUI, and then if it exists it will hide it. The script would need to continuously run though. I tried doing this at the start of the task sequence, but the entire task sequence becomes stuck as the script is just looping and never finishes. If you have any ideas on how I can achieve this goal, I'd appreciate it. Thanks, Jeff EDIT: I have attached a photo of the GUI that I am trying to eliminate. Edited March 16, 2017 by jazzyjeff
jazzyjeff Posted April 7, 2017 Author Posted April 7, 2017 I got this working, and thought I'd briefly share what I did in case it helps someone else down the road. I created several scripts that look like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ;Opt("GUIResizeMode", $GUI_DOCKHCENTER+$GUI_DOCKVCENTER) Local $cpu,$memory,$netname,$mac,$netspeed _SplashInfo() #Region ### START Koda GUI section ### Form= $formMain = GUICreate("DeploymentStep1", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP) GUISetBkColor(0xFFFFFF) $imgBackground = GUICtrlCreatePic("\\server\share\image1.jpg", 0, 0, @DesktopWidth, @DesktopHeight) $Label1 = GUICtrlCreateLabel(@ComputerName, 568, 320, 226, 33) GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x808080) $Label2 = GUICtrlCreateLabel("CPU: " & $cpu, 568, 365, 226, 20) GUICtrlSetFont(-1, 7) $Label3 = GUICtrlCreateLabel("Memory: " & $memory, 568, 385, 226, 20) GUICtrlSetFont(-1, 7) $Label4 = GUICtrlCreateLabel("NIC: " & $netname, 568, 425, 226, 20) GUICtrlSetFont(-1, 7) $Label5 = GUICtrlCreateLabel("Net Speed: " & $netspeed, 568, 445, 226, 20) GUICtrlSetFont(-1, 7) $Label6 = GUICtrlCreateLabel("MAC: " & $mac, 568, 465, 226, 20) GUICtrlSetFont(-1, 7) $Label7 = GUICtrlCreateLabel("IP: " & @IPAddress1, 568, 485, 226, 20) GUICtrlSetFont(-1, 7) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### WinSetOnTop("DeploymentStep1","",1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _SplashInfo() $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems If $objItem.NetConnectionID = "Ethernet" Then $mac = $objItem.MACAddress $netname = $objItem.Name $netspeed = $objItem.Speed EndIf Next EndIf $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems $cpu = $objItem.Name Next EndIf $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems $memory = $objItem.TotalPhysicalMemory Next EndIf If $mac = "" Then $mac = "N/A" If $netname = "" Then $netname = "N/A" If $netspeed = "" Then $netspeed= "N/A" Else $netspeed = $netspeed /1000/1000 $netspeed = $netspeed & "mbps" EndIf If $cpu = "" Then $cpu = "N/A" If $memory = "" Then $memory = "N/A" Else $memory = Round($memory /1024/1024,0) $memory = $memory & "MB" EndIf EndFunc ;==>_SplashInfo You'll notice that I used WinSetOnTop to make sure that this GUI is what the user sees and nothing else. The background is an image that I created in Paint/GIMP, but I may actually change this now and do it all in AutoIT. The background image basically has a list of steps that are taken during the imaging process, and each background changes the colour of the text on the section that it is working on. In all I have 5 different sections, so therefore I have 5 different backgrounds and 5 different scripts. Each specific script is called when it hits a certain point in the task sequence. I don't actually call the compiled script above to run. I actually have another script that is called in the task sequence, and this then calls the other scripts. The reason for this is because i didn't want the task sequence to hang on the exe that I am calling and not progress. I knew that if I had another script calling a script and then kill the script that it would be able to proceed onto the next task. The calling script looks like this: ;Start Deployment Step If WinExists("DeploymentStep4") Then Run(@ScriptDir & "\DeploymentStep5.exe") Sleep(5000) ProcessClose("DeploymentStep4.exe") Exit ElseIf WinExists("DeploymentStep3") Then Run(@ScriptDir & "\DeploymentStep4.exe") Sleep(5000) ProcessClose("DeploymentStep3.exe") Exit ElseIf WinExists("DeploymentStep2") Then Run(@ScriptDir & "\DeploymentStep3.exe") Sleep(5000) ProcessClose("DeploymentStep2.exe") Exit ElseIf WinExists("DeploymentStep1") Then Run(@ScriptDir & "\DeploymentStep2.exe") Sleep(5000) ProcessClose("DeploymentStep1.exe") Exit Else Run(@ScriptDir & "\DeploymentStep1.exe") Exit EndIf It basically looks for the previous GUI and calls the next one in the script and then kills the old GUI. So in the task sequence before each different section starts, I add a Task (Run Command Line) and point it to the "Start Deployment Step" script, This then calls one of the 5 other scripts and ensures it is the GUi that is seen. I realise this isn't a great description, and I can offer more information if needed.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now