Code : Tout sélectionner
#include <GUIConstants.au3>
FileInstall("C:\TEMP\appli.ini","C:\TEMP\appli.ini",1);installation du fichier appli.ini
$lisloc=IniReadSection("C:\TEMP\appli.ini","Aplloc")
$liscom=IniReadSection("C:\TEMP\appli.ini","Aplcom")
$lismet=IniReadSection("C:\TEMP\appli.ini","Aplmet")
GUICreate("AutoTemplate 1.0",410,270) ;creation de la fenetre princiale
$srv=GUICtrlCreateInput("Kcc23xxx",50,10,60) ;creation de la boite de saisi du nom de serveur
$appli=GUICtrlCreateTab(10,50,150,80) ;creation du tableau
GUICtrlCreateTabItem("Aplloc") ;creation du menu aplloc dans le tableau
$aplloc=GUICtrlCreateCombo ("",20,100,130)
If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
For $i = 1 To $lisloc[0][0]
GUICtrlSetData(-1,$lisloc[$i][0])
Next
EndIf
GUICtrlCreateTabItem("Aplcom");creation du menu aplcom dans le tableau
$aplcom=GUICtrlCreateCombo ("",20,100,130)
If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
For $j = 1 To $liscom[0][0]
GUICtrlSetData(-1,$liscom[$j][0])
Next
EndIf
GUICtrlCreateTabItem("Aplmet");creation du menu aplmet dans le tableau
$aplmet=GUICtrlCreateCombo ("",20,100,130)
If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
For $k = 1 To $lismet[0][0]
GUICtrlSetData(-1,$lismet[$k][0])
Next
EndIf
GUICtrlCreateTabitem ("");Fin des tab
GUICtrlCreateGroup ("Install/Desinstall/Reperso",10,140,150,75) ;creation du groupe de bouton install et desinstall
$inst=GUICtrlCreateRadio("I",40,160,40,20)
$uninst=GUICtrlCreateRadio("D",100,160,40,20)
$reperso=GUICtrlCreateRadio("RP",70,185,40,20)
$Button_1=GUICtrlCreateButton("Lancer",50,235,60) ;creation du bouton de lancement
GuiCtrlCreateGroup("Logs",180,10,220,130);creation du groupe de bouton fichier log
$softdata=GUICtrlCreateButton("SoftData.mif",190,30,200)
$logposte=GUICtrlCreateButton("C:\WINNT\DIFFUSIO\"&@computername&".log",190,65,200)
$boutton3=GUICtrlCreateButton("C:\WINNT\PDT\LOGS\"&@computername&".log",190,100,200)
GuiCtrlCreateGroup("Répertoire des logs",180,140,220,120);creation du groupe de bouton fichier log
$boutton4=GUICtrlCreateButton("C:\WINNT\PDT\DIFFUSIO\",190,160,200)
$boutton5=GUICtrlCreateButton("C:\WINNT\PDT\LOGS\",190,195,200)
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg=$softdata
Run(@ComSpec&" /c "&"notepad.exe C:\WINNT\DIFFUSIO\SOFTDATA.MIF","",@SW_HIDE)
Case $msg=$logposte
Run(@ComSpec&" /c "&"notepad.exe C:\WINNT\DIFFUSIO\"&@computername&".log","",@SW_HIDE)
case $msg=$boutton3
Run(@ComSpec&" /c "&"notepad.exe C:\WINNT\PDT\LOGS\"&@computername&".log","",@SW_HIDE)
case $msg=$boutton4
Run(@ComSpec&" /c "&"explorer.exe C:\WINNT\DIFFUSIO","",@SW_HIDE)
case $msg=$boutton5
Run(@ComSpec&" /c "&"explorer.exe C:\WINNT\PDT\LOGS","",@SW_HIDE)
Case $msg = $Button_1
$srvmap=GUICtrlRead($srv)
$typapl=GUICtrlRead($appli)
$typactI=guictrlread($inst)
$typactII=guictrlread($uninst)
$typactIII=GUICtrlRead($reperso)
dim $typact,$stat,$prod,$appl
if $typapl=0 then $appl=GUICtrlRead($aplloc)
if $typapl=1 then $appl=guictrlread($aplcom)
if $typapl=2 then $appl=guictrlread($aplmet)
if $typapl=0 then $prod=IniRead("C:\TEMP\appli.ini","Aplloc",$appl,"")
if $typapl=1 then $prod=IniRead("C:\TEMP\appli.ini","Aplcom",$appl,"")
if $typapl=2 then $prod=IniRead("C:\TEMP\appli.ini","Aplmet",$appl,"")
if $typactI=1 then $typact="I"
If $typactII=1 then $typact="D"
if $typactIII=1 then $typact="RP"
Run(@ComSpec&" /c "&"net use k: \\"&$srvmap&"\portalis","",@SW_HIDE)
do
$stat=DriveStatus("k:")
until $stat="READY"
Run(@ComSpec&" /c "&"k:\TEMPLATE\ExecTPL.cmd "&$prod& " "&$typact,"",@SW_HIDE)
EndSelect
Wend