Code : Tout sélectionner
;*** INCLUDE DES LIBRAIRIES ***
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
; *** VERIFICATION DE LA VERSION ***
RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Outlook\InstallRoot","Path")
If @error = "0" Then
$versionoffice = "2007"
Else
EndIf
RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Outlook\InstallRoot","Path")
If @error = "0" Then
$versionoffice = "2010"
Else
EndIf
; *** DECLARATION DES VARIABLES => KB Office 2007 ***
$KB2289158 = "Microsoft Office 2007 Security Update\Office2007-kb2289158-fullfile-x86-glb.exe"
;$btninstall = GUICtrlCreateButton("Installer", 210, 300, 80, 25)
; *** DECLARATION DES VARIABLES => Graphique ***
Global $Largeur = 500, $Hauteur = 450, $Titre = "MAJ pour Office 365"
Local $Ver = "Version 1.0" , $msg,$Label2,$btninstall,$Progress1
#Region ### START Koda GUI section ### Form=c:\form1.kxf
$Form1_1 = GUICreate($Titre & " - " & $Ver, $Largeur, $Hauteur, 167, 130)
GUISetFont(10, 400, 0, "Arial")
GUISetBkColor(0xFFFFFF)
$Progress1 = GUICtrlCreateProgress(72, 248, 361, 25)
GUICtrlSetColor(-1, 0x99B4D1)
GUICtrlSetBkColor(-1, 0x000000)
$Pic1 = GUICtrlCreatePic("Microsoft-office-365.jpg", 144, 296, 225, 137)
$Label1 = GUICtrlCreateLabel("La version d'Office installée est " & $versionoffice & " !", 72, 112, 283, 22)
GUICtrlSetColor(-1, 0x808080)
$btninstall = GUICtrlCreateButton("Installer", 210, 300, 80, 25)
$Label2 = GUICtrlCreateLabel("Cliquez sur Installer pour lancer la mise à jour.", 72, 208, 283, 22)
GUICtrlSetColor(-1, 0x808080)
$Pic2 = GUICtrlCreatePic("Logo.jpg", 104, 16, 283, 78)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $btninstall
Switch $versionoffice
Case 2007
MsgBox(4096,"TEST 2007","Je rentre bien dans l'installation")
GuiCtrlSetData($Label2, "Installation en cours : " & $KB2289158 & " ...")
Run($KB2289158 & " /quiet")
Case 2010
;....
EndSwitch
EndSelect
WEnd