Install-Menu mit Checkboxen, wo ist ein Fehler?

  • hallo,
    bin neu hier und hab ne frage. ich hab für all meine setups scripte gemacht und mir mit koda ein menu mit checkboxen erstellt (im onevent modus).

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUIOnEventMode", 1)
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 239, 264, 193, 125)
    $Checkbox1 = GUICtrlCreateCheckbox("Acrobat Reader", 10, 8, 97, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("Alcohol 120", 10, 32, 97, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("AutoIT", 10, 56, 97, 17)
    $Checkbox4 = GUICtrlCreateCheckbox("CDEx", 10, 80, 97, 17)
    $Checkbox5 = GUICtrlCreateCheckbox("ConvertXtoDVD", 10, 104, 97, 17)
    $Checkbox6 = GUICtrlCreateCheckbox("FFDShow", 10, 128, 97, 17)
    $Checkbox7 = GUICtrlCreateCheckbox("Firefox", 10, 152, 97, 17)
    $Checkbox8 = GUICtrlCreateCheckbox("Framework 2.0", 10, 176, 97, 17)
    $Checkbox9 = GUICtrlCreateCheckbox("Java", 10, 200, 97, 17)
    $Checkbox10 = GUICtrlCreateCheckbox("KM Player", 138, 8, 97, 17)
    $Checkbox11 = GUICtrlCreateCheckbox("MP3Gain", 138, 32, 97, 17)
    $Checkbox12 = GUICtrlCreateCheckbox("Nero Micro", 138, 56, 97, 17)
    $Checkbox13 = GUICtrlCreateCheckbox("Thunderbird", 138, 80, 97, 17)
    $Checkbox14 = GUICtrlCreateCheckbox("Unlocker", 138, 104, 97, 17)
    $Checkbox15 = GUICtrlCreateCheckbox("Updatepack", 138, 128, 97, 17)
    $Checkbox16 = GUICtrlCreateCheckbox("WinRAR", 138, 152, 97, 17)
    $Checkbox17 = GUICtrlCreateCheckbox("Checkbox17", 138, 176, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox18 = GUICtrlCreateCheckbox("Checkbox18", 138, 200, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox19 = GUICtrlCreateCheckbox("Checkbox19", 266, 8, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox20 = GUICtrlCreateCheckbox("Checkbox20", 266, 32, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox21 = GUICtrlCreateCheckbox("Checkbox21", 266, 56, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox22 = GUICtrlCreateCheckbox("Checkbox22", 266, 80, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox23 = GUICtrlCreateCheckbox("Checkbox23", 266, 104, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox24 = GUICtrlCreateCheckbox("Checkbox24", 266, 128, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox25 = GUICtrlCreateCheckbox("Checkbox25", 266, 152, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox26 = GUICtrlCreateCheckbox("Checkbox26", 266, 176, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox27 = GUICtrlCreateCheckbox("Checkbox27", 266, 200, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox28 = GUICtrlCreateCheckbox("Checkbox28", 386, 8, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox29 = GUICtrlCreateCheckbox("Checkbox29", 386, 32, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox30 = GUICtrlCreateCheckbox("Checkbox30", 386, 56, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox31 = GUICtrlCreateCheckbox("Checkbox31", 386, 80, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox32 = GUICtrlCreateCheckbox("Checkbox32", 386, 104, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox33 = GUICtrlCreateCheckbox("Checkbox33", 386, 128, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox34 = GUICtrlCreateCheckbox("Checkbox34", 386, 152, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox35 = GUICtrlCreateCheckbox("Checkbox35", 386, 176, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox36 = GUICtrlCreateCheckbox("Checkbox36", 386, 200, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox37 = GUICtrlCreateCheckbox("Checkbox37", 506, 8, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox38 = GUICtrlCreateCheckbox("Checkbox38", 506, 32, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox39 = GUICtrlCreateCheckbox("Checkbox39", 506, 56, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox40 = GUICtrlCreateCheckbox("Checkbox40", 506, 80, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox41 = GUICtrlCreateCheckbox("Checkbox41", 506, 104, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox42 = GUICtrlCreateCheckbox("Checkbox42", 506, 128, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox43 = GUICtrlCreateCheckbox("Checkbox43", 506, 152, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox44 = GUICtrlCreateCheckbox("Checkbox44", 506, 176, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Checkbox45 = GUICtrlCreateCheckbox("Checkbox45", 506, 200, 97, 17)
    GUICtrlSetState(-1, $GUI_HIDE)
    $Button1 = GUICtrlCreateButton("Installieren", 10, 224, 123, 25, 0)
    GUICtrlSetOnEvent($button1, "button1")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Sleep(100)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    func button1()
    If GUICtrlRead($Checkbox1) = 1 Then RunWait("IT\Acrobat Reader.exe")
    If GUICtrlRead($Checkbox2) = 1 Then RunWait("IT\Alcohol120 1.exe")
    If GUICtrlRead($Checkbox3) = 1 Then RunWait("IT\AutoIT.exe")
    If GUICtrlRead($Checkbox4) = 1 Then RunWait("IT\CDEx.exe")
    If GUICtrlRead($Checkbox5) = 1 Then RunWait("IT\ConvertXtoDVD.exe")
    endfunc

    [/autoit]

    habe jetzt nur mal die ersten 5 befehle zum testen geschrieben. wenn ich zb 1,4 u 5 anhacke und den button drücke startet das erste script und installiert erfolgreich, es startet das cdex script, er wartet ca 5sek und das letzte script startet ohne irgendwas zu machen.
    im cdex script steht einfach nur das er einen ordner in den programmordner kopiert und 5 sek wartet(was über die gui aber nicht geht).

    wo liegt da der fehler?

    danke im voraus!

    Einmal editiert, zuletzt von 05071991R (9. März 2008 um 14:24)

    • Offizieller Beitrag

    Die Funktion solltest Du lieber so schreiben:

    [autoit]


    func button1()
    If BitAnd(GUICtrlRead($Checkbox1),$GUI_CHECKED) Then RunWait("IT\Acrobat Reader.exe")
    If BitAnd(GUICtrlRead($Checkbox2),$GUI_CHECKED) Then RunWait("IT\Alcohol120 1.exe")
    If BitAnd(GUICtrlRead($Checkbox3),$GUI_CHECKED) Then RunWait("IT\AutoIT.exe")
    If BitAnd(GUICtrlRead($Checkbox4),$GUI_CHECKED) Then RunWait("IT\CDEx.exe")
    If BitAnd(GUICtrlRead($Checkbox5),$GUI_CHECKED) Then RunWait("IT\ConvertXtoDVD.exe")
    endfunc

    [/autoit]

    Ansonsten sehe ich da keine Probleme. Zeig mal die Installationsscripte, in denen die Fehler auftreten.

  • mit deiner funktion bekomme ich genau das selbe problem.
    starte ich die scripte manuell, funktionieren sie alle oder wie ich jetzt getestet habe sie mit der install datei in ein sfx archiv zu geben und über die gui zu starten, geht auch tadellos! (geht das über autoit auch direkt? das skript in die install datei zu packen?)
    acrobat reader

    [autoit]

    run("setups\acrobat reader.exe")

    [/autoit][autoit][/autoit][autoit]

    WinWait("Adobe", "folder")
    ControlSetText("Adobe", "", "Edit1", @ProgramFilesDir & "\Acrobat Reader\")
    ControlClick("Adobe", "Install", "Button2")
    WinWaitClose("Adobe")

    [/autoit]

    cdex:

    [autoit]

    DirCopy("Setups\CDEx", @programfilesdir & "\CDEx", 1)
    sleep("5000")

    [/autoit]

    komisch :?:

    edit: vertausche ich die position der scripte (also cdex als checkbox1 gehts auch nicht, aber acrobat reader an 4. stelle schon)

    Einmal editiert, zuletzt von 05071991R (2. März 2008 um 17:20)

    • Offizieller Beitrag

    Versuch's mal hiermit:

    [autoit]


    func button1()
    If BitAnd(GUICtrlRead($Checkbox1),$GUI_CHECKED) Then RunWait(@ScriptDir & "\IT\Acrobat Reader.exe")
    If BitAnd(GUICtrlRead($Checkbox2),$GUI_CHECKED) Then RunWait(@ScriptDir & "\IT\Alcohol120 1.exe")
    If BitAnd(GUICtrlRead($Checkbox3),$GUI_CHECKED) Then RunWait(@ScriptDir & "\IT\AutoIT.exe")
    If BitAnd(GUICtrlRead($Checkbox4),$GUI_CHECKED) Then RunWait(@ScriptDir & "\IT\CDEx.exe")
    If BitAnd(GUICtrlRead($Checkbox5),$GUI_CHECKED) Then RunWait(@ScriptDir & "\IT\ConvertXtoDVD.exe")
    endfunc

    [/autoit]

    Ansonsten: Wie sieht denn die Verzeichnisstruktur aus? Wo liegen die Installationsscripte? Ausgehend von diesem Script.

  • sorry für die späte antwort. ich hab jetzt einfach alles in sfx archive gepackt (is sowieso praktischer) und es funktioniert perfekt. danke für deine hilfe :thumbup: