Checkboxabfrage

  • Hallo zusammen,

    ich habe 12 Checkboxen die ich auswählen kann. Dann klicke ich den Button "Installieren" an und es wird gemacht was gewünscht ist. Jetzt zu meiner Frage: Wie bekomme ich es hin, dass der Button "Installieren" solange ausgeraut ist, bis eine oder mehrere Checkboxen aktiviert werden.

    Danke & Gruß
    scheilo

    Einmal editiert, zuletzt von scheilo (14. Juli 2011 um 09:05)

  • Komme damit leider nicht weiter. Code habe ich mal angehängt.

    Gruß
    scheilo

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <GuiStatusBar.au3>
    #include <GuiConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    If @OSArch = "X64" Then
    IniWrite(@TempDir & "\OSArch.ini", "OSArch", "OSArch", "64-Bit")
    Else
    IniWrite(@TempDir & "\OSArch.ini", "OSArch", "OSArch", "32-Bit")
    EndIf

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

    $OSArch = IniRead(@TempDir & "\OSArch.ini", "OSArch", "OSArch", "unbekannt")
    $font1 = "Arial Fett Kursiv"
    $font2 = "Arial Fett"
    $Form1 = GUICreate("HP ProBook 6450b Notebook PC - Windows 7 " & $OSArch, 420, 390, -1, -1)
    $Label1 = GUICtrlCreateLabel("Bitte wählen Sie die zu installierenden Treiber aus:", 8, 10, 400, 17)
    GUICtrlSetFont( - 1, 9, 400, 4, $font1)
    $Checkbox1 = GUICtrlCreateCheckbox("Ricoh Media Card Reader Driver", 8, 40, 400, 25)
    $Checkbox2 = GUICtrlCreateCheckbox("Intel Management Engine Components Treiber und Schnittstelle ", 8, 64, 400, 25)
    $Checkbox3 = GUICtrlCreateCheckbox("LSI HDA-Modemtreiber(High-Definition Audio) für Microsoft Windows", 8, 88, 400, 25)
    $Checkbox4 = GUICtrlCreateCheckbox("Installationsprogramm für Intel-Chipsatz", 8, 112, 400, 25)
    $Checkbox5 = GUICtrlCreateCheckbox("Intel Matrix Storage Manager Driver", 8, 136, 400, 25)
    $Checkbox6 = GUICtrlCreateCheckbox("Treiber für Synaptics TouchPad", 8, 160, 400, 25)
    $Checkbox7 = GUICtrlCreateCheckbox("Wireless LAN-Treiber von Broadcom für Microsoft Windows 7", 8, 184, 400, 25)
    $Checkbox8 = GUICtrlCreateCheckbox("Intel 82577LM und 82577LC Gigabit-Ethernet-Treiber für Microsoft Windows", 8, 208, 400, 25)
    $Checkbox9 = GUICtrlCreateCheckbox("IDT-High-Definition-Audiotreiber(HD)", 8, 232, 400, 25)
    $Checkbox10 = GUICtrlCreateCheckbox("Intel-HD-Grafiktreiber(High-Definition) mit Turbo Boost-Technologie", 8, 256, 400, 25)
    $Checkbox11 = GUICtrlCreateCheckbox("HP 3D DriveGuard", 8, 280, 400, 25)
    $Checkbox12 = GUICtrlCreateCheckbox("HP Hotkey Support", 8, 304, 400, 25)

    $Button1 = GUICtrlCreateButton("Auswahl installieren", 8, 335, 130, 25, 0)
    GUICtrlSetFont( - 1, 9, 400, 0, $font2)
    $Button2 = GUICtrlCreateButton("Beenden", 345, 335, 60, 25, 0)
    GUICtrlSetFont( - 1, 9, 400, 0, $font2)
    $Button3 = GUICtrlCreateButton("Alles auswählen", 150, 335, 130, 25, 0)
    GUICtrlSetFont( - 1, 9, 400, 0, $font2)

    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    Case $Button2
    Exit

    Case $Button1
    MsgBox(64, "Infomation", "Die Installation der ausgewählten Treiber auf einem " & $OSArch & " Betriebssystem startet mit einem Klick auf OK." & @CRLF & "Sobald die Installation abgeschlossen ist startet das Gerät neu.")
    If GUICtrlRead($Checkbox1) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp46999\setup.exe -s")
    If GUICtrlRead($Checkbox2) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp48062\setup.exe -s")
    If GUICtrlRead($Checkbox3) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp48251\setup.exe -s")
    If GUICtrlRead($Checkbox4) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp48432\setup.exe -s")
    If GUICtrlRead($Checkbox5) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp48605\setup.exe -s")
    If GUICtrlRead($Checkbox6) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp49415\setup.exe -s")
    If GUICtrlRead($Checkbox7) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp49541\setup.exe -s")
    If GUICtrlRead($Checkbox8) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp50479\setup.exe -s")
    If GUICtrlRead($Checkbox9) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp50589\setup.exe -s")
    If GUICtrlRead($Checkbox10) = 1 And @OSArch = "X86" Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp52376\setup.exe -s")
    If GUICtrlRead($Checkbox10) = 1 And @OSArch = "X64" Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp52378\setup.exe -s")
    If GUICtrlRead($Checkbox11) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp53544\setup.exe /q REBOOT=REALLYSUPPRESS")
    If GUICtrlRead($Checkbox12) = 1 Then RunWait(@ScriptDir & "\HP6450b_Win7_Prof_x86_x64\sp53547\HPHKS.exe /q REBOOT=REALLYSUPPRESS")
    MsgBox(64, "Hinweis", "Die Installation der Treiber wurde erfolgreich durchgeführt." & @CRLF & "Das Gerät startet in 10 Sekunden neu.", 10)
    run('shutdown.exe -r -f -t 0')
    Case $Button3
    GUICtrlSetState($Checkbox1,$GUI_CHECKED)
    GUICtrlSetState($Checkbox2,$GUI_CHECKED)
    GUICtrlSetState($Checkbox3,$GUI_CHECKED)
    GUICtrlSetState($Checkbox4,$GUI_CHECKED)
    GUICtrlSetState($Checkbox5,$GUI_CHECKED)
    GUICtrlSetState($Checkbox6,$GUI_CHECKED)
    GUICtrlSetState($Checkbox7,$GUI_CHECKED)
    GUICtrlSetState($Checkbox8,$GUI_CHECKED)
    GUICtrlSetState($Checkbox9,$GUI_CHECKED)
    GUICtrlSetState($Checkbox10,$GUI_CHECKED)
    GUICtrlSetState($Checkbox11,$GUI_CHECKED)
    GUICtrlSetState($Checkbox12,$GUI_CHECKED)
    EndSwitch
    WEnd

    [/autoit]
  • In deinem Fall ginge:

    Spoiler anzeigen
    [autoit]


    Case $Checkbox1 To $Checkbox12
    GUICtrlSetState($Button1, $GUI_Disable)
    For $i = $Checkbox1 To $Checkbox12
    If GUICtrlRead($i) = 1 Then
    GUICtrlSetState($Button1, $GUI_enable)
    EndIf
    Next

    [/autoit]

    Das geht aber nur weil du alle Checkboxen direkt hintereinander erstellst.
    Mit array's könnte man dein Script noch ganz schön kürzen ;)

  • Danke, es funktioniert.
    Wie könnte man das Ganze denn kürzen, bin nämlich nicht so der Profi auf dem Gebiet. Im Moment bin ich zufrieden, dass die Skripte laufen.

    Gruß
    scheilo

  • Macht glaub ich jetzt wenig sinn ne 30 Zeilen version zu posten die du nicht verstehst^^
    Aber grundsätzlich ginge es indem man die Pfade, die Programbezeichnungen und die zugehörigen Checkbox id's in ein Array speichert. Dann kann man viel mit for schleifen abfragen

  • Hallo Zusammen ich habe auch ein Problem mit Checkboxen
    Und Zwar wenn ich nicht Auswähle dauert die nächste trotzdem lange bis sie ausgeführt wird .
    kann mir jemand weiter helfen ?

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.3.6.1
    Author: myName

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here

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

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    ;========================Includieren der Dateien===========================================
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 615, 438, 192, 124);erstellt die GUI
    $Checkbox1 = GUICtrlCreateCheckbox("7 Zip", 120, 60, 97, 17);erstellt die Checkbox
    $Checkbox2 = GUICtrlCreateCheckbox("Adobe Reader", 120, 80, 97, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("Antivir", 120, 100, 97, 17)
    $Checkbox4 = GUICtrlCreateCheckbox("CCleaner", 120, 120, 97, 17)
    $Checkbox5 = GUICtrlCreateCheckbox("Cute Writer", 120, 140, 97, 17)
    $Checkbox6 = GUICtrlCreateCheckbox("Defraggler", 120, 160, 97, 17)
    $Checkbox7 = GUICtrlCreateCheckbox("Firefox", 120, 180, 97, 17)
    $Checkbox8 = GUICtrlCreateCheckbox("Foxit Reader", 120, 200, 97, 17)
    $Checkbox9 = GUICtrlCreateCheckbox("Hcf(Manuel)", 120, 240, 97, 17)
    $Checkbox10 = GUICtrlCreateCheckbox("Flash Player(manual)", 120, 220, 97, 17)
    $Checkbox11 = GUICtrlCreateCheckbox("Irwan View", 120, 260, 97, 17)
    $Checkbox12 = GUICtrlCreateCheckbox("Open Office", 120, 280, 97, 17)
    $Checkbox13 = GUICtrlCreateCheckbox("Paint", 120, 300, 97, 17)
    $Checkbox14 = GUICtrlCreateCheckbox("Unicarplus Zls", 240, 100, 97, 17)
    $Checkbox15 = GUICtrlCreateCheckbox("Total Commander", 240, 60, 97, 17)
    $Checkbox16 = GUICtrlCreateCheckbox("Teamviewer", 240, 80, 97, 17)
    $Checkbox17 = GUICtrlCreateCheckbox("Thunderbird", 120, 320, 97, 17)
    $Checkbox18 = GUICtrlCreateCheckbox("UltraVNC 32Bit", 240, 120, 97, 17)
    $Checkbox19 = GUICtrlCreateCheckbox("UltraVNC 64Bit", 240, 140, 97, 17)
    $Okay = GUICtrlCreateButton("Okay", 328, 360, 129, 41);erstellt einen okay button
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 456, 360, 129, 41)
    $Label1 = GUICtrlCreateLabel("Was wollen Sie Installieren?", 216, 24, 136, 17);überschrift
    $Alle = GUICtrlCreateButton("Alle", 200, 360, 129, 41)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

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

    Case $GUI_EVENT_CLOSE;stellt das X button da
    Exit

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

    Case $Okay ; für denn fall falls Okay geklickt wird
    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"7z920.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")

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

    ;==============Problem ist wenn Checkbox eins nicht gewählt ist führt er diese Trotzdem im Hintergrund aus und
    ; es dauert die zeit wenn dann checkbox 2 oder etc ausgewählt ist

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

    If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then Run("C:\Install\AdbeRdr1001_de_DE.exe")
    Sleep(20000)
    Send("{TAB}{TAB}{ENTER}")
    Sleep(100000)
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox3) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"avira_antivir_personal_de.exe" /SILENT @NO_SCAN')
    Send("{ENTER}")
    Sleep(5000)
    Send('exit')
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox4) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"ccsetup309.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox5) = $GUI_CHECKED Then Run("C:\Install\CuteWriter.exe")
    WinWaitActive("Setup - CudePDF Writer")
    Send("{ENTER}{TAB}{UP}{ENTER}{SPACE}{ENTER}{ENTER}")
    Sleep(5000)
    Run("C:\Install\converter.exe")
    WinWaitActive("WinZip Self-Extractor - converter.exe")
    Send("{ENTER}{ENTER}{ENTER}")

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

    If GUICtrlRead($Checkbox6) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox7) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"Firefox Setup 6.0.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox8) = $GUI_CHECKED Then Run("C:\Install\FoxitReader431_enu_Setup.exe")
    WinWaitActive("Foxit Reader Install Wizard","",10)
    Send("{ENTER}{SPACE}{TAB}{TAB}{ENTER}{SPACE}{TAB}{SPACE}{TAB}{TAB}{ENTER}{SPACE}{SPACE}{ENTER}{ENTER}")
    Sleep(10000)
    Send("{SPACE}{ENTER}")

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

    If GUICtrlRead($Checkbox9) = $GUI_CHECKED Then Run("C:\Install\hcf.exe")
    WinWaitActive("Hardcopy Installation","",10)

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

    If GUICtrlRead($Checkbox10) = $GUI_CHECKED Then Run("C:\Install\install_flash_player.exe")

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

    If GUICtrlRead($Checkbox11) = $GUI_CHECKED Then Run("C:\Install\iview427_setup.exe")
    WinWaitActive("IrwanView Setup","",10)
    Send("{ENTER}{ENTER}{ENTER}{TAB}{TAB}{TAB}{TAB}{SPACE}{TAB}{TAB}{ENTER}{SPACE}{ENTER}{ENTER}")
    Run("C:\Install\irfanview_plugins_427_setup.exe")
    Send("{ENTER}{ENTER}{ENTER}{ENTER}{ENTER}")

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

    If GUICtrlRead($Checkbox12) = $GUI_CHECKED Then Run("C:\Install\OOo_3.3.0_Win_x86_install-wJRE_de.exe")
    WinWaitActive("OpenOffice.org 3.3 Installationsvorbereitung","",10)
    Send("{ENTER}")
    Sleep(8000)
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox13) = $GUI_CHECKED Then Run("C:\Install\Paint.NET.3.36.exe")
    WinWaitActive("Paint.NET v3.36","",10)
    Send("{ENTER}{!S}")

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

    If GUICtrlRead($Checkbox14) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox15) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox16) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox17) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox18) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")

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

    If GUICtrlRead($Checkbox19) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")

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

    Case $Abbrechen;für den fall das abbrechen gedrückt wird exit das programm
    Exit

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

    Case $Alle;alle checkboxen werden makiert
    GUICtrlSetState($Checkbox1, $GUI_CHECKED)
    GUICtrlSetState($Checkbox2, $GUI_CHECKED)
    GUICtrlSetState($Checkbox3, $GUI_CHECKED)
    GUICtrlSetState($Checkbox4, $GUI_CHECKED)
    GUICtrlSetState($Checkbox5, $GUI_CHECKED)
    GUICtrlSetState($Checkbox6, $GUI_CHECKED)
    GUICtrlSetState($Checkbox7, $GUI_CHECKED)
    GUICtrlSetState($Checkbox8, $GUI_CHECKED)
    GUICtrlSetState($Checkbox9, $GUI_CHECKED)
    GUICtrlSetState($Checkbox10, $GUI_CHECKED)
    GUICtrlSetState($Checkbox11, $GUI_CHECKED)
    GUICtrlSetState($Checkbox12, $GUI_CHECKED)
    GUICtrlSetState($Checkbox13, $GUI_CHECKED)
    GUICtrlSetState($Checkbox14, $GUI_CHECKED)
    GUICtrlSetState($Checkbox15, $GUI_CHECKED)
    GUICtrlSetState($Checkbox16, $GUI_CHECKED)
    GUICtrlSetState($Checkbox17, $GUI_CHECKED)
    GUICtrlSetState($Checkbox18, $GUI_CHECKED)
    GUICtrlSetState($Checkbox19, $GUI_CHECKED)

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

    EndSwitch
    WEnd

    [/autoit]
  • @skull693: Wow, was für ein Hammer Script :rofl: . Da ging anscheinend etwas verlohren, bitte poste es nochmal. Und bitte schreibe dann deine Fragein vernünftigem Deutsch, denn unter "Und Zwar wenn ich nicht Auswähle dauert die nächste trotzdem lange bis sie ausgeführt wird ." kann ich mir nichts vorstellen.

  • Oh das ist echt ein gutes skript xD also die frage wahr das wenn ich checkbox 1 nicht auswähle checkbox 2 ziehmlich lange braucht aber ist schon gelöst das skript:

    Spoiler anzeigen


    #cs ----------------------------------------------------------------------------

    AutoIt Version: 3.3.6.1
    Author: myName

    Script Function:
    Template AutoIt script.

    #ce ----------------------------------------------------------------------------

    ; Script Start - Add your code below here

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    ;========================Includieren der Dateien===========================================
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 615, 438, 192, 124);erstellt die GUI
    $Checkbox1 = GUICtrlCreateCheckbox("7 Zip", 120, 60, 97, 17);erstellt die Checkbox
    $Checkbox2 = GUICtrlCreateCheckbox("Adobe Reader", 120, 80, 97, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("Antivir", 120, 100, 97, 17)
    $Checkbox4 = GUICtrlCreateCheckbox("CCleaner", 120, 120, 97, 17)
    $Checkbox5 = GUICtrlCreateCheckbox("Cute Writer", 120, 140, 97, 17)
    $Checkbox6 = GUICtrlCreateCheckbox("Defraggler", 120, 160, 97, 17)
    $Checkbox7 = GUICtrlCreateCheckbox("Firefox", 120, 180, 97, 17)
    $Checkbox8 = GUICtrlCreateCheckbox("Foxit Reader", 120, 200, 97, 17)
    $Checkbox9 = GUICtrlCreateCheckbox("Hcf(Manuel)", 120, 240, 97, 17)
    $Checkbox10 = GUICtrlCreateCheckbox("Flash Player(manual)", 120, 220, 97, 17)
    $Checkbox11 = GUICtrlCreateCheckbox("Irwan View", 120, 260, 97, 17)
    $Checkbox12 = GUICtrlCreateCheckbox("Open Office", 120, 280, 97, 17)
    $Checkbox13 = GUICtrlCreateCheckbox("Paint", 120, 300, 97, 17)
    $Checkbox14 = GUICtrlCreateCheckbox("Unicarplus Zls", 240, 100, 97, 17)
    $Checkbox15 = GUICtrlCreateCheckbox("Total Commander", 240, 60, 97, 17)
    $Checkbox16 = GUICtrlCreateCheckbox("Teamviewer", 240, 80, 97, 17)
    $Checkbox17 = GUICtrlCreateCheckbox("Thunderbird", 120, 320, 97, 17)
    $Checkbox18 = GUICtrlCreateCheckbox("UltraVNC 32Bit", 240, 120, 97, 17)
    $Checkbox19 = GUICtrlCreateCheckbox("UltraVNC 64Bit", 240, 140, 97, 17)
    $Okay = GUICtrlCreateButton("Okay", 328, 360, 129, 41);erstellt einen okay button
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 456, 360, 129, 41)
    $Label1 = GUICtrlCreateLabel("Was wollen Sie Installieren?", 216, 24, 136, 17);überschrift
    $Alle = GUICtrlCreateButton("Alle", 200, 360, 129, 41)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###


    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

    Case $GUI_EVENT_CLOSE;stellt das X button da
    Exit

    Case $Okay ; für denn fall falls Okay geklickt wird
    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
    Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung", "", 10)
    Send('C:\Install\"7z920.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")
    EndIf


    If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then
    Run("C:\Install\AdbeRdr1001_de_DE.exe")
    Sleep(20000)
    Send("{TAB}{TAB}{ENTER}")
    Sleep(100000)
    Send("{ENTER}")
    EndIf


    If GUICtrlRead($Checkbox3) = $GUI_CHECKED Then
    Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"avira_antivir_personal_de.exe" /SILENT @NO_SCAN')
    Send("{ENTER}")
    Sleep(5000)
    Send('exit')
    Send("{ENTER}")
    EndIf

    If GUICtrlRead($Checkbox4) = $GUI_CHECKED Then
    Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"ccsetup309.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")
    EndIf


    If GUICtrlRead($Checkbox5) = $GUI_CHECKED Then
    Run("C:\Install\CuteWriter.exe")
    WinWaitActive("Setup - CudePDF Writer")
    Send("{ENTER}{TAB}{UP}{ENTER}{SPACE}{ENTER}{ENTER}")
    Sleep(5000)
    Run("C:\Install\converter.exe")
    WinWaitActive("WinZip Self-Extractor - converter.exe")
    Send("{ENTER}{ENTER}{ENTER}")
    EndIf


    If GUICtrlRead($Checkbox6) = $GUI_CHECKED Then
    Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")
    EndIf

    If GUICtrlRead($Checkbox7) = $GUI_CHECKED Then
    Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"Firefox Setup 6.0.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")
    EndIf

    If GUICtrlRead($Checkbox8) = $GUI_CHECKED Then
    Run("C:\Install\FoxitReader431_enu_Setup.exe")
    WinWaitActive("Foxit Reader Install Wizard","",10)
    Send("{ENTER}{SPACE}{TAB}{TAB}{ENTER}{SPACE}{TAB}{SPACE}{TAB}{TAB}{ENTER}{SPACE}{SPACE}{ENTER}{ENTER}")
    Sleep(10000)
    Send("{SPACE}{ENTER}")
    EndIf


    If GUICtrlRead($Checkbox9) = $GUI_CHECKED Then
    Run("C:\Install\hcf.exe")
    WinWaitActive("Hardcopy Installation","",10)

    EndIf


    If GUICtrlRead($Checkbox10) = $GUI_CHECKED Then
    Run("C:\Install\install_flash_player.exe")
    EndIf


    If GUICtrlRead($Checkbox11) = $GUI_CHECKED Then
    Run("C:\Install\iview427_setup.exe")
    WinWaitActive("IrwanView Setup","",10)
    Send("{ENTER}{ENTER}{ENTER}{TAB}{TAB}{TAB}{TAB}{SPACE}{TAB}{TAB}{ENTER}{SPACE}{ENTER}{ENTER}")
    Run("C:\Install\irfanview_plugins_427_setup.exe")
    Send("{ENTER}{ENTER}{ENTER}{ENTER}{ENTER}")
    EndIf

    If GUICtrlRead($Checkbox12) = $GUI_CHECKED Then
    Run("C:\Install\OOo_3.3.0_Win_x86_install-wJRE_de.exe")
    WinWaitActive("OpenOffice.org 3.3 Installationsvorbereitung","",10)
    Send("{ENTER}")
    Sleep(8000)
    Send("{ENTER}")
    EndIf


    If GUICtrlRead($Checkbox13) = $GUI_CHECKED Then
    Run("C:\Install\Paint.NET.3.36.exe")
    WinWaitActive("Paint.NET v3.36","",10)
    Send("{ENTER}{!S}")
    EndIf


    If GUICtrlRead($Checkbox14) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")


    If GUICtrlRead($Checkbox15) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")


    If GUICtrlRead($Checkbox16) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")


    If GUICtrlRead($Checkbox17) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")


    If GUICtrlRead($Checkbox18) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")


    If GUICtrlRead($Checkbox19) = $GUI_CHECKED Then Run("C:\Windows\System32\cmd.exe")
    WinWaitActive("Administrator: Eingabeaufforderung","",10)
    Send('C:\Install\"dfsetup206.exe" /S')
    Send("{ENTER}")
    Sleep(500)
    Send('exit')
    Send("{ENTER}")


    Case $Abbrechen;für den fall das abbrechen gedrückt wird exit das programm
    Exit


    Case $Alle;alle checkboxen werden makiert
    GUICtrlSetState($Checkbox1, $GUI_CHECKED)
    GUICtrlSetState($Checkbox2, $GUI_CHECKED)
    GUICtrlSetState($Checkbox3, $GUI_CHECKED)
    GUICtrlSetState($Checkbox4, $GUI_CHECKED)
    GUICtrlSetState($Checkbox5, $GUI_CHECKED)
    GUICtrlSetState($Checkbox6, $GUI_CHECKED)
    GUICtrlSetState($Checkbox7, $GUI_CHECKED)
    GUICtrlSetState($Checkbox8, $GUI_CHECKED)
    GUICtrlSetState($Checkbox9, $GUI_CHECKED)
    GUICtrlSetState($Checkbox10, $GUI_CHECKED)
    GUICtrlSetState($Checkbox11, $GUI_CHECKED)
    GUICtrlSetState($Checkbox12, $GUI_CHECKED)
    GUICtrlSetState($Checkbox13, $GUI_CHECKED)
    GUICtrlSetState($Checkbox14, $GUI_CHECKED)
    GUICtrlSetState($Checkbox15, $GUI_CHECKED)
    GUICtrlSetState($Checkbox16, $GUI_CHECKED)
    GUICtrlSetState($Checkbox17, $GUI_CHECKED)
    GUICtrlSetState($Checkbox18, $GUI_CHECKED)
    GUICtrlSetState($Checkbox19, $GUI_CHECKED)


    EndSwitch
    WEnd

  • jetzt habe ich noch eine weitere frage
    und zwar wenn ich jetzt nur checkbox 1 auswähle der die installation ausführt und beendet hat geht er wieder zur uswahl der checkbox aber ich kann da nix auswählen wie geht das