so my script was made to load drivers based on a selection from a combo box. i've created a VERY robust system to load drivers when imaging with wds or ghost using a winPE wim. WDS does not work correctly with injected drivers. so comes into play my script/program that loads from a winPE wim after wds loads. anyone knows WDS is pretty powerful but it does not always have proper drivers once the winPE loads. so my program loads drivers into winPE based on the model / device. so if we get a new model of laptop or desktop and we want to save up that image to wds we find 32bit drivers and we load them into my program.
wds then in turn loads my winPE with my program set to autolaunch and presenting all these options. if winPE contained a generic driver then all is good. if not then we go through my list and usually one of the drivers does work but in case it doesn't we add to my list.
that's just the pre-amble incase anyone asks what i'm doing.
reminder that this has worked flawlessly for the better part of a year. but now with more devices it's getting cumbersome to manually edit my code, then compile, then mount edit and recompile the winPE wim and inject my autoit program into it.
takes a maximum of 5 minutes but when you're constantly testing it gets VERY bad.
here's a snippet of the array for the combobox.
Local $aList[300][2] = [["___________", "___________"], _ ["ASUS", "ASUS"], _ ["HP Probook 4430s", "HP Probook 4430s"], _ ["Lenovo S10-3", "Lenovo S10-3"], _ ["Lenovo x200/x230", "Lenovo x200/x230"], _
so this populates a combo box that lists these entries.
i use a case select to determine which box was selected. very manual editing when i need to add another device.
Func selection() $sSel = GUICtrlRead($cb_platform) $iIndex = _ArraySearch($aList, $sSel) Select Case $iIndex = 1 ;~ ASUS $driver = (@scriptdir & "\drivers\hp32\Netrtl32.inf") $nothing = $option Case $iIndex = 2 ;~ HP Probook 4430s $driver = (@scriptdir & "\drivers\hp4430\hp86win7.inf") $nothing = $option Case $iIndex = 3 ;~ Lenovo S10-3 $driver = (@scriptdir & "\drivers\lenovos103\Netrtl32.inf") $nothing = $option EndFunc
this is the part of the script which i'm trying to revamp. right now my script works very awesome for what we're doing. however i want it more streamlined.
as you can see once a combobox selection is selected, then it goes to that CASE and populates those variables then it kicks down to a function that i have that continues either ghost or wds depending on a selected radio box.
this is what i have now for the array for the combobox.
$drivers_folder=_FileListToArray(@scriptdir & "\drivers\","*",2) $cb_platform = GUICtrlCreateCombo("",10,40,600,120,-1,-1) For $i=1 To Ubound($drivers_folder)-1 GUICtrlSetData($cb_platform,$drivers_folder[$i]) Next
this populates the combox based on the folder i have with each individual device. instead of creating a long winded array.
the problem i have now is i don't know how to make it load the driver within that folder without a case select.
i was thinking maybe something that got the name of the folder selected, then appended a "\*.inf" at the end to load. but i'm totally in the dark of how to do this.
if you'd like me to post all my code to help, please let me know.