also in meinem Programm erscheint erstmal eine gui wo man einen Pfad angeben soll und dann auf "übernehmen" klicken soll. Danach wird die GUI geschlossen und die nächsten GUI soll geöffnet werden. Ich hab schon einiges ausprobiert, aber statt zu die 2. GUI anzuzeigen beendet er nur das Skript. Hat einer ne Idee? oder kannmir sagen was ich flasch gemacht habe?
Nicht wundern, das Programm ist in der aufbauphase noch beiweitem!!! daher gehen einige funktionen nicht etc.
danke für Hilfe!
Spoiler anzeigen
#Include <Array.au3>
#Include <File.au3>
#include <GUIConstantsEx.au3>
#Include <GuiListBox.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
;Window1
Global $x=0
$pfadWIn=GUICreate("Pfadangabe", 250, 300)
GUISetOnEvent($GUI_EVENT_CLOSE, "_GUIEvents")
GUISetState(@SW_SHOW, $pfadWin)
$pfad=GUICtrlCreateInput("D:\Setups", 10, 30)
$pfadbutton=GUICtrlCreateButton("Übernehmen", 50, 100)
GUICtrlSetOnEvent($pfadbutton, "_uebernehmen")
While True
Sleep(10)
WEnd
;Func _uebernehmen()
;Window2
If $x=1 Then
$mainWindow=GUICreate("Installer", 510, 600)
GUISetOnEvent($GUI_EVENT_CLOSE, "_GUIEvents")
GUISetState(@SW_SHOW, $mainWindow)
;Listbox
$programmlistelinks=_GUICtrlListBox_Create($mainWindow, "", 10, 30, 200, 450, BitOr($WS_VSCROLL,$LBS_EXTENDEDSEL,$LBS_SORT))
$programmlisterechts=_GUICtrlListBox_Create($mainWindow, "", 300, 30, 200, 450, BitOr($WS_VSCROLL,$LBS_EXTENDEDSEL,$LBS_SORT))
;Menüs
$menu1=GUICtrlCreateMenu("Datei")
$menu2=GUICtrlCreateMenu("Extras")
$menu3=GUICtrlCreateMenu("Info")
$menu21=GUICtrlCreateMenu("Zählen", $menu2)
$verSetups=GUICtrlCreateMenuItem("Vergübare Setups", $menu21)
$ausSetups=GUICtrlCreateMenuItem("Ausgewählte Setups", $menu21)
$menu11=GUICtrlCreateMenuItem("Pfadangabe", $menu1)
$menu12=GUICtrlCreateMenuItem("beenden", $menu1)
GUICtrlSetOnEvent($menu11, "_pfadangabe")
GUICtrlSetOnEvent($menu12, "_beenden")
GUICtrlSetOnEvent($verSetups, "_anzahlboxlinks")
GUICtrlSetOnEvent($ausSetups, "_anzahlboxrechts")
;Buttons
$button0=GUICtrlCreateButton("T", 10, 5, 30, 25)
$button1=GUICtrlCreateButton(">", 240, 100, 30, 25)
$button2=GUICtrlCreateButton("A>", 240, 150, 30, 25)
$button3=GUICtrlCreateButton("X", 240, 200, 30, 25)
$button4=GUICtrlCreateButton("<X", 240, 250, 30, 25)
$button5=GUICtrlCreateButton("SETUP", 450, 545)
GUICtrlSetOnEvent($button0, "_test")
GUICtrlSetOnEvent($button1, "_auswahl")
GUICtrlSetOnEvent($button2, "_auswahlGesamt")
GUICtrlSetOnEvent($button3, "_cancel")
GUICtrlSetOnEvent($button4, "_cancelGesamt")
GUICtrlSetOnEvent($button5, "_setup")
;Global $pfad=
$progress=GUICtrlCreateProgress(10, 510, 490, 20)
$progressInformation=GUICtrlCreateLabel("Momentan wird installiert: < Derzeit läuft keine Installation >", 10, 480, 300)
; Pfad auf den Ordner in dem deine Installationsordner liegen sollen
$programme=_FileListToArray("D:\Setups")
; #Hier wird die linke Listcontrol mit den Ordnernamen unterhalb des von dir angegebenen Verzeichnisses gefüllt
For $i=1 To $programme[0]
_GUICtrlListBox_AddString($programmlistelinks, $programme[$i])
Next
;EndFunc
EndIf
Func _GUIEvents()
Select
Case @GUI_CtrlId = $GUI_EVENT_CLOSE
Exit
EndSelect
EndFunc
; #Die Funktion _auswahlGesamt() markiert zuerst alle Einträge der linken Control und füllt danach die rechte mit den entsprechenden Einträgen auf
Func _auswahlGesamt()
_GUICtrlListBox_SetSel($programmlistelinks, -1)
$i=0
If _GUICtrlListBox_GetText($programmlistelinks, 0)<>"" Then
Do
If _GUICtrlListBox_GetSel($programmlistelinks, $i)=True Then
_GUICtrlListBox_AddString($programmlisterechts, _GUICtrlListBox_GetText($programmlistelinks, $i))
_GUICtrlListBox_DeleteString($programmlistelinks, $i)
If $i>0 Then
$i-=1
EndIf
Else
$i+=1
EndIf
Until $i=_GUICtrlListBox_GetCount($programmlistelinks)
EndIf
EndFunc
Func _auswahl()
$i=0
If _GUICtrlListBox_GetText($programmlistelinks, 0)<>"" Then
Do
If _GUICtrlListBox_GetSel($programmlistelinks, $i)=True Then
_GUICtrlListBox_AddString($programmlisterechts, _GUICtrlListBox_GetText($programmlistelinks, $i))
_GUICtrlListBox_DeleteString($programmlistelinks, $i)
If $i>0 Then
$i-=1
EndIf
Else
$i+=1
EndIf
Until $i=_GUICtrlListBox_GetCount($programmlistelinks)
EndIf
EndFunc
Func _cancel()
$i=0
If _GUICtrlListBox_GetText($programmlisterechts, 0)<>"" Then
Do
If _GUICtrlListBox_GetSel($programmlisterechts, $i)=True Then
_GUICtrlListBox_AddString($programmlistelinks, _GUICtrlListBox_GetText($programmlisterechts, $i))
_GUICtrlListBox_DeleteString($programmlisterechts, $i)
If $i>0 Then
$i-=1
EndIf
Else
$i+=1
EndIf
Until $i=_GUICtrlListBox_GetCount($programmlisterechts)
EndIf
EndFunc
; #Die Funktion _cancelGesamt; genau andersrum wie auswahlGesamt()
Func _cancelGesamt()
_GUICtrlListBox_SetSel($programmlisterechts, -1)
$i=0
If _GUICtrlListBox_GetText($programmlisterechts, 0)<>"" Then
Do
If _GUICtrlListBox_GetSel($programmlisterechts, $i)=True Then
_GUICtrlListBox_AddString($programmlistelinks, _GUICtrlListBox_GetText($programmlisterechts, $i))
_GUICtrlListBox_DeleteString($programmlisterechts, $i)
If $i>0 Then
$i-=1
EndIf
Else
$i+=1
EndIf
Until $i=_GUICtrlListBox_GetCount($programmlisterechts)
EndIf
EndFunc
; installieren
Func _setup()
If _GUICtrlListBox_GetCount($programmlisterechts)<>0 Then
$s=0
For $i = 0 To _GUICtrlListBox_GetCount($programmlisterechts)
$programmSetup=_GUICtrlListBox_GetText($programmlisterechts, $i)
GUICtrlSetData($progressInformation, "Momentan wird installiert: < " & $programmSetup & " >")
Run("D:\Setups\" & $programmSetup)
ProcessWaitClose("autoinstall.exe")
$s+=(100/_GUICtrlListBox_GetCount($programmlisterechts))
GUICtrlSetData($progress, $s)
Next
GUICtrlSetData($progressInformation, "Momentan wird installiert: < Installationsvorgang beendet >")
Sleep(1500)
_cancelGesamt()
GUICtrlSetData($progressInformation, "Momentan wird installiert: < Derzeit läuft keine Installation >")
GUICtrlSetData($progress, 0)
Else
MsgBox(64,"Message", "Keine Setups ausgewählt!")
EndIf
EndFunc
Func _anzahlboxlinks()
MsgBox(4160, "Information", "Anzahl: " & _GUICtrlListBox_GetCount($programmlistelinks))
EndFunc
Func _anzahlboxrechts()
MsgBox(4160, "Information", "Anzahl: " & _GUICtrlListBox_GetCount($programmlisterechts))
EndFunc
;PFADWINDOW---------------------------
Func _pfadangabe()
$pfad=GUICtrlCreateInput("D:\Setups", 10, 30)
$knopf=GUICtrlCreateButton("Übernehmen", 100, 100)
GUICtrlSetOnEvent($knopf, "_uebernehmen")
EndFunc
;-------------------------------------
Func _test()
;GUISetState(@GUI_CTRLId = $GUI_EVENT_CLOSE)
MsgBox( 0, "E", "test erfolg")
;WinClose("test")
EndFunc
Func _beenden()
Exit
EndFunc
Func _uebernehmen()
$x=1
;WinSetState("Installer", "", @SW_SHOW)
Winclose("Pfadangabe")
EndFunc