Install Script erstellen

  • Hallo zusammen,


    ich bin neu hier, und möchte gleich mal mit einem Problem antanzen. :)

    ich würde gerne 2Dateien in bestimmte verzeichnise kopieren, soweit habe ich das schon mal getestet, wie gesagt absoluter anfänger. :?:
    Aber wie kann ich in einer BOX eine von diesen drei gruppen zum kopieren wählen??????

    Über einen Tipp oder die richtung weisen wäre nicht scglecht, danke danke.... ;)


    msgbox(0,"Messageboxtitle","hallo copy wird gestartet")
    FileCopy ("C:\TEMP\Install\test1.ini", "C:\Program\1\",1)
    FileCopy ("C:\TEMP\Install\test2.cfg\", "C:\Programme\test2\",1)
    msgbox(1,"Messageboxtitle","Installation beendet")

    msgbox(0,"Messageboxtitle","hallo copy wird gestartet")
    FileCopy ("C:\TEMP\Install\test10.ini", "C:\Program\10\",1)
    FileCopy ("C:\TEMP\Install\test20.cfg\", "C:\Programme\test20\",1)
    msgbox(1,"Messageboxtitle","Installation beendet")

    msgbox(0,"Messageboxtitle","hallo copy wird gestartet")
    FileCopy ("C:\TEMP\Install\test100.ini", "C:\Program\100\",1)
    FileCopy ("C:\TEMP\Install\test200.cfg\", "C:\Programme\test200\",1)
    msgbox(1,"Messageboxtitle","Installation beendet")

  • Hallo hulkmann,

    so z.B.:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>

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

    Opt('MustDeclareVars', 1)

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

    Example()

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

    Func Example()
    Local $Radio_1, $Radio_2, $Radio_3, $Radio_4, $Kopieren, $msg

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

    GUICreate("My GUI with Radiogroup") ; will create a dialog box that when displayed is centered

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

    GUICtrlCreateGroup("Datei zum kopieren auswählen:", 10, 10, 190, 200)
    $Radio_1 = GUICtrlCreateRadio("Radio 1", 20, 40)
    $Radio_2 = GUICtrlCreateRadio("Radio 2", 20, 70)
    $Radio_3 = GUICtrlCreateRadio("Radio 3", 20, 100)
    $Kopieren = GUICtrlCreateButton("Kopieren", 30, 170)

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

    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

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

    GUISetState() ; will display the GUI

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

    ; Run the GUI until the dialog is closed
    While 1
    $msg = GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Kopieren
    If BitAND(GUICtrlRead($Radio_1), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(0, "Radio", "1 ausgewählt")
    If BitAND(GUICtrlRead($Radio_2), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(0, "Radio", "2 asugewählt")
    If BitAND(GUICtrlRead($Radio_3), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(0, "Radio", "3 asugewählt")
    EndSwitch
    WEnd
    EndFunc ;==>Example

    [/autoit]

    du musst nur noch deine Copy-Funktionen einbauen,

    Edit: überflüssige Zeilen entfernt

    mfg (Auto)Bert

    Einmal editiert, zuletzt von AutoBert (26. April 2010 um 18:12)

  • Hi!

    Der Code Von Auto Bert ist schon etwas komplexer als das was ich dir angeboten hätte.
    Du scheinst mir aber eher ein kompletter Anfänger zu sein. (nicht böse gemeind)
    Also hier etwas einfacheres.

    Spoiler anzeigen
    [autoit]


    $msgbox = MsgBox(1, "Messageboxtitle", "hallo copy wird gestartet")
    If $msgbox = 1 Then
    $error = FileCopy("C:\TEMP\Install\test1.ini", "C:\Program\1\", 1)
    If Not $error Then MsgBox(0, "Messageboxtitle", "Installation fehler C:\TEMP\Install\test1.ini")
    $error = FileCopy("C:\TEMP\Install\test2.cfg\", "C:\Programme\test2\", 1)
    If Not $error Then MsgBox(0, "Messageboxtitle", "Installation fehler C:\TEMP\Install\test2.cfg\")
    MsgBox(0, "Messageboxtitle", "Installation beendet")
    EndIf

    [/autoit]

    If not :?: then ?( else :thumbup: