le but du script est de automatiser les installation.
Les Listes Pour Xp Seven et Serveur fonctionne tres bien mais Personnaliser ne veut pas fonctionner
► Afficher le texte
#include <Array.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#requireadmin
Func emv()
SplashTextOn("Software installation", "Installation de EMV en cours...")
sleep(2000)
SplashOff()
TrayTip("EMV","Début d'installation EMV",1000)
ShellExecute("emv.exe")
WinWaitActive("Installation","Bienvenue dans l'assistant d'installation de Serveur Softpos EMV1")
sleep(500)
send("{ENTER}")
send("kangoo")
send("{TAB}")
send("kangoo")
send("{ENTER}")
send("{ENTER}")
send("{ENTER}")
send("{ENTER}")
send("{ENTER}")
WinWaitActive("Installation","Fin de l'installation de Serveur Softpos EMV1")
send("{ENTER}")
EndFunc
Func bulzip()
SplashTextOn("Software installation", "Installation de Bullzip en cours...")
sleep(2000)
SplashOff()
TrayTip("Bullzip","Début d'installation Bullzip",1000)
ShellExecute("bullzip.exe")
WinWaitActive("Langue de l'assistant d'installation","Veuillez sélectionner la langue")
send("{ENTER}")
WinWaitActive("Installation","Bienvenue dans l'assistant d'installation de Bullzip PDF Printer")
send("{ENTER}")
send("!a")
Sleep(500)
send("{ENTER}")
Sleep(500)
send("{ENTER}")
Sleep(500)
send("{ENTER}")
Sleep(500)
send("{ENTER}")
Sleep(500)
send("{ENTER}")
Sleep(500)
send("{ENTER}")
Sleep(500)
WinWaitActive("Installation","Fin de l'installation de Bullzip PDF Printer")
Send ("{UP}")
Send ("{SPACE}")
Send ("{ENTER}")
EndFunc
Func pcAnywhere()
SplashTextOn("Software installation", "Installation de pcAnywhere en cours...")
sleep(2000)
SplashOff()
TrayTip("pcAnywhere","Début d'installation pcAnywhere",1000)
;Lance du programme d'installation
ShellExecute("pcAnywhere\setup.exe")
WinWaitActive("Choisissez la langue d'installation")
send("{ENTER}")
WinWaitActive("Symantec pcAnywhere","Bienvenue dans le programme")
send("{ENTER}")
send("!j")
send("{ENTER}")
Sleep(500)
send("{ENTER}")
Sleep(500)
send("{ENTER}")
Sleep(500)
send("{ENTER}")
Sleep(500)
send("{ENTER}")
WinWaitActive("Symantec pcAnywhere","Assistant InstallShield terminé")
send("{ENTER}")
; Configuration du pcAnywhere
;Send("#r")
;Sleep(500)
;send ("Winaw32.exe")
;Sleep(500)
EndFunc
Func openvpn()
SplashTextOn("Software installation", "Installation de OpenVpn en cours...")
sleep(2000)
SplashOff()
TrayTip("OpenVpn","Début d'installation OpenVpn",1000)
;Lance du programme d'installation
ShellExecute("openvpn\openvpn.exe")
WinWaitActive("OpenVPN","Welcome to the OpenVPN")
send("{ENTER 4}")
WinWaitActive("OpenVPN","Setup was completed successfully")
send("{ENTER}")
send("{SPACE}")
send("{ENTER}")
; Copie fichier Kangourou.ovpn dans c:\programes\openvpn\config
FileCopy ( "openvpn\kangourou.ovpn", "c:\program files\openvpn\config")
EndFunc
Func Ammyy()
SplashTextOn("Software installation", "Installation de ammyy en cours...")
sleep(2000)
SplashOff()
; Copie fichier AA_v3.exe dans c:\Windows
FileCopy ( "Ammyy", "c:\windows")
; Affichage d'une infobulle d'information
TrayTip("Ammyy","Début d'installation d'Ammy",1000)
;Lance du programme d'installation
ShellExecute("AA_v3.exe")
; Attendre la fenetre principale du programme Ammyy
WinWaitActive("Ammyy")
Sleep (1000)
Send ("{ALT}") ;alt
Send ("{ENTER 2}");enter
Send ("{TAB 5}") ;tab
Send ("{ENTER}");enter
Send ("{TAB}") ;tab
Send ("{ENTER}");enter
Send ("{TAB 3}") ;tab
;Pause de 3 secondes
Sleep(1000)
Send ("kangourousav")
Send ("{TAB}") ;tab
Send ("kangourousav")
;Send ("{TAB}") ;tab
Send ("{ENTER}");enter
Sleep(1000)
Send ("{TAB 6}") ;tab
Send ("{ENTER}");enter
Send ("{TAB 2}") ;tab
Send ("{ENTER}");enter
;Pause de 3 secondes
Sleep(1000)
Send ("{ALT}") ;alt
Send ("{DOWN 3}") ;down
Send ("{RIGHT}") ;droite
Send ("{ENTER 2}");enter
Send ("{ALT}") ;alt
Send ("{DOWN 3}") ;down
Send ("{RIGHT}") ;droite
Send ("{DOWN}") ;down
Send ("{ENTER 2}");enter
Send ("!{F4}")
EndFunc
Func Chrossloop()
SplashTextOn("Software installation", "Installation de Chrossloopen cours...")
sleep(2000)
SplashOff()
; Affichage d'une infobulle d'information
TrayTip("Installation de Croosloop","Début d'installation de Croosloop",1000)
;Lance du programme d'installation
ShellExecute("Crls.exe")
; Attendre la fenetre principale du programme Croosloop
WinWaitActive("Langue de l'assistant d'installation")
; Effectuer un Ok Pour choisir la langue Fr
Opt("WinTitleMatchMode", 1)
WinWaitActive( "Langue de l'assistant d'installation" )
Send ("{TAB}")
Send ("{ENTER 2}")
Send ("{TAB}")
Send ("{UP}")
Send ("{ENTER}")
Send ("{ENTER}")
Send ("{ENTER}")
Opt("WinTitleMatchMode", 1)
WinWaitActive( "Installation - CrossLoop","Fin de l'installation de CrossLoop" )
Send ("{SPACE}")
Send ("{ENTER}")
EndFunc
Func NET()
SplashTextOn("Software installation", "Installation de Chrossloopen cours...")
sleep(2000)
SplashOff()
TrayTip("Installation .NET Framwark4","Début d'installation",1000)
;Lance du programme d'installation
ShellExecute("Net4.exe")
Sleep(100)
Opt("WinTitleMatchMode", 1)
WinWaitActive( "Installation de Microsoft .NET" )
Send( "{TAB 3}" )
Send ( "{SPACE}" )
Send ( "{ENTER}" )
Opt("WinTitleMatchMode", 1)
WinWaitActive( "Installation de Microsoft .NET","Installation terminée" )
Send( "{TAB}" )
Send ( "{ENTER}" )
EndFunc
Func vfp()
SplashTextOn("Software installation", "Installation de Chrossloopen cours...")
sleep(2000)
SplashOff()
;Installation Setup9
TrayTip("Installation VFP","Début d'installation Setup9",1000)
ShellExecute("Setupvfp\setup9.exe")
Opt("WinTitleMatchMode", 1)
WinWaitActive( "Installshield Wizard","Bienvenue dans l'Installshield" )
sleep(1000)
send ("{ENTER}")
send ("{UP}")
send ("{ENTER}")
send ("{ENTER}")
send ("{ENTER}")
send ("{ENTER}")
WinWaitActive( "Installshield Wizard","Installhield Wizard de Runtime VFP9 terminé" )
send ("{ENTER}")
; Installation VFPOLEDBSetup
TrayTip("Installation VFP","Début d'installation VFPOLEDBSetup",1000)
ShellExecute("Setupvfp\VFPOLEDBSetup.msi")
Sleep(100)
Opt("WinTitleMatchMode", 1)
WinWaitActive( "Microsoft Visual FoxPro")
send ("{ENTER}")
WinWaitActive( "Microsoft Visual FoxPro","License Agreement")
Send ("!a")
send ("{ENTER}")
send ("{ENTER}")
Opt("WinTitleMatchMode", 1)
WinWaitActive( "Microsoft Visual FoxPro","Select Installation Folder")
send ("{ENTER 2}")
Opt("WinTitleMatchMode", 1)
WinWaitActive( "Microsoft Visual FoxPro","Installation Complete" )
send ("{ENTER}")
EndFunc
Func Softpos()
SplashTextOn("Software installation", "Installation de Softpos en cours...")
sleep(2000)
SplashOff()
TrayTip("Installation SoftPos5","Copie Du Dossier SoftPost",1000)
DirCreate("C:\SOFTPOS5")
FileCopy ( "SOFTPOS5\*.*", "c:\SOFTPOS5")
EndFunc
Func Chrome()
SplashTextOn("Software installation", "Installation de Chrossloopen cours...")
sleep(2000)
SplashOff()
TrayTip("Installation Chrome","Début d'installation",1000)
;Lance du programme d'installation
ShellExecute("Chrome.exe")
sleep(15000)
While 1
If Not ProcessExists("chrome.exe")Then ExitLoop
ProcessClose("Chrome.exe")
WEnd
Send ("!{TAB}")
Send ("!{F4}")
EndFunc
Func smb2()
SplashTextOn("Software installation", "Installation de SMB2 en cours...")
sleep(2000)
SplashOff()
; Installation Smb2
TrayTip("Installation VFP","Début d'installation smb2",1000)
ShellExecute("Setupvfp\smb2-infocache.msi")
Sleep(10000)
EndFunc
Func atten()
SplashTextOn("Software installation", "Installation de Atten en cours...")
sleep(2000)
SplashOff()
TrayTip("Installation Atten","Début d'installation atten.exe",1000)
ShellExecute("atten.exe")
sleep(1000)
Opt("WinTitleMatchMode", 1)
WinWaitActive("UC232A_Win 7_32bit","Bienvenue dans l'InstallShield Wizard de")
send ("{ENTER}")
Sleep(1000)
Opt("WinTitleMatchMode", 1)
WinWaitActive("UC232A_Win 7_32bit","Prêt à lancer l'installation")
send ("{ENTER}")
Sleep(1000)
Opt("WinTitleMatchMode", 1)
WinWaitActive("UC232A_Win 7_32bit","InstallShield Wizard terminé")
send ("{ENTER}")
Sleep(1000)
EndFunc
Global $liste_programmes0[8], $liste_programmes1[8], $liste_programmes2[7]
Dim $liste_programmes0[8] = ["ammyy","Chrossloop","vfp","Chrome","NET","Softpos","smb2","atten"] ;Caisse
Dim $liste_programmes1[9] = ["ammyy","emv","Chrossloop","openvpn","pcAnywhere","Chrome","bulzip","emv","NET"] ;Serveur
Dim $liste_programmes2[7] = ["ammyy","Chrossloop","vfp","Chrome","NET","Softpos","atten"] ;CaisseXP
Dim $liste_programmes3[9] = ["ammyy","emv","Chrossloop","openvpn","pcAnywhere","Chrome","bulzip","emv","NET"] ;Serveur
Local $GUI = GUICreate("Choisir...", 380, 100, 450 , 325)
Local $Radio1 = GUICtrlCreateRadio("Caisse 7", 8, 8, 80, 17)
Local $Radio2 = GUICtrlCreateRadio("Serveur", 200, 8, 80, 17)
Local $Radio3 = GUICtrlCreateRadio("Caisse XP", 100, 8, 80, 17)
Local $CheckBox1 = GUICtrlCreateRadio("Personnaliser",280, 8, 80, 17)
Local $Button1 = GUICtrlCreateButton("OK", 135, 50, 43, 25)
Local $Button2 = GUICtrlCreateButton("Annuler", 190, 50, 43, 25)
GUICtrlSetOnEvent($Button1, "_Choose")
GUICtrlSetOnEvent($Button2, "_Exit")
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUICtrlSetState($radio1, $GUI_CHECKED)
GUISetState(@SW_SHOW)
Func _Exit()
Exit
EndFunc
Func _Choose()
Select
Case BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
GUIDelete()
_LoadListProg0()
Case BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
GUIDelete()
_LoadListProg1()
Case BitAND(GUICtrlRead($radio3), $GUI_CHECKED) = $GUI_CHECKED
GUIDelete()
_LoadListProg2()
Case BitAND(GUICtrlRead($CheckBox1), $GUI_CHECKED) = $GUI_CHECKED
GUIDelete()
_checktest()
EndSelect
EndFunc
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
Func _LoadListProg0()
For $i = 0 to Ubound($liste_programmes0) - 1
Call($liste_programmes0[$i])
Next
EndFunc
Func _LoadListProg1()
For $i = 0 to Ubound($liste_programmes1) - 1
Call($liste_programmes1[$i])
Next
EndFunc
Func _LoadListProg2()
For $i = 0 to Ubound($liste_programmes2) - 1
Call($liste_programmes2[$i])
Next
EndFunc
Func _LoadListProg3()
For $i = 0 to Ubound($liste_programmes3) - 1
Call($liste_programmes2[$i])
Next
EndFunc
Func _IsChecked($control) ;Fonction pour voir si la checkbox est cochée
Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
EndFunc
Func _ListPerso()
If GuiCtrlRead($Check2) = 1 Then
Call($Chrossloop)
EndIf
EndFunc
Func _checktest()
$GUI = GUICreate("Selectionner", 300, 250, 300, 200)
Global $check1 = GUICtrlCreateCheckbox("Ammy", 8, 8, 80, 17)
Global $check2 = GUICtrlCreateCheckbox("Chrosloop", 8, 38, 80, 17)
Global $check3 = GUICtrlCreateCheckbox("Bullzip", 8, 68, 80, 17)
Global $check4 = GUICtrlCreateCheckbox("emv", 8, 98, 80, 17)
Global $check5 = GUICtrlCreateCheckbox("pcAnywhere", 8, 128, 80, 17)
Global $check6 = GUICtrlCreateCheckbox("openvpn", 8, 158, 80, 17)
Global $check7 = GUICtrlCreateCheckbox("NET", 150, 8, 80, 17)
Global $check8 = GUICtrlCreateCheckbox("VFP", 150, 38, 80, 17)
Global $check9 = GUICtrlCreateCheckbox("Softpos", 150, 68, 80, 17)
Global $check10 = GUICtrlCreateCheckbox("Chrome", 150, 98, 80, 17)
Global $check11 = GUICtrlCreateCheckbox("SMB2", 150, 128, 80, 17)
Global $check12 = GUICtrlCreateCheckbox("atten", 150, 158, 80, 17)
Global $Button1 = GUICtrlCreateButton("Installer", 60, 220, 43, 25)
Global $Button2 = GUICtrlCreateButton("Annuler", 180, 220, 43, 25)
GUICtrlSetOnEvent($Button1, "_ListPerso")
GUICtrlSetOnEvent($Button2, "_Exit")
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUICtrlSetState($radio1, $GUI_CHECKED)
GUISetState(@SW_SHOW)
EndFunc