Jump to content

runwait problem


Recommended Posts

Ok, i have a slight problem in my program, for the 2 loops here creatte my GUI

Global $Fichier = "Logiciel.ini"

$Tabulation = GUICtrlCreateTab(10,50,500,300)

$boucleonglet=IniRead($Fichier,"information","nombreonglet",""); number of tabitems

dim $z,$y,$x,$w=0,$j=0

For $r=0 to $boucleonglet ; number of time it will loop for the tabitems

$y=100

$x=40

$boucleprogramme= Iniread($Fichier,"secteur"& $z,"nombreprogramme",""); number of programme in the loop

$onglet= IniRead($Fichier,"secteur"& $z,"descrip",""); name of the tabitem

guictrlcreatetabitem($onglet) ; create the tabitem

$bob=Iniread($Fichier,"secteur"& $z,"Description",""); in teh tabitem there is a label and it make

;Guictrlsetdata($lbl3,$bob) ; label in my user interface to tell me he really put it in the table

$w=1

guictrlsetstate($onglet,$GUI_FOCUS)

If $boucleprogramme <> 0 Then

For $b=1 to $boucleprogramme

GUICtrlCreateLabel($bob,40,80)

$nomcheckbox=Iniread($Fichier,"secteur"& $z,"Logiciel" & $w,"")

$tableau[$j]=GUICtrlCreateCheckbox($nomcheckbox,$x,$y,300,20) ; create the checkbox with the text in the .ini file and add it to a table

$y=$y+20 ;make sure the checkbox goes lower

$tableau_rep[$j]=Iniread("logiciel.ini","secteur"& $z,"Path" & $w,"") ; gets the path stated in teh Logiciel.ini file and put it into a table

GUICtrlSetData($lbl3,$tableau_rep[$j]) ; show in the lable at top of the screen what is in the table

$w=$w+1 ; change the Logicielname

$j=$j+1

Next

EndIf

$z=$z+1

Next

Everything is ok exept that it stay on first tab and show no checkbox( i could use help on how to fix this one) i teste lots of thing none worked even the guicreatetabitem("")

Now my veryfication loop to start the install of my program is

Func Installer()

Runwait("Z:\Logiciels\DAO\Autocad 2008\Autocad 2008 Reseau.lnk") ; Test to see if .lnk programm start alone

dim $j=0

;dim $total = Iniread("Logiciel.ini","information","programmetotal","") ; read in the Logiciel.ini the number of program ther eis ( i stated it in the file)

For $j = 0 to 20 Step 1

If GUICtrlRead($tableau[$j]) = 1 Then ;all the Paths for the programe are in Tableau_rep wich is supposed to be linked at same number as tableau

;MsgBox(0,"allo",$tableau_rep[$j])

Runwait($tableau_rep[$j])

EndIf

Next

EndFunc

Here is my total code

CODE
#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

#include "Process.au3"

#include <GuiConstants.au3>

#include <GuiTab.au3>

Global $Fichier = "Logiciel.ini" ; fichier contenant les logiciels

dim $compteur=0

Dim $Demarrer,$Quitter ; Boutons

Dim $Boite_Largeur=500,$Boite_Longueur=700 ; La boite d'interface graphique (dimension)

;>>>>>>>>>>>>> CREATE GUI <<<<<<<<<<<<<<<<<

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode

$mainwindow = GUICreate("Installation Logiciel", 600, 400)

$Quitterbutton = GUICtrlCreateButton("Quitter", 250, 350, 60)

GUICtrlSetOnEvent($Quitterbutton, "CLOSEClicked")

$lbl1=GUICtrlCreateLabel("Choisir les logiciels a installer...", 30, 10)

$lbl3=GUICtrlCreateLabel("Tableau", 300, 30,200)

$okbutton = GUICtrlCreateButton("Crée moi une interface", 25, 350, 150)

$Roger=GUICtrlCreateButton("Installer",350,350,75)

GUICtrlSetOnEvent($okbutton, "BtnDemarrer")

GUICtrlSetOnEvent($Roger,"Installer")

