Page 1 sur 1

[Ex] Automatiser l'automatisation d'une installation

Posté : mar. 02 mars 2021 01:35
par TommyDDR
Suite au message de @thomas , j'ai décidé de faire un programme pour automatiser l'automatisation d'une installation. :shock:

Le but du programme est d'enregistrer les actions lors d'une installation, pour ne plus avoir besoin de jouer avec AutoIt Window Info.

Utilisation :
1) Lancez le programme à installer
2) Lancez ce programme (s'il ne l'est pas déjà)
3) Installez le programme du 1)
4) Appuyez sur F1
5.1) Renseignez un nom de fichier pour enregistrer le script généré
5.2) Ne renseignez pas de fichier pour mettre le script généré dans le presse papier
6) Recommencez à partir de 1) ou appuyez sur F2 pour quitter

Et voilà ! Votre script est généré !
Le mieux reste de le tester pour vérifier que tout est bon (peut être qu'il faudra ajouter un Sleep ou 2 pour que tout se déroule bien)
Il faudra aussi penser à ajouter la ligne Run() pour lancer le l'installation du dit programme.

Re: [Ex] Automatiser l'automatisation d'une installation

Posté : mer. 03 mars 2021 10:03
par thomas
Merci ^^
le programme généré retourne une erreur:
"Setup Was cancelled or ran into an unexpected error
La méthode DragMove ne peut être appelée que lorsque le bouton principal de la souris est enfoncé"

voici le programme généré:

Code : Tout sélectionner

#include <AutoItConstants.au3>
#RequireAdmin

install()

Func install()
	Local $hwnd
	Local $selector

	$hwnd = winWaitVisible("PDFCreator")
	Sleep(250)
	$selector = 0
	winWaitVisible($hwnd, $selector)
	ControlClick($hwnd, "", $selector, "left", 1, 841, 125)
	ControlClick($hwnd, "", $selector, "left", 1, 583, 210)
	ControlClick($hwnd, "", $selector, "left", 1, 727, 525)
	ControlClick($hwnd, "", $selector, "left", 1, 652, 521)
	$hwnd = winWaitVisible("PDFCreator")
	Sleep(250)
	$selector = 0
	winWaitVisible($hwnd, $selector)
	ControlClick($hwnd, "", $selector, "left", 1, 138, 514)
	$hwnd = winWaitVisible("PdfCreator")
	Sleep(250)
	$selector = 0
	winWaitVisible($hwnd, $selector)
	ControlClick($hwnd, "", $selector, "left", 1, 843, 24)
EndFunc

Func winWaitVisible($hwnd, $ctrlId = Null)
	Local $hwndCheck
	While 1
		$hwndCheck = $ctrlId == Null ? $hwnd : ControlGetHandle($hwnd, '', $ctrlId)
		If(BitAND(WinGetState($hwnd), $WIN_STATE_VISIBLE) == $WIN_STATE_VISIBLE) Then ExitLoop
		Sleep(10)
	WEnd
	Return WinGetHandle($hwnd)
EndFunc

Re: [Ex] Automatiser l'automatisation d'une installation

Posté : lun. 18 oct. 2021 15:15
par Iutech
Bonjour.
Cela a l'air intéressant, mais je ne comprends pas les instructions à suivre ?
C'est quel programme qu'il faut lancer à l'étape 2 ?

Re: [Ex] Automatiser l'automatisation d'une installation

Posté : mar. 19 oct. 2021 22:35
par TommyDDR
Le programme à lancer est celui fourni dans le post 1 : install.au3

Re: [Ex] Automatiser l'automatisation d'une installation

Posté : dim. 09 avr. 2023 14:36
par bundyal
TommyDDR or thomas do you already have a working script that I can use?
from Automate the automation of an installation ?
If so can I get an update of the script.
maybe with an example in it of the application.

Because I would like to have a starting script to make a setup of eg Foxit Reader, or VLC Player etc...

Greatz

Re: [Ex] Automatiser l'automatisation d'une installation

Posté : ven. 28 avr. 2023 15:50
par TommyDDR
script works fine for me (just tested few minutes ago to be sure)