Me voila avec un soucis et je ne trouve pas ce qui cloche.
Si j'execute mon script au3 les icones et le numéro de versions apparaissent
si je complite mon script , et que je l'execute plus d'icones ni de version lus
La différence et que pour la compilation je décompresse les executables dans @TempDir.
Quelqu'un pourrait il me dire pourquoi çA ne fonctionne pas ?
► Afficher le textemon code
Code : Tout sélectionner
DirCreate(@tempdir & "\GAO\tmp\")
FileInstall("C:\Users\Cari\Desktop\GAO\avastclear.exe", @tempdir & "\GAO\tmp\avastclear.exe")
FileInstall("C:\Users\Cari\Desktop\GAO\avgremover.exe", @tempdir & "\GAO\tmp\avgremover.exe")
FileInstall("C:\Users\Cari\Desktop\GAO\avgremoverx64.exe", @tempdir & "\GAO\tmp\avgremoverx64.exe")
FileInstall("C:\Users\Cari\Desktop\GAO\avira_registry_cleaner_en.exe", @tempdir & "\GAO\tmp\avira_registry_cleaner_en.exe")
FileInstall("C:\Users\Cari\Desktop\GAO\cleanwipe.exe", @tempdir & "\GAO\tmp\cleanwipe.exe")
FileInstall("C:\Users\Cari\Desktop\GAO\esetuninstaller.exe", @tempdir & "\GAO\tmp\esetuninstaller.exe")
FileInstall("C:\Users\Cari\Desktop\GAO\kavremover.exe", @tempdir & "\GAO\tmp\kavremover.exe")
FileInstall("C:\Users\Cari\Desktop\GAO\mcafeecleanuptool.exe", @tempdir & "\GAO\tmp\mcafeecleanuptool.exe")
FileInstall("C:\Users\Cari\Desktop\GAO\normanviruscontrolclean.exe", @tempdir & "\GAO\tmp\normanviruscontrolclean.exe")
FileInstall("C:\Users\Cari\Desktop\GAO\nortonremovaltool.exe", @tempdir & "\GAO\tmp\nortonremovaltool.exe")
FileInstall("C:\Users\Cari\Desktop\GAO\pandauninstaller.exe", @tempdir & "\GAO\tmp\pandauninstaller.exe")
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=ICO\uninstall.ico
#AutoIt3Wrapper_outfile=GAO.exe
#AutoIt3Wrapper_Res_File_Add=C:\Users\Cari\Desktop\GAO\uninstall.jpg, rt_rcdata, LOGO
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <FileListToArray3.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <IE.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <StructureConstants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
;#include <resources.au3> ; INTEGRATION DES RESSOURCES IMAGES :D La placer dans ton dossier include autoit
#cs ----------------------------------------------------------------------------
AutoIt Version : 3.3.6.0
Auteur du code source de base : Laddy
Fonction du Script : Désinstalleur d'antivirus
Adaptation du script de Sydney en batch : http://batch.xoo.it/t2221-GAO-3-4.htm
Merci Tommyddr pour son exemple Loadicon.au3
Mikell pour File_Install.au3
#ce ----------------------------------------------------------------------------
Opt("GUIOnEventMode", 1) ; evenementiel pour créer l'action de chaque bouton avec une fonction. Pratique lors de multigui.
;déclaration des variables
Global $Path = @TempDir & "\GAO\tmp\";@ScriptDir
Global $Gui
Global $lview
Global $items[1] ; création d'un tableau
Global $version = "1.0.4"
Local $color = 0xFFFFFF
Global $Lang = @OSLang
If $Lang = "040C" Then ; pour mettre en français retirer le not
Dim $aLang[7] = [5, "GAO par -Sydney - Version ", "Désinstalleur", "Quitter", "Historique", "Aide", "Choisir le désinstalleur de votre antivirus"]
Else
Dim $aLang[7] = [5, "GAO By -Sydney - Version ", "Uninstaller", "Quit", "History", "Help", "Choose Your Antivirus Uninstaller"]
EndIf
;~ Variables liées au GUI Historique
Global Const $NomApplication = "GAO - GetOutAntivirus"
Global $version = "1.0.4"
Global $FormAbout
Global $FormAboutCoords
Global $FormAboutOK
Global $FormAboutActiveX
Global $FormAboutIE
Global $FormAboutHTML
Global $Form1_1
GUIRegisterMsg($WM_NOTIFY, "DoubleClick") ; pour gérer le double-clic
Global $Gui = GUICreate($aLang[1] & $version, 458, 295, 201, 130)
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
$backgroundColor = GUISetBkColor($color, $Gui)
Global $Group1 = GUICtrlCreateGroup($aLang[6], 8, 8, 329, 280)
Global $lview = GUICtrlCreateListView("", 15, 34, 313, 245)
_GUICtrlListView_AddColumn($lview, $aLang[2], 200)
_GUICtrlListView_AddColumn($lview, "Version", 95)
_GUICtrlListView_SetExtendedListViewStyle($lview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
$hImages = _GUIImageList_Create(16, 16, 5, 3)
_GUIImageList_AddIcon($hImages, @SystemDir & "\shell32.dll", -3)
_GUICtrlListView_SetImageList($lview, $hImages, 1)
Global $Help = GUICtrlCreateButton($aLang[5], 360, 13, 75, 25)
GUICtrlSetOnEvent($Help, "Aide")
Global $Thanks = GUICtrlCreateButton("Crédits", 360, 51, 75, 25)
GUICtrlSetOnEvent($Thanks, "Thx")
Global $Historique = GUICtrlCreateButton($aLang[4], 360, 202, 75, 25)
GUICtrlSetOnEvent($Historique, "historique")
Global $Quitter = GUICtrlCreateButton($aLang[3], 360, 240, 75, 25)
GUICtrlSetOnEvent($Quitter, "quit")
Global $Pic1 = GUICtrlCreatePic("", 352, 96, 89, 89, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
;_ResourceSetImageToCtrl(-1, "LOGO")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Local $Files = _FileListToArray3($Path, "*.exe", 1, 0, 0, "GAO.exe") ; liste les exe contenu dans le dossier execpté GAO.exe
For $i = 1 To $Files[0]
Local $image = AddIconByFileName($hImages, $Files[$i]) ; ajoute l image via la fonction
Local $item = _GUICtrlListView_AddItem($lview, $Files[$i], $image, 0) ; affiche l image dans la colonne 0
Local $item2 = _GUICtrlListView_AddSubItem($lview, $item, FileGetVersion($Files[$i]), 1) ; affiche le num de version dans la colonne 1
Next
While 1
; Sleep(10)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Help
Aide()
Case $Thanks
Thx()
Case $Quitter
quit()
EndSwitch
WEnd
Func AddIconByFileName($hImages, $FileName)
If (StringInStr(FileGetAttrib($FileName), "D")) Then
$image = _GUIImageList_AddIcon($hImages, @SystemDir & "\shell32.dll", -4) ;Il vaut mieux extraire ca dans une variable globale pour ne pas la recréer à chaque passage.
Else
Local $Ext = GetExtension($FileName)
Local $image
If ($Ext = "ico") Then
$image = _GUIImageList_AddIcon($hImages, $FileName)
Else
Local $Registre = GetNomIconByExt($Ext)
If (Not (FileExists($Registre[0]))) Then
$Registre[0] = @SystemDir & "\" & $Registre[0]
EndIf
If (Not (FileExists($Registre[0]))) Then
$Registre[0] = _WinAPI_FindExecutable($FileName)
$Registre[1] = 0
EndIf
$image = _GUIImageList_AddIcon($hImages, $Registre[0], $Registre[1])
If ($image = -1) Then
If ($Ext = "exe") Then
$image = _GUIImageList_AddIcon($hImages, @SystemDir & "\shell32.dll", -3) ;Il vaut mieux extraire ca dans une variable globale pour ne pas la recréer à chaque passage.
Else
$image = _GUIImageList_AddIcon($hImages, @SystemDir & "\shell32.dll", 0) ;Il vaut mieux extraire ca dans une variable globale pour ne pas la recréer à chaque passage.
EndIf
EndIf
EndIf
EndIf
Return $image
EndFunc ;==>AddIconByFileName
Func GetExtension($Path)
Local $Ext = StringSplit($Path, ".", 3)
Return $Ext[UBound($Ext) - 1]
EndFunc ;==>GetExtension
Func GetNomIconByExt($Ext)
Local $Retour[2] = [-1, -1]
Local $Nom = RegRead("HKEY_CLASSES_ROOT\." & $Ext, "")
Local $NomIcon = RegRead("HKEY_CLASSES_ROOT\" & $Nom & "\DefaultIcon", "")
If (Not (@error)) Then
$NomIcon = StringSplit($NomIcon, ",", 3)
$Retour[0] = GetStringByEnv($NomIcon[0])
If (UBound($NomIcon) > 1) Then
$Retour[1] = $NomIcon[1]
Else
$Retour[1] = 0
EndIf
Else
$NomIcon = RegRead("HKEY_CLASSES_ROOT\" & $Nom & "\shell\open\command", "")
If (Not (@error)) Then
$NomIcon = StringSplit($NomIcon, """", 3)
If (UBound($NomIcon) > 1) Then
$Retour[0] = GetStringByEnv($NomIcon[1])
Else
$Retour[0] = GetStringByEnv($NomIcon[0])
EndIf
$Retour[1] = 0
EndIf
EndIf
Return $Retour
EndFunc ;==>GetNomIconByExt
Func GetStringByEnv($Path)
Local $ExpandEnvStrings = Opt("ExpandEnvStrings", 1)
Local $Return = $Path
Opt("ExpandEnvStrings", $ExpandEnvStrings)
Return $Return
EndFunc ;==>GetStringByEnv
Func quit()
Exit
EndFunc ;==>quit
Func DoubleClick($hWnd, $iMsg, $iwParam, $ilParam)
Local $tagNMHDR = "hwnd hWndFrom;uint_ptr IDFrom;INT Code"
Local $hWndFrom, $iIDFrom, $iCode, $hWndList
$hWndList = $lview
If Not IsHWnd($lview) Then $hWndList = GUICtrlGetHandle($lview)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndList
Switch $iCode
Case $NM_DBLCLK
$indexLV = ControlListView($Gui, "", $hWndList, "GetSelected") ; récupère l'index de la ligne
$itemtxt = ControlListView($Gui, "", $hWndList, "GetText", $indexLV, 0) ; récupère le texte de la ligne, colonne 1
$FichierSelectionne = $itemtxt ; ^^
;msgbox(0,"",$Path &"\"&$FichierSelectionne)
Run(@ComSpec & " /k " & '"' & $Path & "\" & $FichierSelectionne & '"', "", @SW_HIDE)
; Exit
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>DoubleClick
Func Aide()
MsgBox(0, "Instructions", "Effectuez un double-clic sur le programme à désinstaller." & @CRLF & " " & @CRLF & "Boutons Aide = Accéder à l'aide" & @CRLF & "Bouton Crédits = Accéder aux remerciements" & @CRLF & "Bouton Historique = Accéder à l'historique du logiciel" & @CRLF & "Bouton Quitter = Sortir du logiciel")
EndFunc ;==>Aide
Func Thx()
MsgBox(0, "Crédits", ".:Thanks to Laddy (4 CS) :." & @CRLF & ".:Thanks to TommyDDR (4 UDF):." & @CRLF & " " & @CRLF & " Version 4.1" & @CRLF & " By -Sydneysyd-")
EndFunc ;==>Thx
Func historique()
$FormAboutIE = _IECreateEmbedded() ; On Prépare un IE
$FormAbout = GUICreate("Changelog", 510, 355, -1, -1, $DS_MODALFRAME, -1, $Form1_1) ; et un GUI
$FormAboutOK = GUICtrlCreateButton("Sortir", 210, 290, 90, 30) ; un boutton pour ressortir
GUICtrlSetOnEvent($FormAboutOK, "Sortir")
GUISetBkColor(0xFFFFFF)
$FormAboutHTML = "<html><head></head><body bgcolor=#ffffff>" & @CR _
& "<table border=0 cellspacing=0 cellpadding=0 width=489 bgcolor=#ffffff><tr>" & @CR _
& "<td width=163> </td>" & @CR _
& "<td width=163><p align=center><b><u><span style='font-size:12pt;font-family:" & Chr(34) & "Verdana" & Chr(34) & ";color:#1F497D'>" & $NomApplication & "</span></u></b></p></td>" & @CR _
& "<td width=163><p align=center><span style='font-size:8pt;font-family:" & Chr(34) & "Verdana" & Chr(34) & ";color:#1F497D'>v" & $version & "</span></p></td>" & @CR _
& "</tr></table>" & @CR _
& "<Table border=0 cellspacing=0 cellpadding=10 width=489 height=80 bgcolor=#ffffff>" & @CR _
& "<tr><td align=justify><span style='font-size:8pt;font-family:" & Chr(34) & "Verdana" & Chr(34) & "'>" & "Version 3.4.1 - 19.01.2012" & "</span></td></tr>" & @CR _
& "<tr><td align=justify><span style='font-size:8pt;font-family:" & Chr(34) & "Verdana" & Chr(34) & "'>" & "Changement de la version de Norton Removal Tools" & "</span></td></tr>" & @CR _
& "<tr><td align=justify><span style='font-size:8pt;font-family:" & Chr(34) & "Verdana" & Chr(34) & "'>" & "Changement des version d'AVG Remover (64 et 32 bits)" & "</span></td></tr>" & @CR _
& "<tr><td align=justify><span style='font-size:8pt;font-family:" & Chr(34) & "Verdana" & Chr(34) & "'>" & "Changement de la version de Mc Afee Cleanup Tools" & "</span></td></tr>" & @CR _
& "</table>" & @CR _
& "</body></htlm>"
$FormAboutActiveX = GUICtrlCreateObj($FormAboutIE, -2, -2, 530, 280); On met le IE dans la GUI
_IENavigate($FormAboutIE, "about:blank") ; On active l'IE
_IEDocWriteHTML($FormAboutIE, $FormAboutHTML) ; On le remplit
_IEAction($FormAboutIE, "refresh") ; et on l'affiche
GUISetState(@SW_SHOW, $FormAbout)
EndFunc ;==>historique
Func Sortir()
GUIDelete($FormAbout)
EndFunc ;==>Sortir
;FIN DU CODE
► Afficher le textecaptures d'ecran


J'ai beau relire et relire le code je ne comrpend pas d'où ça vient
purriez vous m'expliquer ?
merci
Bonne journée
Laddy