GUISetState(@SW_SHOW)

dim $programmetotal=0

dim $tableau[100]

Dim $tableau_rep[100]

BtnDemarrer()

;=========================================================================================

dim $tab1,$tab2,$tab3,$tab4, $r

dim $boucleprogramme

dim $boucleonglet=0

$programmetotal=Iniread("logiciel.ini","information","programmetotal","")

While 1

Sleep(1000) ; Idle around

WEnd

Func BtnDemarrer()

$Tabulation = GUICtrlCreateTab(10,50,500,300)

$boucleonglet=IniRead($Fichier,"information","nombreonglet",""); pour le nombre d'onglet

dim $z,$y,$x,$w=0,$j=0

For $r=0 to $boucleonglet

$y=100

$x=40

$boucleprogramme= Iniread($Fichier,"secteur"& $z,"nombreprogramme",""); pour le nombre de programme dans la boucle

$onglet= IniRead($Fichier,"secteur"& $z,"descrip","")

; incrémentation pour les bloucle pour changer d'onglet

;_GUICtrlTab_InsertItem($Tabulation, $r, $onglet)

guictrlcreatetabitem($onglet)

$bob=Iniread($Fichier,"secteur"& $z,"Description","")

;Guictrlsetdata($lbl3,$bob)

$w=1

guictrlsetstate($onglet,$GUI_FOCUS)

If $boucleprogramme <> 0 Then

For $b=1 to $boucleprogramme

GUICtrlCreateLabel($bob,40,80)

; Création des checkbox et incrémentation pour prendre chaque logiciel

$nomcheckbox=Iniread($Fichier,"secteur"& $z,"Logiciel" & $w,"")

$tableau[$j]=GUICtrlCreateCheckbox($nomcheckbox,$x,$y,300,20)

$y=$y+20

$tableau_rep[$j]=Iniread("logiciel.ini","secteur"& $z,"Path" & $w,"")

GUICtrlSetData($lbl3,$tableau_rep[$j])

$w=$w+1

$j=$j+1

Next

EndIf

$z=$z+1

Next

EndFunc

Func CLOSEClicked()

MsgBox(0, "Fin du programme", "Bah, on recommencera plus tard alors!")

; GUIDelete($mainwindow)

Exit

EndFunc

Func Installer()

Runwait("Z:\Logiciels\DAO\Autocad 2008\Autocad 2008 Reseau.lnk")

dim $j=-1

;dim $total = Iniread("Logiciel.ini","information","programmetotal","")

For $j = 0 to 20 Step 1

If GUICtrlRead($tableau[$j]) = 1 Then

;MsgBox(0,"allo",$tableau_rep[$j])

Runwait($tableau_rep[$j])

EndIf

Next

EndFunc

HEre is what in my Logiciel .ini

CODE
;******************************************************************************************

******

;* *

;* Titre: Instalateur automatisé des logiciels *

;* *

;* Auteur: Emmanuel Fournier et Jacques Gagné *

;* *

;* *

;* ATTENTION SI VOUS AJOUTEZ UN PROGRAMME OU EN SUPRIMER UN, CES VARIABLES SONT A CHANGEZ *

;* SECTION [iNFO] LA VARIABLE nombreonglet ENSUITE DANS CHQUE SECTION LES VARIABLE *

;* nombreprogramme *

;* Date: 2008-06-02 *

;* *

;* *

;* *

;************************************************************************************************

; POUR TOUT INFO SUR LE CODE, CONSULTER LA VERSION IMPRIMANTE: CONFIG.INI

;CONSULTER LA DOCUMENTATION DU FICHIER AVANT TOUTES MODIFICATION!!!!

[information]

nombreonglet= 5

Programmetotal= 20

; PREMIER ONGLET ----------------------------------------------

[secteur1]

Descrip= DAO

Description= Logiciels orientés graphisme

nombreprogramme= 10

Path1= "Z:\Logiciels\DAO\Liscad\liscad62fr.msi"

Logiciel1= Liscad 6.2

