DerekL
Members-
Posts
12 -
Joined
-
Last visited
Profile Information
-
Location
Cambridge, UK
DerekL's Achievements
Seeker (1/7)
0
Reputation
-
Hi Guy's, It's OK, I now know what the problem is, you can forget this one. Thanks Derek
-
Hi Everyone, So I working on a script that will deploy images of Windows 7, to my Companies machines, it's been working, but all of a sudden for no reason that I can see, I've started to get an error, here's the code that is causing the problem: Func sysprepvista() FileCopy("x:\windows\system32\sysprep\sysprep.xml", "c:\windows\system32\sysprep\sysprep.xml") $oOXml = _XMLFileOpen("c:\windows\system32\sysprep\sysprep.xml", 'xmlns:sysprepxml="urn:schemas-microsoft-com:unattend"') If @error Then MsgBox(4096, "File Open Error", "Error Opening File. Exiting program") Exit EndIf Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='oobeSystem']/sysprepxml:component[@name='Microsoft-Windows-International-Core']/sysprepxml:InputLocale" _XMLUpdateField($path, IniRead($inifile, "Keyboardlocale", GUICtrlRead($Keyboard), "en-US")) Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='oobeSystem']/sysprepxml:component[@name='Microsoft-Windows-International-Core']/sysprepxml:SystemLocale" _XMLUpdateField($path, IniRead($inifile, "Keyboardlocale", GUICtrlRead($Keyboard), "en-US")) Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='oobeSystem']/sysprepxml:component[@name='Microsoft-Windows-International-Core']/sysprepxml:UILanguage" _XMLUpdateField($path, IniRead($inifile, "Keyboardlocale", GUICtrlRead($Keyboard), "en-US")) Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='oobeSystem']/sysprepxml:component[@name='Microsoft-Windows-International-Core']/sysprepxml:UserLocale" _XMLUpdateField($path, IniRead($inifile, "Keyboardlocale", GUICtrlRead($Keyboard), "en-US")) MsgBox(0, "localinfo", IniRead($inifile, "Keyboardlocale", GUICtrlRead($Keyboard), "en-US")) Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='specialize']/sysprepxml:component[@name='Microsoft-Windows-UnattendedJoin']/sysprepxml:Identification/sysprepxml:Credentials/sysprepxml:Username" _XMLUpdateField($path, GUICtrlRead($UserName)) Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='specialize']/sysprepxml:component[@name='Microsoft-Windows-UnattendedJoin']/sysprepxml:Identification/sysprepxml:Credentials/sysprepxml:Password" _XMLUpdateField($path, GUICtrlRead($Password)) Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='specialize']/sysprepxml:component[@name='Microsoft-Windows-UnattendedJoin']/sysprepxml:Identification/sysprepxml:Credentials/sysprepxml:Domain" _XMLUpdateField($path, GUICtrlRead($Domain)) Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='specialize']/sysprepxml:component[@name='Microsoft-Windows-UnattendedJoin']/sysprepxml:Identification/sysprepxml:JoinDomain" _XMLUpdateField($path, GUICtrlRead($Domain)) MsgBox(0, "Progress", "Added username, password and domain") Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='specialize']/sysprepxml:component[@name='Microsoft-Windows-Shell-Setup']/sysprepxml:ComputerName" _XMLUpdateField($path, GUICtrlRead($ComputerName)) Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='specialize']/sysprepxml:component[@name='Microsoft-Windows-Shell-Setup']/sysprepxml:TimeZone" _XMLUpdateField($path, GUICtrlRead($TimeZone)) Local $path = "/sysprepxml:unattend/sysprepxml:settings[@pass='oobeSystem']/sysprepxml:component[@name='Microsoft-Windows-Shell-Setup']/sysprepxml:TimeZone" _XMLUpdateField($path, GUICtrlRead($TimeZone)) MsgBox(0, "Progress", "Added computername and timezone") MsgBox(0, "Progress", "Sorted keyboard locales") $oOXml = _XMLFileOpen("x:\windows\system32\drivers.xml", 'xmlns:test="urn:schemas-microsoft-com:unattend"') If @error Then MsgBox(4096, "File Open Error", "Error Opening File. Exiting program") Exit EndIf Local $path = "/test:unattend/test:settings[@pass='offlineServicing']/test:component[@name='Microsoft-Windows-PnpCustomizationsNonWinPE']/test:DriverPaths/test:PathAndCredentials/test:Path" Local $letter = finddriveletter() _XMLUpdateField($path, $letter & ":\Out-of-Box Drivers") FileCopy("x:\windows\system32\drivers.xml", "c:\windows\system32\drivers.xml") FileDelete("c:\windows\panther\sysprep.xml") FileDelete("c:\windows\panther\unattend.xml") FileCopy("c:\windows\system32\sysprep\sysprep.xml", "c:\windows\panther\sysprep.xml") FileCopy("c:\windows\system32\sysprep\sysprep.xml", "c:\windows\panther\unattend.xml") FileWriteLine("C:\Windows\Setup\SetupComplete.cmd", "del /Q /F c:\windows\system32\sysprep\sysprep.xml") FileWriteLine("C:\Windows\Setup\SetupComplete.cmd", "del /Q /F c:\windows\panther\sysprep.xml") FileWriteLine("C:\Windows\Setup\SetupComplete.cmd", "del /Q /F c:\windows\panther\unattend.xml") If (GUICtrlRead($KBoxAgent) == $GUI_CHECKED) Then FileWriteLine("C:\Windows\Setup\SetupComplete.cmd", "\\kbox.emea.arm.com\client\agent_provisioning\windows_platform\KInstallerSetup.exe -server=kbox.emea.arm.com -display_mode=silent") EndIf RunWait("notepad.exe c:\windows\system32\sysprep\sysprep.xml") injectdrivers() EndFunc ;==>sysprepvista So the line: If @error Then MsgBox(4096, "File Open Error", "Error Opening File. Exiting program") is causing the script to show the error message, and exit, I have an include for the _XMLDomWrapper.au3 and I'm including the constants when it's compiled, it's being run from a WinPE 3.0 USB stick, for the life of me I can't figure out what the problem is, any idea's Thanks Derek
-
Hi Jarvis, Thank you very much for your help, I haven't tried any of the suggestions yet!, but I have found the Script-O-Matic script, I'm sure that with this we will be able to crack the problem. Once again thank you very much. Regards Derek
-
Hi FinalVersion, I was already fully aware of that, I did appologise from the out set, I was rather hoping to catch the attention of the author of CompInfo.au3, I had already tried posting in the General Support Forum. But thank you for your kind words of wisdom. Cheers.
-
Hi Folks, I know this is'nt a general forum for help, but I am using _ComputerGetSystem in the snippet of code below, which works with out any problems when run from the editor, but if I compile it and run another machine I get the following error: 'AutoIt Error' box come up that say's 'Line -1:' and then 'Error: Variable must be of type "Object" Func GetSystemInfo() Msgbox(0,"Got to GetSystemInfo","GetSystemInfo") ; use a library to quickly grab some entries from the systeminfo information ;$test = _ComputerGetSystem($cinfo) _ComputerGetSystem($cinfo) For $i = 1 To $cinfo[0][0] Step 1 Next Msgbox(0,"Got to _ComputerGetSystem",$cinfo) $ginfomake = $cinfo[1][21] $ginfomodel = $cinfo[1][22] ;Msgbox(0,"Model is:",$ginfomake & " " & $ginfomodel) ; read the list of images from the inifile for the corresponding model we've discovered $dghostimage = IniRead("k:\imagelist.ini", "ImageRef2", $ginfomodel, "Image not found") ; update the form field to show the select image file GUICtrlSetData($wimfile,"k:\" & $dghostimage) ; do the same for the model $rno = IniRead("k:\imagelist.ini", "ImageNumber", $ginfomodel, "Image not found") GUICtrlSetData($model, $rno) GUICtrlSetData($SuggestModelLabel, "Suggested Model: " & $rno) EndFunc It seems to be the _ComputerGetSystem($cinfo) line that is causing the problem, and I assume that it's because the $cI_Compname variable isn't set anywhere in the code, I want to use this on systems that are sysprep'ed for deploying images via a WinPE environment using ImageX, any idea's on how stop the script from falling over when run as an .exe Cheers Derek
-
Hi again, I have been through the code and Dim'ed all the variables, but am still getting the error, it seems to be to do with this snippet of code: Func GetSystemInfo() Msgbox(0,"Got to GetSystemInfo","GetSystemInfo") ; use a library to quickly grab some entries from the systeminfo information ;$test = _ComputerGetSystem($cinfo) _ComputerGetSystem($cinfo) For $i = 1 To $cinfo[0][0] Step 1 Next Msgbox(0,"Got to _ComputerGetSystem",$cinfo) $ginfomake = $cinfo[1][21] $ginfomodel = $cinfo[1][22] ;Msgbox(0,"Model is:",$ginfomake & " " & $ginfomodel) ; read the list of images from the inifile for the corresponding model we've discovered $dghostimage = IniRead("k:\imagelist.ini", "ImageRef2", $ginfomodel, "Image not found") ; update the form field to show the select image file GUICtrlSetData($wimfile,"k:\" & $dghostimage) ; do the same for the model $rno = IniRead("k:\imagelist.ini", "ImageNumber", $ginfomodel, "Image not found") GUICtrlSetData($model, $rno) GUICtrlSetData($SuggestModelLabel, "Suggested Model: " & $rno) EndFunc It seems to be the _ComputerGetSystem($cinfo) line that is causing the problem, I have the #include <CompInfo.au3> statement in the script, but when I compile the script even although I have checked the box to Add required Constants *.au3 to your script, it doesn't appear to be doing it, CompInfo.au3 resides in C:\Program Files\AutoIt3\Include Here's the text from the compile: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper_Gui.exe" /in "C:\Users\derlam01\Documents\WinPE Project\New Scripts\AutoImage.au3" +>15:21:18 Starting AutoIt3Wrapper GUI v.2.0.0.0 -> 2 Change(s) made. +>15:21:36 Starting AutoIt3Wrapper v.2.0.0.3 Environment(Language:0409 Keyboard:00000809 OS:WIN_VISTA/ CPU:X64 OS:X86) +>Check for missing standard constants/udf include files: 0 include(s) were added >Running AU3Check (1.54.14.0) from:C:\Program Files\AutoIt3 +>15:21:37 AU3Check ended.rc:0 >Running:(3.3.0.0):C:\Program Files\AutoIt3\aut2exe\aut2exe.exe /in "C:\Users\derlam01\Documents\WinPE Project\New Scripts\AutoImage.au3" /out "C:\Users\derlam01\Documents\WinPE Project\New Scripts\AutoImage.exe" /comp 3 /pack /Bin C:\Users\derlam01\AppData\Local\Temp\AutoItSC.bin Ultimate Packer for eXecutables Copyright © 1996 - 2008 UPX 3.03w Markus Oberhumer, Laszlo Molnar & John Reiser Apr 27th 2008 File size Ratio Format Name -------------------- ------ ----------- ----------- 612864 -> 290304 47.37% win32/pe AutoImage.exe Packed 1 file. +>15:21:42 Aut2exe.exe ended.rc:0 +>15:21:42 Created program:C:\Users\derlam01\Documents\WinPE Project\New Scripts\AutoImage.exe ->Warning: This is an Unicode compiled script and will not run on Win9x/ME. +>15:21:42 AutoIt3Wrapper Finished >Exit code: 0 Time: 24.698 Any idea's where I am going wrong. Cheers Derek
-
Hi Melba23, Thanks for that, can't believe I missed that Cheers Derek
-
Hi, Thanks Melba23 very good I have attached the script I'm using. Cheers Derek #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=AutoImageTest.exe #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; *** Start added by AutoIt3Wrapper *** #include <Constants.au3> ; *** End added by AutoIt3Wrapper *** #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Include <string.au3> #Include <Array.au3> #Include <GuiTreeView.au3> #include <process.au3> #include <WinAPI.au3> #include <GUIComboBox.au3> ; Script for the deployment of Windows 7 to Arm Machines around the world ; This first part of the script was created automatically by the Koda Forms Designer ; This Form=c:\users\derlam01\documents\winpe project\autoimage.kxf will be placed on the network share here ******* ADD SHARE LOCATION ********* ; This the gimagex_com.dll setup $initWimCtrl = ObjCreate("GimageX.GimageXCtrl") Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=c:\users\derlam01\documents\winpe project\autoimage.kxf $Form1_1 = GUICreate("AutoImage 3.0 for Arm", 625, 536, 459, 170) GUISetBkColor(0xC0DCC0) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1_1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1_1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1_1Restore") $SelectWimLabel = GUICtrlCreateLabel("Select Wim File:", 56, 64, 117, 24) GUICtrlSetFont($SelectWimLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($SelectWimLabel, "SelectWimLabelClick") $SelectModelLabel = GUICtrlCreateLabel("Select Model:", 56, 104, 100, 24) GUICtrlSetFont($SelectModelLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($SelectModelLabel, "SelectModelLabelClick") $KeyboardLable = GUICtrlCreateLabel("Keyboard Layout:", 56, 144, 127, 24) GUICtrlSetFont($KeyboardLable, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($KeyboardLable, "KeyboardLableClick") $Keyboard = GUICtrlCreateCombo("", 184, 144, 209, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) ;GUICtrlSetData(-1, "US|German|France|Norway|Belgium|Swedish") ; add other item snd set a new default GUICtrlSetOnEvent($Keyboard, "KeyboardChange") $TimeZoneLabel = GUICtrlCreateLabel("Time Zone:", 56, 184, 83, 24) GUICtrlSetFont($TimeZoneLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($TimeZoneLabel, "TimeZoneLabelClick") $TimeZone = GUICtrlCreateCombo("", 184, 184, 209, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) ;GUICtrlSetData(-1, "CET|Pacific (US)|Central (US)|Eastern (US)") ; add other item snd set a new default GUICtrlSetOnEvent($TimeZone, "TimeZoneChange") $ImageButton = GUICtrlCreateButton("Image", 48, 456, 89, 41, $WS_GROUP) GUICtrlSetOnEvent($ImageButton, "ImageButtonclick") $CaptureButton = GUICtrlCreateButton("Capture Image", 200, 456, 89, 41, $WS_GROUP) GUICtrlSetOnEvent($CaptureButton, "CaptureButtonclick") $MakeUSBButton = GUICtrlCreateButton("Make USB", 352, 456, 89, 41, $WS_GROUP) GUICtrlSetOnEvent($MakeUSBButton, "MakeUSBButtonclick") $CancelButton = GUICtrlCreateButton("Cancel", 496, 456, 89, 41, $WS_GROUP) GUICtrlSetOnEvent($CancelButton, "CancelButtonclick") $Progress1 = GUICtrlCreateProgress(88, 408, 449, 17) $ProgressLabel = GUICtrlCreateLabel("Progress:", 88, 376, 71, 24) GUICtrlSetFont($ProgressLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($ProgressLabel, "ProgressLabelClick") $ComputerNameLabel = GUICtrlCreateLabel("Computer Name:", 248, 224, 124, 24) GUICtrlSetFont($ComputerNameLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($ComputerNameLabel, "ComputerNameLabelClick") $ComputerName = GUICtrlCreateInput("", 392, 224, 153, 21) GUICtrlSetOnEvent($ComputerName, "ComputerNameChange") $DomainNameLabel = GUICtrlCreateLabel("Domain", 56, 264, 63, 24) GUICtrlSetFont($DomainNameLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($DomainNameLabel, "DomainNameLabelClick") $Domain = GUICtrlCreateCombo("", 160, 264, 193, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) ;GUICtrlSetData(-1, "usa.arm.com|asiapac.arm.com") ; add other item snd set a new default GUICtrlSetOnEvent($Domain, "DomainChange") $UserNameLabel = GUICtrlCreateLabel("User Name:", 56, 304, 88, 24) GUICtrlSetFont($UserNameLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($UserNameLabel, "UserNameLabelClick") $UserName = GUICtrlCreateInput("", 160, 304, 193, 21) GUICtrlSetOnEvent($UserName, "UserNameChange") $PassWordLabel = GUICtrlCreateLabel("Password:", 56, 344, 77, 24) GUICtrlSetFont($PassWordLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($PassWordLabel, "PassWordLabelClick") $Password = GUICtrlCreateInput("", 160, 344, 193, 21) GUICtrlSetOnEvent($Password, "PasswordChange") $DriveBrowse = GUICtrlCreateButton("Browse", 400, 64, 65, 25, $WS_GROUP) GUICtrlSetOnEvent($DriveBrowse, "DriveBrowseClick") $SuggestModelLabel = GUICtrlCreateLabel("Suggested Model:", 56, 9, 421, 24) GUICtrlSetFont($SuggestModelLabel, 12, 800, 0, "MS Sans Serif") GUICtrlSetResizing($SuggestModelLabel, $GUI_DOCKWIDTH) GUICtrlSetOnEvent($SuggestModelLabel, "SuggestModelLabelClick") $wimfile = GUICtrlCreateInput("", 184, 64, 209, 21) GUICtrlSetOnEvent($wimfile, "wimfileChange") $Icon1 = GUICtrlCreateIcon("C:\Windows\System32\imageres.dll", -83, 512, 56, 57, 57, BitOR($SS_NOTIFY,$WS_GROUP)) GUICtrlSetOnEvent($Icon1, "Icon1Click") $Model = GUICtrlCreateCombo("", 184, 104, 209, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetOnEvent($Model, "ModelChange") $KBoxAgent = GUICtrlCreateCheckbox("Install KBox Agent", 56, 219, 177, 33) GUICtrlSetFont($KBoxAgent, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($KBoxAgent, "KBoxAgentClick") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;Declare varibles here Dim $wimfile, $SelectedWim, $hApplySourceEdit, $treeview, $read, $line, $systeminfo, $info, $sCmd, $ginfomodel, $ginfomake Dim $lastcount, $dghostimage, $rno, $rdomain, $defdom, $rkeyboard, $defkey, $rTimeZone, $deftime Dim $d, $k, $t $d = 1 $k = 1 $t = 1 $lastcount = 0 ; Start of Main *************************************** Call("DomainChange") Call("KeyboardChange") Call("TimeZoneChange") Call("GetSystemInfo") While 1 Sleep(100) WEnd ; End of Main ***************************************** Func GetSystemInfo() If FileExists("X:\ginfo.txt") Then FileDelete("X:\ginfo.txt") EndIf RunWait(@ComSpec & " /c " & 'systeminfo.exe /FO LIST > "X:\ginfo.txt"', @WindowsDir, @SW_HIDE) $systeminfo = FileOpen("X:\ginfo.txt",0) $line = FileReadLine($systeminfo,14) $ginfomodel = StringRight($line,7) $line = "" $line = FileReadLine($systeminfo,13) $ginfomake = StringRight($line,6) ;Msgbox(0,"Model is:",$ginfomake & " " & $ginfomodel) $dghostimage = IniRead("k:\imagelist.ini", "ImageRef2", $ginfomodel, "Image not found") $rno = IniRead("k:\imagelist.ini", "ImageNumber", $ginfomodel, "Image not found") ;MsgBox(1,"",$dghostimage) ;MsgBox(1,"",$rno) GUICtrlSetData($SuggestModelLabel, "Suggested Model: " & $rno) EndFunc Func CancelButtonclick() Exit EndFunc Func CaptureButtonclick() MsgBox(0,"Capture Image Button", "Sorry this function is not yet implemented") EndFunc Func ComputerNameChange() EndFunc Func ComputerNameLabelClick() EndFunc Func DomainChange() while $d = 1 $rdomain = IniRead("k:\Domain.ini", "Domain", "Domain", "") $defdom = StringSplit($rdomain,"|") GUICtrlSetData($Domain, $rdomain, $defdom[1]) ; add Domain items snd set a new default $d = $d + 1 WEnd EndFunc Func DomainNameLabelClick() EndFunc Func DriveBrowseClick() Dim $x If $lastcount > 0 Then GuiCtrlSetData($Model,"") EndIf $SelectedWim = FileOpenDialog("Open wim file:", "k:\", "Image (*.wim)", 2) If @error Then MsgBox(4096,"","No File(s) chosen") Else $SelectedWim = StringReplace($SelectedWim, "|", @CRLF) ;MsgBox(4096,"","You chose " & $SelectedWim) GUICtrlSetData ($wimfile,$SelectedWim) ;read in xml file $initWimCtrl.Source = $SelectedWim $initWimCtrl.GetWimInfo $lastcount = $initWimCtrl.ImageCount For $x = 1 to $initWimCtrl.ImageCount $initWimCtrl.ImageIndex = $x $initWimCtrl.GetImageInfo GUICtrlSetData ($Model,$initWimCtrl.ImageName) Next EndIf EndFunc Func Form1_1Close() Exit EndFunc Func Form1_1Maximize() EndFunc Func Form1_1Minimize() EndFunc Func Form1_1Restore() EndFunc Func Icon1Click() EndFunc Func ImageButtonclick() MsgBox(0,"Image Button", "Sorry this function is not yet implemented") EndFunc Func KBoxAgentClick() EndFunc Func KeyboardChange() While $k = 1 $rkeyboard = IniRead("k:\Domain.ini", "Keyboardlocale", "Keyboardlocale", "") $defkey = StringSplit($rkeyboard,"|") GUICtrlSetData($Keyboard, $rkeyboard, $defkey[1]) ; add Keyboard items snd set a new default $k = $k + 1 WEnd EndFunc Func KeyboardLableClick() EndFunc Func MakeUSBButtonclick() MsgBox(0,"Make USB Button", "Sorry this function is not yet implemented") EndFunc Func ModelChange() EndFunc Func PasswordChange() EndFunc Func PassWordLabelClick() EndFunc Func ProgressLabelClick() EndFunc Func SelectModelLabelClick() EndFunc Func SelectWimLabelClick() EndFunc Func SuggestModelLabelClick() EndFunc Func TimeZoneChange() While $t = 1 $rTimeZone = IniRead("k:\Domain.ini", "TimeZones", "TimeZones", "") $deftime = StringSplit($rTimeZone,"|") GUICtrlSetData($TimeZone, $rTimeZone, $deftime[1]) ; add TimeZones items snd set a new default $t = $t + 1 WEnd EndFunc Func TimeZoneLabelClick() EndFunc Func UserNameChange() EndFunc Func UserNameLabelClick() EndFunc Func wimfileChange() EndFunc
-
Hi Guy's, I'm starting a script from a winpe environment, that uses a GUI and I'm getting an 'AutoIt Error' box come up that say's 'Line -1:' and then 'Error: Variable must be of type "Object" ' Can anyone give me some idea of what the error is and what to look for, I only get this on the compiled script, running it from the editor it works fine. Thanks Derek
-
GImageX Deployment of Windows 7 questions
DerekL replied to DerekL's topic in AutoIt GUI Help and Support
Hi Crump, Thanks for that, yes the COM certainly does make life a little easier, when I get my application finished, will I have to ensure that the .dll is included in the WinPE build? Cheers DerekL -
GImageX Deployment of Windows 7 questions
DerekL replied to DerekL's topic in AutoIt GUI Help and Support
Hi Guy's, Thanks for the advice Crump, so I have started a little work, and have designed a form with the functionality I would like, and have managed to get the Browse to a .wim file working, don't laugh I'm new to this Can anyone give me some help with how to extract the Image information from the .wim file to select an image, thanks in advance, my code is below. Regards DerekL #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Include <string.au3> #Include <Array.au3> #Include <GuiTreeView.au3> ; Script for the deployment of Windows 7 to Company Machines around the world ; This first part of the script was created automatically by the Koda Forms Designer ; This Form=c:\users\********\documents\winpe project\autoimage.kxf will be placed on the network share here ******* ADD SHARE LOCATION ********* Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=c:\users\********\documents\scripts\autoimage.kxf $Form1_1 = GUICreate("AutoImage 3.0 for Company A", 625, 536, 381, 198) GUISetBkColor(0xC0DCC0) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1_1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1_1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1_1Restore") $SelectWimLabel = GUICtrlCreateLabel("Select Wim File:", 56, 24, 117, 24) GUICtrlSetFont($SelectWimLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($SelectWimLabel, "SelectWimLabelClick") $SelectModelLabel = GUICtrlCreateLabel("Select Model:", 56, 64, 100, 24) GUICtrlSetFont($SelectModelLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($SelectModelLabel, "SelectModelLabelClick") $KBoxAgent = GUICtrlCreateRadio("Install KBox Agent", 56, 176, 169, 33) GUICtrlSetFont($KBoxAgent, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($KBoxAgent, "KBoxAgentClick") $KeyboardLable = GUICtrlCreateLabel("Keyboard Layout:", 56, 104, 127, 24) GUICtrlSetFont($KeyboardLable, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($KeyboardLable, "KeyboardLableClick") $Keyboard = GUICtrlCreateCombo("", 184, 104, 209, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetOnEvent($Keyboard, "KeyboardChange") $TimeZoneLabel = GUICtrlCreateLabel("Time Zone:", 56, 144, 83, 24) GUICtrlSetFont($TimeZoneLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($TimeZoneLabel, "TimeZoneLabelClick") $TimeZone = GUICtrlCreateCombo("", 184, 144, 209, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetOnEvent($TimeZone, "TimeZoneChange") $ImageButton = GUICtrlCreateButton("ImageButton", 48, 456, 89, 41, $WS_GROUP) GUICtrlSetOnEvent($ImageButton, "ImageButtonclick") $CaptureButton = GUICtrlCreateButton("Capture Image", 200, 456, 89, 41, $WS_GROUP) GUICtrlSetOnEvent($CaptureButton, "CaptureButtonclick") $MakeUSBButton = GUICtrlCreateButton("Make USB", 352, 456, 89, 41, $WS_GROUP) GUICtrlSetOnEvent($MakeUSBButton, "MakeUSBButtonclick") $CancelButton = GUICtrlCreateButton("Cancel", 496, 456, 89, 41, $WS_GROUP) GUICtrlSetOnEvent($CancelButton, "CancelButtonclick") $Progress1 = GUICtrlCreateProgress(88, 408, 449, 17) $ProgressLabel = GUICtrlCreateLabel("Progress:", 88, 376, 71, 24) GUICtrlSetFont($ProgressLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($ProgressLabel, "ProgressLabelClick") $ComputerNameLabel = GUICtrlCreateLabel("Computer Name:", 248, 184, 124, 24) GUICtrlSetFont($ComputerNameLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($ComputerNameLabel, "ComputerNameLabelClick") $ComputerName = GUICtrlCreateInput("ComputerName", 392, 184, 153, 21) GUICtrlSetOnEvent($ComputerName, "ComputerNameChange") $DomainNameLabel = GUICtrlCreateLabel("Domain:", 56, 224, 63, 24) GUICtrlSetFont($DomainNameLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($DomainNameLabel, "DomainNameLabelClick") $Domain = GUICtrlCreateCombo("", 160, 224, 193, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetOnEvent($Domain, "DomainChange") $UserNameLabel = GUICtrlCreateLabel("User Name:", 56, 264, 88, 24) GUICtrlSetFont($UserNameLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($UserNameLabel, "UserNameLabelClick") $UserName = GUICtrlCreateInput("UserName", 160, 264, 193, 21) GUICtrlSetOnEvent($UserName, "UserNameChange") $PassWordLabel = GUICtrlCreateLabel("Password:", 56, 304, 77, 24) GUICtrlSetFont($PassWordLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($PassWordLabel, "PassWordLabelClick") $Input2 = GUICtrlCreateInput("Password", 160, 304, 193, 21) GUICtrlSetOnEvent($Input2, "Input2Change") $DriveBrowse = GUICtrlCreateButton("Browse", 400, 24, 65, 25, $WS_GROUP) GUICtrlSetOnEvent($DriveBrowse, "DriveBrowseClick") $SuggestModelLabel = GUICtrlCreateLabel("Suggested Model:", 400, 105, 133, 24) GUICtrlSetFont($SuggestModelLabel, 12, 400, 0, "MS Sans Serif") GUICtrlSetOnEvent($SuggestModelLabel, "SuggestModelLabelClick") $ModelButton = GUICtrlCreateButton("Browse", 400, 61, 65, 25, $WS_GROUP) GUICtrlSetOnEvent($ModelButton, "ModelButtonclick") $wimfile = GUICtrlCreateInput("wimfile", 184, 24, 209, 21) GUICtrlSetOnEvent($wimfile, "wimfileChange") $model = GUICtrlCreateInput("model", 184, 64, 209, 21) GUICtrlSetOnEvent($model, "modelChange") $Icon1 = GUICtrlCreateIcon("C:\Windows\System32\imageres.dll", -83, 512, 16, 89, 81, BitOR($SS_NOTIFY,$WS_GROUP)) GUICtrlSetOnEvent($Icon1, "Icon1Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;Declare varibles here Dim $wimfile Dim $SelectedWim Dim $hApplySourceEdit Dim $STDERR_CHILD Dim $STDOUT_CHILD Dim $treeview ; Start of Main *************************************** While 1 Sleep(100) WEnd ; End of Main ***************************************** Func CancelButtonclick() Exit EndFunc Func CaptureButtonclick() EndFunc Func ComputerNameChange() EndFunc Func ComputerNameLabelClick() EndFunc Func DomainChange() EndFunc Func DomainNameLabelClick() EndFunc Func DriveBrowseClick() $SelectedWim = FileOpenDialog("Open wim file:", "X:\", "Image (*.wim)", 2) If @error Then MsgBox(4096,"","No File(s) chosen") Else $SelectedWim = StringReplace($SelectedWim, "|", @CRLF) MsgBox(4096,"","You chose " & $SelectedWim) GUICtrlSetData ($wimfile,$SelectedWim) EndIf EndFunc Func Form1_1Close() Exit EndFunc Func Form1_1Maximize() EndFunc Func Form1_1Minimize() EndFunc Func Form1_1Restore() EndFunc Func Icon1Click() EndFunc Func ImageButtonclick() EndFunc Func Input2Change() EndFunc Func KBoxAgentClick() EndFunc Func KeyboardChange() EndFunc Func KeyboardLableClick() EndFunc Func MakeUSBButtonclick() EndFunc Func ModelButtonclick() EndFunc Func modelChange() EndFunc Func PassWordLabelClick() EndFunc Func ProgressLabelClick() EndFunc Func SelectModelLabelClick() EndFunc Func SelectWimLabelClick() EndFunc Func SuggestModelLabelClick() EndFunc Func TimeZoneChange() EndFunc Func TimeZoneLabelClick() EndFunc Func UserNameChange() EndFunc Func UserNameLabelClick() EndFunc Func wimfileChange() EndFunc Func PollImage() EndFunc ;==>PollImage -
Hi Guy's, I'm new to this site and scripting in general. I'm working on a project to deploy Windows 7 to users in my company sometime next year, we would like to automate it so that when we start a machine with a WinPE (3.0) USB stick, a window will open and allow the user to select a Site, for the purpose of mapping the correct distribution share, then browse to the correct .wim file, and image number. At this point we would like to be able to Name the computer, and join it to the domain with the correct username and password credentials, and also install the KBox agent for software deployment. I have a WinPE image with ImageX and GImageX installed and this works fine, is there anyway of building in the functionality we need, would be grateful of any pointers in the right direction. Cheers Derek