Code : Tout sélectionner
#include <GuiConstants.au3>
#include <Sound.au3>
FileInstall("realmlist.wtf",@TempDir & "\realmlist.wtf")
FileInstall("Votez.exe",@TempDir & "\Votez.exe")
FileInstall("da2.ico",@TempDir & "\da2.ico")
FileInstall("sound.mp3",@TempDir & "\sound.mp3")
_SoundPlay ( @TempDir & "\sound.mp3" , "0" )
Global $Largeur = 375, $Hauteur = 300, $Titre = "Patch DuraAn "
Local $Ver = "Version 6.2.1"
#region ### START Koda GUI section ###
HotKeySet("{esc}", "fin")
$siteweb = "http://duraan.ath.cx/"
GUISetBkColor (0xE0FFFF)
$n=GUICtrlCreatePic(@Systemdir & "\oobe\images\mslogo.jpg",50,50, 200,50)
$GUI = GUICreate($Titre & $Ver, $Largeur, $Hauteur, -1, -1)
$Color = GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Img = GUICtrlCreatePic("C:\test.jpg",188 , 100, 50, 50, $SS_CENTERIMAGE) ;<== insertion de l'image dans mon GUI...
$ini_case1 = "Ajouter le Site de DuraAn aux favoris"
$case1 = GUICtrlCreateCheckbox($ini_case1, 10, 10, 200, 20)
$ini_case2 = "Lancer le jeu"
$case2 = GUICtrlCreateCheckbox($ini_case2, 10, 70, 120, 20)
$ini_case3 = "Visiter le site DuraAn"
$case3 = GUICtrlCreateCheckbox($ini_case3, 10, 40, 150, 20)
$Button1 = GUICtrlCreateButton("Parcourir...", 290, 150, 75, 25)
$Button2 = GUICtrlCreateButton("", 8000, 955, 0, 0)
$Button3 = GUICtrlCreateButton("Fermer", 10, 270, 75, 25)
$combo = GUICtrlCreateLabel("Séléctionner le dossier World Of Warcraft", 10, 154, 200, 20)
GUISetState(@SW_SHOW)
#endregion ### START Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button1
While 1
$DirInstall = FileSelectFolder("Bienvenue Dans l'Installation Du Patch DuraAn Serveur, Selectionner le dossier: World Of Warcraft.", "")
If FileExists($DirInstall & "\wow.exe") And FileExists($DirInstall & "\realmlist.wtf") Then ExitLoop
MsgBox(48, "Erreur", "Vous n'avez pas selectionné le dossier: World Of Warcraft")
Wend
$combo = GUICtrlCreateInput($DirInstall, 10, 152, 275, 20 )
$Button2 = GUICtrlCreateButton("Installer", 290, 270, 75, 25)
$Button1 = GUICtrlCreateLabel("Parcourir...", 9888, 2111, 75, 25)
Case $Button2
While 1
If FileExists($DirInstall & "\wow.exe") And FileExists($DirInstall & "\realmlist.wtf") Then ExitLoop
MsgBox(48, "Erreur", "Vous n'avez pas selectionné le dossier: World Of Warcraft")
Wend
If BitAND(GUICtrlRead(Eval("case" & 1)), $GUI_CHECKED) Then
FileCreateShortcut("http://duraan.ath.cx",@UserProfileDir & "\Favoris\DuraAn Serveur.LNK","","", "", $DirInstall & "\da2.ico", "", "", "")
GUICtrlSetState(eval("case" & 1),$GUI_UNCHECKED)
EndIf
Installation()
Case $Button3
Fin()
EndSwitch
WEnd
#region ################### Fonctions ###################
Func Installation()
SplashTextOn("", "Installation en cours, Veuillez patienter ...", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
While 2
If FileExists(@TempDir & "\Votez.exe") and FileExists(@TempDir & "\realmlist.wtf") Then ExitLoop
MsgBox(48, "Erreur", "Error Fatal Impossible de continuer l'Installation.")
Exit
Wend
FileDelete($DirInstall & "\realmlist.wtf")
FileCopy (@TempDir & "\realmlist.wtf",$DirInstall , 1)
FileCopy (@TempDir & "\Votez.exe" ,@StartMenuCommonDir & "\Programmes\Démarrage" , 1 )
FileCopy (@TempDir & "\da2.ico",$DirInstall , 1)
FileCreateShortcut($DirInstall & "\wow.exe",@DesktopDir & "\World Of Warcraft DuraAn Serveur.LNK","","", "", $DirInstall & "\da2.ico", "", "", "")
FileCreateShortcut($DirInstall & "\wow.exe",@StartMenuCommonDir & "\Programmes\World Of Warcraft DuraAn Serveur.LNK","","", "", $DirInstall & "\da2.ico", "", "", "")
sleep(500)
FileDelete(@TempDir & "\realmlist.wtf")
FileDelete(@TempDir & "\Votez.exe")
FileDelete(@TempDir & "\da2.ico")
FileDelete(@DesktopDir & "\World Of Warcraft.lnk")
FileDelete(@StartMenuCommonDir & "\Programmes\World Of Warcraft.lnk")
Sleep(2000)
SplashTextOn("", "Installation Terminé!", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
Sleep(2000)
If BitAND(GUICtrlRead(Eval("case" & 2)), $GUI_CHECKED) Then
SplashTextOn("", "Chargement du jeu ...", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
Sleep(2000)
Run($DirInstall & "\wow.exe")
GUICtrlSetState(eval("case" & 2),$GUI_UNCHECKED)
EndIf
If BitAND(GUICtrlRead(Eval("case" & 3)), $GUI_CHECKED) Then
ShellExecute($siteweb)
GUICtrlSetState(eval("case" & 3),$GUI_UNCHECKED)
EndIf
SplashOff()
FileDelete(@TempDir & "sound.mp3")
Exit
EndFunc
Func Fin()
SplashTextOn("", "Fermeture en cours, Veuillez patienter ...", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
FileDelete(@TempDir & "\realmlist.wtf")
FileDelete(@TempDir & "\Votez.exe")
FileDelete(@TempDir & "\da2.ico")
FileDelete(@DesktopDir & "\World Of Warcraft.lnk")
FileDelete(@StartMenuCommonDir & "\Programmes\World Of Warcraft.lnk")
FileDelete(@TempDir & "sound.mp3")
Sleep(1000)
SplashOff()
Exit
EndFunc
Func Lancerjeu()
SplashTextOn("", "Fermeture en cours, Veuillez patienter ...", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
Sleep(1000)
SplashOff()
Exit
EndFunc