Path2= "Z:\Logiciels\DAO\TrueView 2008\Setup.exe"

Logiciel2= True View 2008

Path3= "Z:\Logiciels\DAO\Autocad 2008\Autocad 2008 Local.lnk"

Logiciel3= Autocad 2008 Local

Path4= "Z:\Logiciels\DAO\Autocad 2008\Autocad 2008 Reseau.lnk"

Logiciel4= Autocad 2008 Réseau

Path5= "Z:\Logiciels\DAO\Autocad 2009\Autocad 2009 Reseau.lnk"

Logiciel5= Autocad 2009 Reseau

Path6= "Z:\Logiciels\DAO\Autocad 2009\Autocad 2009 standalone.lnk"

Logiciel6= Autocad 2009 Local

path7= "Z:\Logiciels\DAO\Bentley\MicroStation\Autoinstall\microstation.exe"

Logiciel7= Microstation

path8= "Z:\Logiciels\DAO\Bentley\Descartes\dc08050225en.exe"

Logiciel8= Microstation Descartes (Microstation requis)

path9= "Z:\Logiciels\DAO\Bentley\Geographics\gg08050035en.exe"

Logiciel9= Microstation Geograpique (Microstation requis)

path10= "Z:\Logiciels\DAO\CIVIL2008\Civil 3D 2008.lnk"

Logiciel10= Civil 3D 2008

; DEUXIEME ONGLET ----------------------------------------------

[secteur2]

Descrip= Bureautique

Description= tous les logiciels relié a Adobe et autre

nombreprogramme= 8

path1= "Z:\Logiciels\Bureautique\Acrobat\Acrobat 5\setup.exe"

Logiciel1= Acrobat 5

path2= "Z:\Logiciels\Bureautique\Acrobat\Acrobat 6.0 Professional\setup.exe"

Logiciel2= Acrobat 6.0 Professional

path3= "Z:\Logiciels\Bureautique\Acrobat\Acrobat 7.0 Professional\setup.exe"

Logiciel3= Acrobat 7.0 Professional

path4= "Z:\Logiciels\Bureautique\Acrobat\Acrobat 8.0 Professional\setup.exe"

Logiciel4= Acrobat 8.0 Professional

path5= "Z:\Logiciels\Bureautique\Acrobat\Acrobat 7.0 Standard\setup.exe"

Logiciel5= Acrobat 7.0 Standard

path6= "Z:\Logiciels\Bureautique\Acrobat\Acrobat 8.0 Standard\setup.exe"

Logiciel6= Acrobat 8.0 Standard

path7= "Z:\Logiciels\Bureautique\Visio\VVIEWER.EXE"

Logiciel7= Visio

path8= "Z:\Logiciels\Bureautique\Visio\setup.exe"

Logiciel8= Visio 2003

; TROISIEME ONGLET ----------------------------------------------

[secteur3]

Descrip= A mettre

Description= a voir

nombreprogramme=0

path1= "Z:\Logiciels\DAO\Bentley\MicroStation\Autoinstall\microstation.exe"

Logiciel1= Microstation

path2= "Z:\Logiciels\DAO\Bentley\Descartes\dc08050225en.exe"

Logiciel2= Microstation Descartes (Microstation requis)

path3= "Z:\Logiciels\DAO\Bentley\Geographics\gg08050035en.exe"

Logiciel3= Microstation Geograpique (Microstation requis)

; QUATRIEME ONGLET ----------------------------------------------

[secteur4]

Descrip= Logiciel a classé

Description= Ca dit tout

nombreprogramme= 0

; CINQUIEME ONGLET ----------------------------------------------

[secteur5]

Descrip= Bentley

Description= Les Différentes application de Bentley

nombreprogramme= 0

The bug i have is it will neber start the install of any .lnk files, how can i fix this and my other problem .. is in each tabitem .. the first and the last of the checkbox doesnt work ... what am i missing ? Any help is apreciated. If any question post it here or contact me at Zombryo@gmail.com

Thnx in advance to everyone wo whill check my programm

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...