Code : Tout sélectionner
; Update CG : 11/06/2013
; Au3 to Apply Wim image
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#Include <File.au3>
#Include <Array.au3>
global $test, $check_all, $valids, $valid_nb, $Dossier,$confirmation, $message
global $btn_valid
global $customername, $drivecname, $drivecsize, $drivedname
global $family, $chassis, $model, $scetag, $biosver, $HD0SIZE, $cab32ver, $cab64ver
global $wim, $kelpart, $NB, $tracker, $stick, $SRC
global $name, $filelist, $wimlist, $logopic
global $hdsize0, $hdsize1, $hdsize2
global $Test="Y1", $STOPCG="NO",$duration, $begin, $dif
global $CGTracker="c:\autoid3\donotrun.txt"
if FileExists($CGTracker) then $STOPCG="YES"
WimDetails() ;to assign Wims Folder to Array
PrepaGUI()
RunGUI()
if $confirmation="OK" Then
if $STOPCG="YES" Then
msgbox(0,"NO !! ","Cannot run on GIGI DELL System")
Else
;msgbox(0,"Step","Using Local Diskpart.txt")
;msgbox(0,"Final Step","ApplyWim")
Global $begin = TimerInit()
ApplyWim($wim) ; lance l'install de la Wim
;$howlong=$time-$started
EndIf
EndIf
exit
Func PrepaGUI()
$gui = GuiCreate("Restauration d'image - ID3", 600, 400, -1, -1)
;sleep(5000)
$delagauche=30
$duhaut=70
$pas=20
GUISetFont(9, 600, 1) ; ; Size=9 Bold=600 Std=1
;Warning : Bold Font does not work in WinPE!!
GUICtrlCreateLabel("Client : "&$customername, $DeLaGauche, 20) ; next line
GUICtrlCreateLabel("Partition 1: "&$drivecname&" / Size: "&$drivecsize&" GB- Partition 2: "&$drivedname, $DeLaGauche, 35) ; next line
GUICtrlCreateGroup("Informations Système", 20, $duhaut, 250, 140)
;$duhaut=$duhaut+5
;GUISetFont("","","","","","")
GUISetFont(9, 400, 1) ; Size=9 Normal=400 Std=1
GUICtrlCreateLabel("Famille - Chassis : ", $DeLaGauche, $DuHaut+1*$pas) ; next line
GUISetFont(8, 600, 1) ; ; Size=9 Bold=600 Std=1
GUICtrlCreateLabel($family &" / " & $chassis, $DeLaGauche+125, $DuHaut+1*$pas) ; next line
GUISetFont(9, 400, 1) ; Size=9 Normal=400 Std=1
GUICtrlCreateLabel("Système Dell détecté : ", $delagauche,$DuHaut+2*$pas) ; next line
GUISetFont(8, 600, 1) ; ; Size=9 Bold=600 Std=1
GUICtrlCreateLabel($model, $DeLaGauche+125, $DuHaut+2*$pas) ; next line
GUISetFont(9, 400, 1) ; Size=9 Normal=400 Std=1
GUICtrlCreateLabel("N°de série / SceTag : ", $DeLaGauche, $DuHaut+3*$pas) ; next line
GUISetFont(8, 600, 1) ; ; Size=9 Bold=600 Std=1
GUICtrlCreateLabel($Scetag, $DeLaGauche+125, $DuHaut+3*$pas) ; next line
GUISetFont(9, 400, 1) ; Size=9 Normal=400 Std=1
GUICtrlCreateLabel("TailleHD : ", $DeLaGauche, $DuHaut+4*$pas) ; next line
GUISetFont(8, 600, 1) ; ; Size=9 Bold=600 Std=1
GUICtrlCreateLabel($hdsize0, $DeLaGauche+125, $DuHaut+4*$pas) ; next line
GUISetFont(9, 400, 1) ; Size=9 Normal=400 Std=1
GUICtrlCreateLabel("Version de Bios : ", $DeLaGauche, $DuHaut+5*$pas) ; next line
GUISetFont(8, 600, 1) ; ; Size=9 Bold=600 Std=1
GUICtrlCreateLabel($biosver, $DeLaGauche+125, $DuHaut+5*$pas) ; next line
GUISetFont(9, 400, 1) ; Size=9 Normal=400 Std=1
;GUICtrlCreateLabel("Version CAB File x86 : "&$Cab32ver, $DeLaGauche, $DuHaut+6*$pas) ; next line
;GUICtrlCreateLabel("Version CAB File x64 : "&$Cab64ver, $DeLaGauche, $DuHaut+7*$pas) ; next line
;GUICtrlCreateLabel("-----------------------------------------------------------------",$delagauche,$duhaut+6*$Pas) ; next line Cell1
;_ArrayDisplay($FileList,"liste WIMS") ; verif
$LogoPic=$src&"\"&$customername&"\Logopic.jpg"
GUICtrlCreatePic($stick&"\id\DellID3.jpg",70,$duhaut+8*$pas,50,50) ;Affiche l'image dans ta GUI
GUICtrlCreatePic($LogoPic,50,$duhaut+8*$pas,150,80) ;Affiche l'image dans ta GUI
For $i = 1 to $nb ;pour lister tous les wim de $dossier
$name=stringtrimright($WimList[$i],4) ;4 pour enlever '.wim'
; $name=$FileList[$i] ;4 pour enlever '.wim'
;MsgBox(0,"liste Wim/"&$nb,$name)
$checks[$i][1]=$Name
$checks[$i][0] = GuiCtrlCreateRadio($name, 300, $duhaut+$pas*$i,300)
; $checks[$i][0]=GuiCtrlCreateRadio($name, 350, 20*$i)
Next
GUICtrlSetState($checks[$i-1][0], $GUI_CHECKED)
;_ArrayDisplay($checks,"verif $checks") ; vérification
$btn_valid = GuiCtrlCreateButton("Valider", 300, $duhaut+$pas*$i+30, 70, 25)
EndFunc
Func RunGUI()
GuiSetState()
While 1
$msg = GuiGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $btn_valid
Dim $valids[$nb+1][3] ; crée une array pour les checkbox cochées (ID + dossier)
$valid_nb = 0
For $i = 1 To $nb
If BitAnd(GUICtrlRead($checks[$i][0]), $GUI_CHECKED) = $GUI_CHECKED Then
$valids[$valid_nb][0] = $checks[$i][0]
$valids[$valid_nb][1] = $checks[$i][1]
$Val=$i
$valid_nb += 1
EndIf
Next
;msgbox(0,"Nb de Validnb",$valid_nb)
Redim $valids[$valid_nb+1][3]
; _ArrayDisplay($valids,"verif $valids") ; vérification
$wim=$WimList[$val]
CheckWim($wim)
Confirmation()
if $confirmation="OK" then
;PrepaHD()
PrepaBatchWim($wim)
ExitLoop
Else
Msgbox(16,"ANNULATION", "Opération annulée par l'utilisateur")
ExitLoop
endif
EndSwitch
Wend
EndFunc