Je souhaite faire un lanceur avec des checkboxs, pour remplacer un vieux .bat qui demandait pour tous les logiciels si oui ou non on voulait l'installer. J'ai parcouru le forum j'ai pu faire ceci :
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 361, 345, 299, 210)
Global $Group1 = GUICtrlCreateGroup("Logiciels", 80, 48, 201, 265)
Global $CHK_powerpoint = GUICtrlCreateCheckbox("Powerpoint OneNote ", 120, 88, 129, 25)
Global $CHK_notepad = GUICtrlCreateCheckbox("notepad", 120, 120, 97, 17)
Global $CHK_filezilla = GUICtrlCreateCheckbox("Filezilla", 120, 152, 97, 17)
Global $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 120, 184, 97, 17)
Global $Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 120, 216, 97, 17)
Global $BTN_installer = GUICtrlCreateButton("Installer", 144, 256, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $BTN_installer
_DoInstallation()
EndSwitch
WEnd
Func _DoInstallation()
If GUICtrlRead($CHK_powerpoint)=$GUI_CHECKED Then
RunWait(@COMSPEC & " /k \\serveur\powerpoint\install.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOG=C:\installpower.txt")
Sleep(500)
EndIf
If GUICtrlRead($CHK_notepad)=$GUI_CHECKED Then
RunAswait ( "admin", "MonDomaine", "MonPWD", 0, "cscript \\LeServeur\Appli\InstallNotepad.bat //b" )
Sleep(500)
EndIf
If GUICtrlRead($CHK_filezilla)=$GUI_CHECKED Then
RunAswait ( "admin", "MonDomaine", "MonPWD", 0, "cscript \\LeServeur\Appli\InstallFilezilla.bat //b" )
Sleep(500)
EndIf
EndFunc
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 361, 345, 299, 210)
Global $Group1 = GUICtrlCreateGroup("Logiciels", 80, 48, 201, 265)
Global $CHK_powerpoint = GUICtrlCreateCheckbox("Powerpoint OneNote ", 120, 88, 129, 25)
Global $CHK_notepad = GUICtrlCreateCheckbox("notepad", 120, 120, 97, 17)
Global $CHK_filezilla = GUICtrlCreateCheckbox("Filezilla", 120, 152, 97, 17)
Global $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 120, 184, 97, 17)
Global $Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 120, 216, 97, 17)
Global $BTN_installer = GUICtrlCreateButton("Installer", 144, 256, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $BTN_installer
_DoInstallation()
EndSwitch
WEnd
Func _DoInstallation()
If GUICtrlRead($CHK_powerpoint)=$GUI_CHECKED Then
RunWait(@COMSPEC & " /k \\serveur\powerpoint\install.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOG=C:\installpower.txt")
Sleep(500)
EndIf
If GUICtrlRead($CHK_notepad)=$GUI_CHECKED Then
RunAswait ( "admin", "MonDomaine", "MonPWD", 0, "cscript \\LeServeur\Appli\InstallNotepad.bat //b" )
Sleep(500)
EndIf
If GUICtrlRead($CHK_filezilla)=$GUI_CHECKED Then
RunAswait ( "admin", "MonDomaine", "MonPWD", 0, "cscript \\LeServeur\Appli\InstallFilezilla.bat //b" )
Sleep(500)
EndIf
EndFunc
J'aimerai voir l'invite de commande, ou plutot ce qu'il s'y passe à l’intérieur. Peut on intégrer ça a auto it ? dans un textarea par exemple ?